Skip to content

Early-subscribe Gloas proposer_preferences and fix publish digest - #9794

Open
NikhilSharmaWe wants to merge 3 commits into
sigp:unstablefrom
NikhilSharmaWe:fix/gloas-early-proposer-prefs
Open

Early-subscribe Gloas proposer_preferences and fix publish digest#9794
NikhilSharmaWe wants to merge 3 commits into
sigp:unstablefrom
NikhilSharmaWe:fix/gloas-early-proposer-prefs

Conversation

@NikhilSharmaWe

Copy link
Copy Markdown

Closes #9041

Description

Gloas needs proposer_preferences on the Gloas digest one epoch before activation so builders can bid in the first Gloas epoch. We still only joined new fork topics 2 slots early, and gossip publish always used the current ENR digest, so pre-fork prefs would not land on the right topic.

This PR:

  • early-subscribes only proposer_preferences on the Gloas digest from gloas_epoch - 1
  • publishes proposer prefs with ForkContext::context_bytes(proposal_epoch)
  • keeps SUBSCRIBE_DELAY_SLOTS = 2 for the full fork topic set
  • adds catch-up on startup, digest update, and SubscribeCoreTopics

I went with selective subscribe instead of joining all Gloas topics a full epoch early. Spec only calls out prefs, and the broader change was what hit the fallback simulator before.

Also makes Network::subscribe update gossipsub_subscriptions only on success so failed early-subscribe retries work.

Test plan

  • Unit tests for early-subscribe window / topic digest
  • Unit tests for publish digest selection
  • Release harness: in-window vs before-window NetworkService::build

@NikhilSharmaWe
NikhilSharmaWe requested a review from jxs as a code owner August 12, 2026 04:00
@NikhilSharmaWe
NikhilSharmaWe force-pushed the fix/gloas-early-proposer-prefs branch from b90dfd3 to f077003 Compare August 12, 2026 04:06
@NikhilSharmaWe

Copy link
Copy Markdown
Author

cc @eserilev

Comment on lines -821 to +833
// update the network globals
self.network_globals
.gossipsub_subscriptions
.write()
.insert(topic.clone());

let topic: Topic = topic.into();
let libp2p_topic: Topic = topic.clone().into();

match self.gossipsub_mut().subscribe(&topic) {
match self.gossipsub_mut().subscribe(&libp2p_topic) {
Err(e) => {
warn!(%topic, error = ?e, "Failed to subscribe to topic");
false
}
Ok(_) => {
debug!(%topic, "Subscribed to topic");
self.network_globals
.gossipsub_subscriptions
.write()
.insert(topic);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just leaving a note that with this change this fixes a small bug where a failed topic subscription was never retried

@chong-he chong-he added waiting-on-author The reviewer has suggested changes and awaits thier implementation. gloas labels Aug 17, 2026
@chong-he

Copy link
Copy Markdown
Member

CI is failing

Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>
@NikhilSharmaWe
NikhilSharmaWe force-pushed the fix/gloas-early-proposer-prefs branch from f077003 to 56590a7 Compare August 17, 2026 05:00
@NikhilSharmaWe

Copy link
Copy Markdown
Author

Fixed the rustfmt failure in the latest push.
The basic-simulator failure appears unrelated to this PR.

@NikhilSharmaWe

Copy link
Copy Markdown
Author

cc @michaelsproul

Comment thread beacon_node/network/src/service.rs Outdated
Comment on lines +1020 to +1029
fn gloas_early_prefs_subscribe_epoch(spec: &ChainSpec) -> Option<Epoch> {
if !spec.is_gloas_scheduled() {
return None;
}
let gloas_epoch = spec.gloas_fork_epoch?;
if gloas_epoch == Epoch::new(0) {
return None;
}
Some(gloas_epoch.saturating_sub(PROPOSER_PREFERENCES_EARLY_SUBSCRIBE_EPOCHS))
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we generalize this a bit? the publish side already seems generalized, but the subscriber side isnt. so this does work for fulu -> gloas. but it wont work for gloas -> heze for example

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

early-subscribe now targets the next prefs-bearing digest (not just Gloas)
Done in 5315811

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants