-
Notifications
You must be signed in to change notification settings - Fork 801
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
Unsubscribe blob topics at Fulu fork #6932
base: unstable
Are you sure you want to change the base?
Conversation
} | ||
}); | ||
|
||
let max_topics_by_fork = current_and_future_forks |
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.
There's no max
usage here, can we call this all_topics_for_forks
?
.iter() | ||
.map(|topics| topics.len()) | ||
.max() | ||
.unwrap_or(0); |
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.
This should be unreachable but I think it's safe to do an expect
here and exit
If we have 0 topics here something is fundamentally wrong.
&self.network_globals.as_topic_config(), | ||
&self.fork_context.spec, | ||
) { | ||
let topic = GossipTopic::new(kind, GossipEncoding::default(), new_fork_digest); | ||
self.subscribe(topic); | ||
} | ||
|
||
// TODO(das): unsubscribe from blob topics at the Fulu fork |
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.
This TODO can be removed
/// Returns the core topics associated with each fork that are new to the previous fork | ||
pub fn fork_core_topics<E: EthSpec>( | ||
fork_name: &ForkName, | ||
/// Returns all the topics the node should subscribe at `epoch` |
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.
at ForkName
} | ||
|
||
#[test] | ||
fn base_topics_are_always_active() { |
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.
Could you add a test to cover all topics for the latest fork? Similar to what the old test does.
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.
Looks good to me, just a few comments and questions
Issue Addressed
Addresses #6854.
PeerDAS requires unsubscribing a Gossip topic at a fork boundary. This is not possible with our current topic machinery.
Proposed Changes
Instead of defining which topics have to be added at a given fork, we define the complete set of topics at a given fork. The new start of the show and key function is:
core_topics_to_subscribe
only returns the blob topics iffork < Fulu
. Then at the fork boundary, we subscribe with the new fork digest tocore_topics_to_subscribe(next_fork)
, which excludes the blob topics.I added
is_fork_non_core_topic
to carry on to the next fork the aggregator topics for attestations and sync committee messages. This approach is future-proof if those topics ever become fork-dependent.Closes #6854