Fix/prune batch consensus halt - #131
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes, one runtime version.
spec_version8 → 9,transaction_versionstays at 2 — no dispatch signature changes, no migration, no storage change.Consensus — halted the testnet at 406997
pallet-shielded-pool'son_idlesized the sealed-node sweep from the block's leftover weight. Leftover weight is not consensus: once post-dispatch refunds are in play an author and an importer measure the same block differently, so each pruned a different number of nodes and wrote different state. Frontier folds that state into the Ethereum header it builds inon_finalize, so the divergence surfaced as a mismatched"fron"digest andExecutive::final_checkspanicking with "Digest item must match that calculated."Three validators with identical state and byte-identical extrinsics produced three mutually unimportable blocks; the chain stopped for 4 hours. It survived five days only because empty blocks leave the same leftover weight everywhere — the first block with real EVM traffic split the network three ways.
The sweep now runs in
on_initializeover a constant batch (PRUNED_NODES_PER_BLOCK, unchanged at 512, ~6.5 ms of a 2 s block) and charges the full batch rather than the removals, since a miss costs the same read as a hit. Introduced in #122.Security
unshield.and_providescontributes exactly one tag, so passing it aVeclet reordered inputs mint a second admissible entry for the same spend, let one note back unboundedly many entries, and let transfer/unshield each admit the same note. Admission policy only — consensus unaffected.Tests
prune_batch_is_independent_of_block_fullness— verified by mutation: with the pre-fixon_idlerestored it fails (9 nodes/tree 2 vs 8 nodes/tree 1). Plus three adversarial cases covering batch carving, sealing interleaved with sweeping, and the active tree surviving an exhaustive sweep. 351/351 pass.