-
Couldn't load subscription status.
- Fork 289
Overload Raptor Chunk Header Epoch #2442
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
base: master
Are you sure you want to change the base?
Conversation
5b1fae2 to
56c6220
Compare
11c8ca3 to
18f89d4
Compare
17fa315 to
1166d82
Compare
The base branch was changed.
27f1a77 to
777d786
Compare
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.
Pull Request Overview
This PR addresses an issue where full nodes receive unsolicited Raptor chunks from expired groups during network synchronization. The solution overloads the epoch field in Raptor chunk headers to carry round numbers for secondary RaptorCast (validator-to-fullnode), enabling nodes to correctly identify and service groups based on actual round numbers rather than their potentially stale local state.
Key Changes:
- Introduced
GroupIdenum to distinguish between Primary (epoch-based) and Secondary (round-based) RaptorCast groups - Replaced epoch-only tracking with group-specific identification in chunk headers and validation logic
- Updated group lookup and validation to use round numbers for secondary RaptorCast
- Removed epoch-based pruning from decoder cache in favor of timestamp-based expiration
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| monad-types/src/lib.rs | Removed unused From<Epoch> trait implementation |
| monad-state/src/consensus.rs | Added round field to PublishToFullNodes command |
| monad-router-multi/src/lib.rs | Updated router to propagate round field in full node publishing |
| monad-raptorcast/src/udp.rs | Introduced GroupId enum and updated message parsing/validation |
| monad-raptorcast/src/util.rs | Changed fullnode group storage from heap to BTreeMap keyed by round |
| monad-raptorcast/src/packet/*.rs | Updated packet building to use GroupId instead of raw epoch |
| monad-raptorcast/src/decoding.rs | Removed epoch-based cache pruning logic |
| monad-raptorcast/src/raptorcast_secondary/mod.rs | Updated secondary RaptorCast to use round-based group IDs |
| monad-executor-glue/src/lib.rs | Added round field to PublishToFullNodes enum variant |
| monad-consensus-state/src/command.rs | Extended consensus commands to include round numbers |
| test files | Updated test cases to use new GroupId type |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
A full node may join new RaptorCast groups from the same validator while it's syncing or stuck. In such cases, it may rebroadcast to an expired group because its local round hasn't advanced, and expired groups are not garbage-collected. As a result, many full nodes end up receiving unsolicited Raptor chunks from groups they no longer belong to. The root cause is that the node selects the rebroadcast group based on its local round. This PR resolves the issue by overloading the epoch field in the Raptor chunk header setting it to the round number for secondary raptorcast. This allows syncing or stuck full nodes to use the round number to identify and service the correct group
777d786 to
bd4a661
Compare
A full node may join new RaptorCast groups from the same validator while it's syncing or stuck. In such cases, it may rebroadcast to an expired group because its local round hasn't advanced, and expired groups are not garbage-collected. As a result, many full nodes end up receiving unsolicited Raptor chunks from groups they no longer belong to.
The root cause is that the node selects the rebroadcast group based on its local round. This PR resolves the issue by overloading the epoch field in the Raptor chunk header setting it to the round number for secondary raptorcast. This allows syncing or stuck full nodes to use the round number to identify and service the correct group