← Back to Pull requests

cl/p2p: accept gossip subscriptions only for known topics #26058

Merged
AskAlexSharov merged 3 files (137 lines) on Nov 11, 2026 06:39 UTC
View on GitHub
AskAlexSharov AskAlexSharov commented on Nov 10, 2026 05:26 UTC
Author

Bug: the subscription filter accepts any digest and any name of the right shape, and its limit is per RPC. One peer can send many RPCs with new topic names, and gossipsub keeps each one until the peer disconnects.

Fix: accept only the digests of the fork and blob schedule and the known topic names, so the set of topics is finite.

Diff: 137 lines (+122 / -15) across 3 files Reviewer: awskii Review duration: 1512m
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.35) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 137 lines diff across 3 files
0.35
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.88 · 5 substantive comment(s)
0.88
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
89%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.295
Real PR Conversation Timeline
11 items
copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 10, 2026 06:30 UTC
Reviewer

<!-- ccr-overview-v2 -->

🟢 Approval recommended

No active review issues are recorded for the change restricting gossip subscriptions to scheduled fork digests and recognized topics.

No open issues 🎉

<details>
<summary><strong>What changed in this PR</strong></summary>

This PR limits Caplin gossip subscriptions to scheduled fork digests and recognized topic names, preventing peers from growing subscription state with arbitrary topics across repeated RPCs.

