Repository navigation
PoS seal activation gate #2170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nullPointerEnjoyer
wants to merge
16
commits into
master
Choose a base branch
from
consensus/pos-seal-activation-gate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PoS seal activation gate #2170
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e8e9c32
feat(chainstate): add optional PoS seal activation gate
nullPointerEnjoyer b3d0c2f
fix(chainstate): address seal gate review round 1
nullPointerEnjoyer 8fd16a5
test(chainstate): harden seal gate twin and refine comments
nullPointerEnjoyer 3602782
test(chainstate): drop an unused mut in the seal gate test
nullPointerEnjoyer 1739c1c
test(chainstate): add the PoS seal adversarial suite
nullPointerEnjoyer 0cf3330
test(chainstate): fix unused variables in the seal tests
nullPointerEnjoyer 5df457a
test(chainstate): fix clippy lints in the seal tests
nullPointerEnjoyer 39052bd
test(chainstate): address seal suite review round 1
nullPointerEnjoyer a266487
test(chainstate): pin seal suite semantics and refusal reachability
nullPointerEnjoyer e4dbb06
test(chainstate): fix clippy lints in the seal test helpers
nullPointerEnjoyer 9531277
test(chainstate): pin the seal gate refusal end to end
nullPointerEnjoyer d484ed5
test(chainstate): drop unused imports in the seal tests
nullPointerEnjoyer 33b90b2
feat(chainstate): enable the seal gate by default on testnet chains
nullPointerEnjoyer 7f14ed9
fix: harden the seal gate config validation and update its docs
nullPointerEnjoyer 96fdb6f
test: silence the unused key warning in the seal tracking test
nullPointerEnjoyer 5ed5ef6
test(chainstate): pin seal gate sighting permanence under invalidation
nullPointerEnjoyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplication classification relies solely on the raw size of the seal index entry, but the index is never pruned when a block is invalidated:
index_block_sealadds block ids permanently, and the block invalidation path (which bypasses the gate viaChainActivationContext::InvalidationRecovery) does not remove seal index entries. Consequently, after a user invalidates one of the twin blocks carrying a reused seal, a segment block whose only duplicate partner is that invalidated block is still classified as fully duplicated and its chain activation is refused indefinitely (until a fresh-seal extension exists). Since invalidated blocks are by definition not part of any acceptable chain, this makes the gate fire on what is effectively a unique seal. Consider skipping invalid-pruned/invalidated block ids when counting partner blocks (e.g. checkingdb_tx.get_block_index(id)status), or documenting why a permanently refused activation is acceptable for invalidated twins.Suggestion:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Investigated — the facts are correct (the classification uses the raw entry size and invalidation does not prune the seal index), but the suggested fix is rejected as a security regression, and the behavior is intended and now pinned.
Why counting only valid partners is a laundering vector: a reused seal becomes "unique" again as soon as one of its twins is invalidated (operator action, or the implicit stale-block invalidation path). That would re-enable exactly the trust-inflation activation the gate exists to refuse — an attacker profits from having one of its own twins invalidated.
Why no honest chain can be affected: honestly-mined VRF proofs are unique, and the reference miner's timestamp search starts at
prev_block_timestamp + 1, so an honest segment always carries at least one fresh seal and activates normally. A segment that is entirely reused-proof blocks is adversarial by construction. Sightings are historical facts; the index is deliberately append-only (fail-closed direction: invalidation can only grow the duplicated set, never shrink it).Recovery: a refused chain activates as soon as it gains a single fresh-seal block, so nothing is stranded permanently.
Pinned end to end in
invalidated_partner_does_not_launder_a_reused_seal(invalidated twin → second reused-proof sibling still refused → fresh-seal child activates), with the rationale documented onsegment_seals_all_duplicated.