Bump P2P protocol version and guard Toccata IBD#997
Open
michaelsutton wants to merge 3 commits into
Open
Conversation
Advertise protocol 10 for Toccata while normalizing TN12 peers that still advertise protocol 9 into the same Toccata flow set (now named 10).
Start rejecting outdated peer protocol versions one day before toccata activation
Reject stale pre-activation pruning points after Toccata should have produced a newer pruning point, and reject post-activation pruning points from peers not using the Toccata protocol version.
coderofstuff
requested changes
May 13, 2026
| // No activation is configured: | ||
| // PP(pre-activation by score) ---- estimated activation ---- pruning period + margin ---- now | ||
| assert!( | ||
| validate_pruning_point_freshness_for_toccata(&MAINNET_PARAMS, V, pp_hash, pp_timestamp, pp_daa_score, stale_after + 1) |
Collaborator
There was a problem hiding this comment.
This shouldn't use MAINNET_PARAMS, because MAINNET_PARAMS will eventually have the param activated.
Instead, just create a dedicated params set with toccata_activation set to never
|
|
||
| #[test] | ||
| fn test_toccata_pruning_point_staleness_guard() { | ||
| const V: u32 = PROTOCOL_VERSION; |
Collaborator
There was a problem hiding this comment.
Please rename V to a clearer name like TOCCATA_INCLUSIVE_VERSION, or add a comment explaining that this explicitly should be the protocol version including toccata.
PROTOCOL_VERSION may change in the future. If it does, how is this test affected?
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.
Bumps the P2P protocol version for Toccata while preserving TN12 launch compatibility by normalizing its protocol 9 peers locally.
Adds pre-activation version filtering for synced nodes and an IBD pruning point freshness guard so fresh nodes avoid syncing from outdated or stale pre-Toccata peers.