Skip to content

Enable gossip during optimistic sync for data columns#10304

Open
gfukushima wants to merge 39 commits intoConsensys:masterfrom
gfukushima:enable-gossip-for-data-column-when-sync-optimistic
Open

Enable gossip during optimistic sync for data columns#10304
gfukushima wants to merge 39 commits intoConsensys:masterfrom
gfukushima:enable-gossip-for-data-column-when-sync-optimistic

Conversation

@gfukushima
Copy link
Contributor

@gfukushima gfukushima commented Jan 29, 2026

PR Description

This PR uses the flag subscribedToAllCustodySubnetsEnabled to reflect whether gossip should be enabled during optimistic sync.

Fixed Issue(s)

Fixes #10275

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Note

Medium Risk
Changes gossip subscription behavior during optimistic sync and adds new config-driven gating, which could affect network load and data propagation if misclassified or miswired.

Overview
Enables data column sidecar gossip during optimistic sync when the node is considered a super node (either explicitly via new P2PConfig.isSubscribedToAllCustodySubnetsEnabled() or by having the maximum Fulu custody group count).

This introduces a reusable SuperNodeSupplier and threads it through BeaconChainControllerEth2P2PNetworkBuilderGossipForkSubscriptions*DataColumnSidecarGossipManager, which now gates optimistic-sync enablement via isEnabledDuringOptimisticSync(). It also centralizes “super node” detection via MiscHelpersFulu.isSuperNode, adds trace logging on sidecar gossip receipt, and updates tests/build deps accordingly.

Written by Cursor Bugbot for commit 19732b5. This will update automatically on new commits. Configure here.

…GossipManager

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
final boolean subscribeAllCustodySubnetsEnabled) {
subnetSubscriptions = dataColumnSidecarSubnetSubscriptions;
this.dasGossipLogger = dasGossipLogger;
this.subscribedToAllCustodySubnetsEnabled = subscribeAllCustodySubnetsEnabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a good way to get this information.
Node could be subscribed to all custody subnets because:

  • flag subscribe-custody..
  • flag custody-override
  • node is supernode because of the number of the validators served

Because number of the validators served could change dynamically on any epoch, this case should be handled too. For example check DataColumnSidecarRecoveringCustodyImpl how the flag isSuperNode is set. You need something similar but the check should be recurrent (because number of the validators could change), we do it usually onSlot, but there is no onSlot here, I'm not sure what will be the best option. We should do the check at least once per epoch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed the PR to contemplate the scenarios where you mentioned but the check isn't recurrent, I think this is better than the current state we can work on make the check every epoch on another PR, this might be useful in case the node stays in optimistic sync for too long, correct?

Copy link
Contributor

@zilm13 zilm13 Feb 2, 2026

Choose a reason for hiding this comment

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

It's a bad idea trying to duplicate logic of CustodyGroupCountManager. Moreover, you don't cover one of the most common customer's case: validator node with 128+ validators without any command line flags. It should be subscribed to all custody subnets. And it's a reason we need updates of the custody count status: (not all) validators are loaded on initialization stage, when constructor is called, keys decryption takes time, and real numbers breaks in a bit later, that's why we always try to follow status in other components.

Copy link
Contributor Author

@gfukushima gfukushima Feb 6, 2026

Choose a reason for hiding this comment

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

since this gossip subscription is checked (for possible new subscriptions start) every epoch I believe we don't need a mechanism to keep checking constantly, I'm relying on the DB variable to tell if the node has changed status and is supernode when the change happens, if so before the epoch transition we should start the subscription for the data column gossip. If this isn't good enough than maybe we can think about a event based logic.

@gfukushima gfukushima marked this pull request as draft January 29, 2026 09:06
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
…en-sync-optimistic' into enable-gossip-for-data-column-when-sync-optimistic
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
…ange this to a supplier

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
@gfukushima gfukushima marked this pull request as ready for review February 6, 2026 06:07
@Override
public SafeFuture<InternalValidationResult> onDataColumnSidecarGossip(
final DataColumnSidecar dataColumnSidecar, final Optional<UInt64> arrivalTimestamp) {
LOG.info("Received data column sidecar from GOSSIP: {}", dataColumnSidecar);
Copy link
Contributor

Choose a reason for hiding this comment

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

it's debug or trace

dataColumnSidecarGossipManager.unsubscribeFromSubnetId(subnetId);
}

private Supplier<Boolean> isSuperNode() {
Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldn't do this
how about something like this?
zilm13@24c4595

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
…en-sync-optimistic' into enable-gossip-for-data-column-when-sync-optimistic
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
…en-sync-optimistic' into enable-gossip-for-data-column-when-sync-optimistic
…stodyGroupCountManagerImpl

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
…en-sync-optimistic' into enable-gossip-for-data-column-when-sync-optimistic
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
…en-sync-optimistic' into enable-gossip-for-data-column-when-sync-optimistic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We should subscribe to data columns subnets when following the chain optimistically

2 participants