Skip to content

Commit 04ef05f

Browse files
committed
Merge remote-tracking branch 'origin/main' into alex/seg_header_meta_34
2 parents 8acd157 + 3178fda commit 04ef05f

File tree

20 files changed

+754
-234
lines changed

20 files changed

+754
-234
lines changed

cl/beacon/handler/block_production.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import (
4747
"github.com/erigontech/erigon/cl/gossip"
4848
"github.com/erigontech/erigon/cl/persistence/beacon_indicies"
4949
"github.com/erigontech/erigon/cl/phase1/core/state"
50+
"github.com/erigontech/erigon/cl/phase1/network/subnets"
5051
"github.com/erigontech/erigon/cl/transition"
5152
"github.com/erigontech/erigon/cl/transition/impl/eth2"
5253
"github.com/erigontech/erigon/cl/transition/machine"
@@ -143,8 +144,13 @@ func (a *ApiHandler) GetEthV1ValidatorAttestationData(
143144
}
144145

145146
defer func() {
147+
epoch := *slot / a.beaconChainCfg.SlotsPerEpoch
148+
committeesPerSlot := a.syncedData.CommitteeCount(epoch)
149+
subnet := subnets.ComputeSubnetForAttestation(
150+
committeesPerSlot, *slot, *committeeIndex,
151+
a.beaconChainCfg.SlotsPerEpoch, 64)
146152
a.logger.Debug("Produced Attestation", "slot", *slot,
147-
"committee_index", *committeeIndex, "cached", ok, "beacon_block_root",
153+
"committee_index", *committeeIndex, "subnet", subnet, "cached", ok, "beacon_block_root",
148154
attestationData.BeaconBlockRoot, "duration", time.Since(start))
149155
}()
150156

cl/p2p/mock_services/p2p_manager_mock.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cl/phase1/network/gossip/gossip_manager.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,18 @@ func (g *GossipManager) Publish(ctx context.Context, name string, data []byte) e
261261
if topicHandle == nil {
262262
return fmt.Errorf("topic not found: %s", topic)
263263
}
264+
// Log peer count for attestation topics to help diagnose propagation issues
265+
if gossip.IsTopicBeaconAttestation(name) {
266+
peerCount := len(g.p2p.Pubsub().ListPeers(topic))
267+
if peerCount == 0 {
268+
log.Warn("[Gossip] Publishing attestation with NO peers on subnet", "topic", name, "peerCount", peerCount)
269+
} else if peerCount < 3 {
270+
log.Debug("[Gossip] Publishing attestation with low peer count", "topic", name, "peerCount", peerCount)
271+
}
272+
}
264273
// Note: before publishing the message to the network, Publish() internally runs the validator function.
265-
return topicHandle.topic.Publish(ctx, compressedData, pubsub.WithReadiness(pubsub.MinTopicSize(1)))
274+
// Removed MinTopicSize(1) - don't fail if no peers on subnet, message will propagate when peers join
275+
return topicHandle.topic.Publish(ctx, compressedData)
266276
}
267277

268278
func (g *GossipManager) goCheckForkAndResubscribe(ctx context.Context) {

0 commit comments

Comments
 (0)