Changes:

  • Builds a finite topic filter using digests from the fork and blob schedules.

  • Propagates subscription-filter setup errors during P2P initialization.

  • Extends tests for topic filtering and scheduled digest coverage.
  • | File | Description |
    | ---- | ----------- |
    | cl/​p2p/​p2p.go | Handles errors when creating pubsub options. |
    | cl/​p2p/​libp2p_setting.go | Restricts subscriptions to scheduled digests and recognized topic patterns. |
    | cl/​p2p/​libp2p_setting_test.go | Tests accepted and rejected topics and fork/blob schedule digests. |
    </details>

    <sub>Review effort: Balanced</sub>

    Copilot Copilot commented on code on Nov 10, 2026 07:06 UTC
    Code Review
    cl/p2p/libp2p_setting.go:1
    @@ -70,19 +74,81 @@ func (p *p2pManager) pubsubOptions(beaconConfig *clparams.BeaconChainConfig) []p
     		pubsub.WithValidateQueueSize(pubsubQueueSize),
     		pubsub.WithPeerScore(scoreParams, thresholds),
     		pubsub.WithGossipSubParams(pubsubGossipParam()),
    -		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter()),
    +		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter(forkDigests, gossipTopicNames(p.cfg.NetworkConfig, beaconConfig))),
     	}
    -	return psOpts
    +	return psOpts, nil
     }
     
     // maxSubscriptionsPerRPC is above what an honest peer sends for all subnets of two fork digests.
     const maxSubscriptionsPerRPC = 500
     
    -var eth2TopicFormat = regexp.MustCompile(`^/eth2/[0-9a-f]{8}/[a-z0-9_]{1,64}/ssz_snappy$`)
    +// gossipTopicNames lists every gossip topic name. Gossipsub keeps each topic a peer subscribes to until it
    +// disconnects, so the accepted set has to be finite. A topic missing here can be neither joined nor seen from peers.
    +func gossipTopicNames(networkConfig *clparams.NetworkConfig, beaconConfig *clparams.BeaconChainConfig) []string {
    +	fixedNames := []string{
    +		gossip.TopicNameBeaconBlock,
    +		gossip.TopicNameBeaconAggregateAndProof,
    +		gossip.TopicNameVoluntaryExit,
    +		gossip.TopicNameProposerSlashing,
    +		gossip.TopicNameAttesterSlashing,
    +		gossip.TopicNameBlsToExecutionChange,
    +		gossip.TopicNameSyncCommitteeContributionAndProof,
    +		gossip.TopicNameLightClientFinalityUpdate,
    +		gossip.TopicNameLightClientOptimisticUpdate,
    +		gossip.TopicNameExecutionPayload,
    +		gossip.TopicNameExecutionPayloadBid,
    +		gossip.TopicNamePayloadAttestation,
    +		gossip.TopicNameProposerPreferences,
    +	}
    +	blobSubnets := max(beaconConfig.BlobSidecarSubnetCount, beaconConfig.BlobSidecarSubnetCountElectra)
    +	names := make([]string, 0, uint64(len(fixedNames))+networkConfig.AttestationSubnetCount+beaconConfig.SyncCommitteeSubnetCount+blobSubnets+beaconConfig.DataColumnSidecarSubnetCount)

    make([]string, 0, ...) requires the capacity argument to be of type int, but this code builds a uint64 capacity. This is a compile-time error. Build the capacity as an int (with explicit conversions for each count) before calling make.

    Copilot Copilot commented on code on Nov 10, 2026 07:06 UTC
    Code Review
    cl/p2p/libp2p_setting_test.go:1
    @@ -166,10 +180,33 @@ func TestPubsubOptionsRefuseNonGossipTopics(t *testing.T) {
     	require.NoError(t, err)
     	networkConfig, beaconConfig, _, err := clparams.GetConfigsByNetworkName("mainnet")
     	require.NoError(t, err)
    -	manager := &p2pManager{cfg: &P2PConfig{NetworkConfig: networkConfig, BeaconConfig: beaconConfig}}
    -	ps, err := pubsub.NewGossipSub(t.Context(), host, manager.pubsubOptions(beaconConfig)...)
    +	manager := &p2pManager{cfg: &P2PConfig{NetworkConfig: networkConfig, BeaconConfig: beaconConfig}, ethClock: eth_clock.NewEthereumClock(0, common.Hash{}, beaconConfig)}
    +	psOpts, err := manager.pubsubOptions(beaconConfig)
    +	require.NoError(t, err)
    +	ps, err := pubsub.NewGossipSub(t.Context(), host, psOpts...)
     	require.NoError(t, err)
     
     	_, err = ps.Join("/junk/topic")
     	require.ErrorContains(t, err, "subscription filter")
     }
    +
    +func TestScheduledForkDigestsFollowForksAndBlobParameters(t *testing.T) {
    +	t.Parallel()
    +	_, beaconConfig, _, err := clparams.GetConfigsByNetworkName("mainnet")
    +	require.NoError(t, err)
    +	clock := eth_clock.NewEthereumClock(0, common.Hash{}, beaconConfig)
    +	manager := &p2pManager{ethClock: clock}
    +
    +	digests, err := manager.scheduledForkDigests(beaconConfig)
    +	require.NoError(t, err)
    +
    +	epochs := []uint64{0, beaconConfig.AltairForkEpoch, beaconConfig.ElectraForkEpoch, beaconConfig.FuluForkEpoch}
    +	for _, blobParameters := range beaconConfig.BlobSchedule {
    +		epochs = append(epochs, blobParameters.Epoch)
    +	}
    +	for _, epoch := range epochs {

    This test hard-codes fork epochs (including FuluForkEpoch) while scheduledForkDigests derives epochs from ForkVersionSchedule and explicitly skips forks at FarFutureEpoch. To avoid a mismatch between the test and production logic, build epochs from beaconConfig.ForkVersionSchedule (applying the same FarFutureEpoch filter) plus beaconConfig.BlobSchedule, rather than using the individual *ForkEpoch fields.

    Copilot Copilot commented on code on Nov 10, 2026 07:06 UTC
    Code Review
    cl/p2p/libp2p_setting.go:1
    @@ -70,19 +74,81 @@ func (p *p2pManager) pubsubOptions(beaconConfig *clparams.BeaconChainConfig) []p
     		pubsub.WithValidateQueueSize(pubsubQueueSize),
     		pubsub.WithPeerScore(scoreParams, thresholds),
     		pubsub.WithGossipSubParams(pubsubGossipParam()),
    -		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter()),
    +		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter(forkDigests, gossipTopicNames(p.cfg.NetworkConfig, beaconConfig))),
     	}
    -	return psOpts
    +	return psOpts, nil
     }
     
     // maxSubscriptionsPerRPC is above what an honest peer sends for all subnets of two fork digests.
     const maxSubscriptionsPerRPC = 500
     
    -var eth2TopicFormat = regexp.MustCompile(`^/eth2/[0-9a-f]{8}/[a-z0-9_]{1,64}/ssz_snappy$`)
    +// gossipTopicNames lists every gossip topic name. Gossipsub keeps each topic a peer subscribes to until it
    +// disconnects, so the accepted set has to be finite. A topic missing here can be neither joined nor seen from peers.
    +func gossipTopicNames(networkConfig *clparams.NetworkConfig, beaconConfig *clparams.BeaconChainConfig) []string {
    +	fixedNames := []string{
    +		gossip.TopicNameBeaconBlock,
    +		gossip.TopicNameBeaconAggregateAndProof,
    +		gossip.TopicNameVoluntaryExit,
    +		gossip.TopicNameProposerSlashing,
    +		gossip.TopicNameAttesterSlashing,
    +		gossip.TopicNameBlsToExecutionChange,
    +		gossip.TopicNameSyncCommitteeContributionAndProof,
    +		gossip.TopicNameLightClientFinalityUpdate,
    +		gossip.TopicNameLightClientOptimisticUpdate,
    +		gossip.TopicNameExecutionPayload,
    +		gossip.TopicNameExecutionPayloadBid,
    +		gossip.TopicNamePayloadAttestation,
    +		gossip.TopicNameProposerPreferences,
    +	}
    +	blobSubnets := max(beaconConfig.BlobSidecarSubnetCount, beaconConfig.BlobSidecarSubnetCountElectra)
    +	names := make([]string, 0, uint64(len(fixedNames))+networkConfig.AttestationSubnetCount+beaconConfig.SyncCommitteeSubnetCount+blobSubnets+beaconConfig.DataColumnSidecarSubnetCount)
    +	names = append(names, fixedNames...)
    +	for i := range networkConfig.AttestationSubnetCount {
    +		names = append(names, gossip.TopicNameBeaconAttestation(i))
    +	}
    +	for i := range beaconConfig.SyncCommitteeSubnetCount {
    +		names = append(names, gossip.TopicNameSyncCommittee(int(i)))
    +	}
    +	for i := range blobSubnets {
    +		names = append(names, gossip.TopicNameBlobSidecar(i))
    +	}
    +	for i := range beaconConfig.DataColumnSidecarSubnetCount {
    +		names = append(names, gossip.TopicNameDataColumnSidecar(i))
    +	}
    +	return names
    +}
     
    -// gossipSubscriptionFilter drops subscriptions to topics that are not eth2 gossip topics, and refuses oversized batches.
    -func gossipSubscriptionFilter() pubsub.SubscriptionFilter {
    -	return pubsub.WrapLimitSubscriptionFilter(pubsub.NewRegexpSubscriptionFilter(eth2TopicFormat), maxSubscriptionsPerRPC)
    +// scheduledForkDigests returns the digest of every fork and blob parameter change in the schedule.
    +func (p *p2pManager) scheduledForkDigests(beaconConfig *clparams.BeaconChainConfig) ([]string, error) {
    +	epochs := make([]uint64, 0, len(beaconConfig.ForkVersionSchedule)+len(beaconConfig.BlobSchedule))
    +	for _, fork := range beaconConfig.ForkVersionSchedule {
    +		if fork.Epoch != beaconConfig.FarFutureEpoch {
    +			epochs = append(epochs, fork.Epoch)
    +		}
    +	}
    +	for _, blobParameters := range beaconConfig.BlobSchedule {
    +		epochs = append(epochs, blobParameters.Epoch)
    +	}
    +	digests := make([]string, 0, len(epochs))
    +	for _, epoch := range epochs {
    +		digest, err := p.ethClock.ComputeForkDigest(epoch)
    +		if err != nil {
    +			return nil, err
    +		}
    +		digests = append(digests, hex.EncodeToString(digest[:]))
    +	}
    +	return digests, nil

    If multiple entries in ForkVersionSchedule/BlobSchedule share the same epoch, this will compute and store duplicate digests, which then multiplies the allowlist size. Consider de-duplicating epochs (or digests) before returning to keep the allowlist smaller and avoid redundant work.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 10, 2026 07:06 UTC
    Reviewer

    [!WARNING]

    Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

    <!-- ccr-overview-v2 -->

    Copilot review overview

    <details open>
    <summary><strong>3 open issues</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [make([]string, 0, ...) requires the capacity argument to be of type int, but this code builds a…](https://github.com/erigontech/erigon/pull/26058#discussion_r4522041271) · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> This test hard-codes fork epochs (including FuluForkEpoch) while scheduledForkDigests derives… · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> If multiple entries in ForkVersionSchedule/BlobSchedule share the same epoch, this will compute… · New

  • </details>

    <sub>Review effort: Lite</sub>

    AskAlexSharov AskAlexSharov commented on code on Nov 10, 2026 07:07 UTC
    Code Review
    cl/p2p/libp2p_setting.go:1
    @@ -70,19 +74,81 @@ func (p *p2pManager) pubsubOptions(beaconConfig *clparams.BeaconChainConfig) []p
     		pubsub.WithValidateQueueSize(pubsubQueueSize),
     		pubsub.WithPeerScore(scoreParams, thresholds),
     		pubsub.WithGossipSubParams(pubsubGossipParam()),
    -		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter()),
    +		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter(forkDigests, gossipTopicNames(p.cfg.NetworkConfig, beaconConfig))),
     	}
    -	return psOpts
    +	return psOpts, nil
     }
     
     // maxSubscriptionsPerRPC is above what an honest peer sends for all subnets of two fork digests.
     const maxSubscriptionsPerRPC = 500
     
    -var eth2TopicFormat = regexp.MustCompile(`^/eth2/[0-9a-f]{8}/[a-z0-9_]{1,64}/ssz_snappy$`)
    +// gossipTopicNames lists every gossip topic name. Gossipsub keeps each topic a peer subscribes to until it
    +// disconnects, so the accepted set has to be finite. A topic missing here can be neither joined nor seen from peers.
    +func gossipTopicNames(networkConfig *clparams.NetworkConfig, beaconConfig *clparams.BeaconChainConfig) []string {
    +	fixedNames := []string{
    +		gossip.TopicNameBeaconBlock,
    +		gossip.TopicNameBeaconAggregateAndProof,
    +		gossip.TopicNameVoluntaryExit,
    +		gossip.TopicNameProposerSlashing,
    +		gossip.TopicNameAttesterSlashing,
    +		gossip.TopicNameBlsToExecutionChange,
    +		gossip.TopicNameSyncCommitteeContributionAndProof,
    +		gossip.TopicNameLightClientFinalityUpdate,
    +		gossip.TopicNameLightClientOptimisticUpdate,
    +		gossip.TopicNameExecutionPayload,
    +		gossip.TopicNameExecutionPayloadBid,
    +		gossip.TopicNamePayloadAttestation,
    +		gossip.TopicNameProposerPreferences,
    +	}
    +	blobSubnets := max(beaconConfig.BlobSidecarSubnetCount, beaconConfig.BlobSidecarSubnetCountElectra)
    +	names := make([]string, 0, uint64(len(fixedNames))+networkConfig.AttestationSubnetCount+beaconConfig.SyncCommitteeSubnetCount+blobSubnets+beaconConfig.DataColumnSidecarSubnetCount)

    Not an error: make accepts a size of any integer type, and this compiles and passes lint.

    AskAlexSharov AskAlexSharov commented on code on Nov 10, 2026 07:07 UTC
    Code Review
    cl/p2p/libp2p_setting_test.go:1
    @@ -166,10 +180,33 @@ func TestPubsubOptionsRefuseNonGossipTopics(t *testing.T) {
     	require.NoError(t, err)
     	networkConfig, beaconConfig, _, err := clparams.GetConfigsByNetworkName("mainnet")
     	require.NoError(t, err)
    -	manager := &p2pManager{cfg: &P2PConfig{NetworkConfig: networkConfig, BeaconConfig: beaconConfig}}
    -	ps, err := pubsub.NewGossipSub(t.Context(), host, manager.pubsubOptions(beaconConfig)...)
    +	manager := &p2pManager{cfg: &P2PConfig{NetworkConfig: networkConfig, BeaconConfig: beaconConfig}, ethClock: eth_clock.NewEthereumClock(0, common.Hash{}, beaconConfig)}
    +	psOpts, err := manager.pubsubOptions(beaconConfig)
    +	require.NoError(t, err)
    +	ps, err := pubsub.NewGossipSub(t.Context(), host, psOpts...)
     	require.NoError(t, err)
     
     	_, err = ps.Join("/junk/topic")
     	require.ErrorContains(t, err, "subscription filter")
     }
    +
    +func TestScheduledForkDigestsFollowForksAndBlobParameters(t *testing.T) {
    +	t.Parallel()
    +	_, beaconConfig, _, err := clparams.GetConfigsByNetworkName("mainnet")
    +	require.NoError(t, err)
    +	clock := eth_clock.NewEthereumClock(0, common.Hash{}, beaconConfig)
    +	manager := &p2pManager{ethClock: clock}
    +
    +	digests, err := manager.scheduledForkDigests(beaconConfig)
    +	require.NoError(t, err)
    +
    +	epochs := []uint64{0, beaconConfig.AltairForkEpoch, beaconConfig.ElectraForkEpoch, beaconConfig.FuluForkEpoch}
    +	for _, blobParameters := range beaconConfig.BlobSchedule {
    +		epochs = append(epochs, blobParameters.Epoch)
    +	}
    +	for _, epoch := range epochs {

    Kept as is: the test reads the mainnet config, where these epochs are scheduled, so the digests it asks for are the ones the function must return.

    AskAlexSharov AskAlexSharov commented on code on Nov 10, 2026 07:08 UTC
    Code Review
    cl/p2p/libp2p_setting.go:1
    @@ -70,19 +74,81 @@ func (p *p2pManager) pubsubOptions(beaconConfig *clparams.BeaconChainConfig) []p
     		pubsub.WithValidateQueueSize(pubsubQueueSize),
     		pubsub.WithPeerScore(scoreParams, thresholds),
     		pubsub.WithGossipSubParams(pubsubGossipParam()),
    -		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter()),
    +		pubsub.WithSubscriptionFilter(gossipSubscriptionFilter(forkDigests, gossipTopicNames(p.cfg.NetworkConfig, beaconConfig))),
     	}
    -	return psOpts
    +	return psOpts, nil
     }
     
     // maxSubscriptionsPerRPC is above what an honest peer sends for all subnets of two fork digests.
     const maxSubscriptionsPerRPC = 500
     
    -var eth2TopicFormat = regexp.MustCompile(`^/eth2/[0-9a-f]{8}/[a-z0-9_]{1,64}/ssz_snappy$`)
    +// gossipTopicNames lists every gossip topic name. Gossipsub keeps each topic a peer subscribes to until it
    +// disconnects, so the accepted set has to be finite. A topic missing here can be neither joined nor seen from peers.
    +func gossipTopicNames(networkConfig *clparams.NetworkConfig, beaconConfig *clparams.BeaconChainConfig) []string {
    +	fixedNames := []string{
    +		gossip.TopicNameBeaconBlock,
    +		gossip.TopicNameBeaconAggregateAndProof,
    +		gossip.TopicNameVoluntaryExit,
    +		gossip.TopicNameProposerSlashing,
    +		gossip.TopicNameAttesterSlashing,
    +		gossip.TopicNameBlsToExecutionChange,
    +		gossip.TopicNameSyncCommitteeContributionAndProof,
    +		gossip.TopicNameLightClientFinalityUpdate,
    +		gossip.TopicNameLightClientOptimisticUpdate,
    +		gossip.TopicNameExecutionPayload,
    +		gossip.TopicNameExecutionPayloadBid,
    +		gossip.TopicNamePayloadAttestation,
    +		gossip.TopicNameProposerPreferences,
    +	}
    +	blobSubnets := max(beaconConfig.BlobSidecarSubnetCount, beaconConfig.BlobSidecarSubnetCountElectra)
    +	names := make([]string, 0, uint64(len(fixedNames))+networkConfig.AttestationSubnetCount+beaconConfig.SyncCommitteeSubnetCount+blobSubnets+beaconConfig.DataColumnSidecarSubnetCount)
    +	names = append(names, fixedNames...)
    +	for i := range networkConfig.AttestationSubnetCount {
    +		names = append(names, gossip.TopicNameBeaconAttestation(i))
    +	}
    +	for i := range beaconConfig.SyncCommitteeSubnetCount {
    +		names = append(names, gossip.TopicNameSyncCommittee(int(i)))
    +	}
    +	for i := range blobSubnets {
    +		names = append(names, gossip.TopicNameBlobSidecar(i))
    +	}
    +	for i := range beaconConfig.DataColumnSidecarSubnetCount {
    +		names = append(names, gossip.TopicNameDataColumnSidecar(i))
    +	}
    +	return names
    +}
     
    -// gossipSubscriptionFilter drops subscriptions to topics that are not eth2 gossip topics, and refuses oversized batches.
    -func gossipSubscriptionFilter() pubsub.SubscriptionFilter {
    -	return pubsub.WrapLimitSubscriptionFilter(pubsub.NewRegexpSubscriptionFilter(eth2TopicFormat), maxSubscriptionsPerRPC)
    +// scheduledForkDigests returns the digest of every fork and blob parameter change in the schedule.
    +func (p *p2pManager) scheduledForkDigests(beaconConfig *clparams.BeaconChainConfig) ([]string, error) {
    +	epochs := make([]uint64, 0, len(beaconConfig.ForkVersionSchedule)+len(beaconConfig.BlobSchedule))
    +	for _, fork := range beaconConfig.ForkVersionSchedule {
    +		if fork.Epoch != beaconConfig.FarFutureEpoch {
    +			epochs = append(epochs, fork.Epoch)
    +		}
    +	}
    +	for _, blobParameters := range beaconConfig.BlobSchedule {
    +		epochs = append(epochs, blobParameters.Epoch)
    +	}
    +	digests := make([]string, 0, len(epochs))
    +	for _, epoch := range epochs {
    +		digest, err := p.ethClock.ComputeForkDigest(epoch)
    +		if err != nil {
    +			return nil, err
    +		}
    +		digests = append(digests, hex.EncodeToString(digest[:]))
    +	}
    +	return digests, nil

    No effect: the allowlist is a map, so a duplicate digest adds no entry. Only the temporary slice has a few repeated strings, once at startup.

    awskii awskii approved these changes on Nov 10, 2026 09:23 UTC
    Approved Reviewer

    Approved these changes.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 11, 2026 01:19 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues block approval of the finite gossip-subscription allowlist change.

    No open issues 🎉

    <details>
    <summary><strong>3 resolved since last review</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [make([]string, 0, ...) requires the capacity argument to be of type int, but this code builds a…](https://github.com/erigontech/erigon/pull/26058#discussion_r4522041271)

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> This test hard-codes fork epochs (including FuluForkEpoch) while scheduledForkDigests derives…

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> If multiple entries in ForkVersionSchedule/BlobSchedule share the same epoch, this will compute…

  • </details>

    <sub>Review effort: Balanced</sub>

    Reviewers
    Assignees
    AskAlexSharov AskAlexSharov
    Labels
    risk: low confidence: 89.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.4% (MEDIUM) · Higher = larger blast radius
    35.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 89.3% · Lower = rushed or shallow review
    89.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 3.8% · Safe to merge
    3.8%