-
Notifications
You must be signed in to change notification settings - Fork 788
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
[Merged by Bors] - Fixed Gossip Topics on Fork Boundary #2619
Conversation
0c57ee3
to
df8be87
Compare
@pawanjay176 and I had a chat about this internally: see #2532 . There are modifications we should do (as you've pointed out) to the logic as its currently written. However, the current concern is that the current code has been tested across a number of testnet forks. Mainnet is the next in line to fork and we are hesitant to change any fork-switching logic and go into a mainnet fork with untested code. I think we want this PR (and some of the other things we've discussed internally) but we probably should wait until after the mainnet fork. |
To add to what Age said, I don't think we should complicate our logic to subscribe to previous fork topics if we start our node between In my understanding, the unsubscribe after 2 epochs is to ensure that we unsubscribe only after lagging gossip messages on pre-fork topics are received by all nodes. The restarted node could potentially loose out on useful pre-fork attestations and aggregates, but that would only be 1-2 slots worth which is okay imo. Also most nodes would not restart during the fork transition so I'm not totally convinced we should handle this case. Re not making the function fork agnostic, I only realised that it's ugly after the prater fork, so that's totally on me 😅 |
a6f2f96
to
6aa61b6
Compare
Ah - It wasn't obvious to me from the context that this code would only be called during startup and that this deviation from the spec would only cause minor problems in that limited context Originally I thought this wasn't complicated but yeah I suppose in the context of node startup it would mean we'd have to be careful about setting the I've removed subscribing to previous fork topics. @AgeManning @pawanjay176 |
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.
LGTM. Just a minor nit.
1129108
to
76afcb4
Compare
I think this can be unblocked now that the altair fork is done. |
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.
LGTM! Nice
bors r+ |
## Issue Addressed The [p2p-interface section of the `altair` spec](https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/p2p-interface.md#transitioning-the-gossip) says you should subscribe to the topics for a fork "In advance of the fork" and unsubscribe from old topics `2 Epochs` after the new fork is activated. We've chosen to subscribe to new fork topics `2 slots` before the fork is initiated. This function is supposed to return the required fork digests at any given time but as it was currently written, it doesn't return the fork digest for a previous fork if you've switched to the current fork less than 2 epoch's ago. Also this function required modification for every new fork we add. ## Proposed Changes Make this function fork-agnostic and correctly handle the previous fork topic digests when you've only just switched to the new fork.
Pull request successfully merged into unstable. Build succeeded: |
Issue Addressed
The p2p-interface section of the
altair
spec says you should subscribe to the topics for a fork "In advance of the fork" and unsubscribe from old topics2 Epochs
after the new fork is activated. We've chosen to subscribe to new fork topics2 slots
before the fork is initiated.This function is supposed to return the required fork digests at any given time but as it was currently written, it doesn't return the fork digest for a previous fork if you've switched to the current fork less than 2 epoch's ago. Also this function required modification for every new fork we add.
Proposed Changes
Make this function fork-agnostic and correctly handle the previous fork topic digests when you've only just switched to the new fork.