diff --git a/beacon-chain/p2p/discovery.go b/beacon-chain/p2p/discovery.go index c54796f5c442..f20965f68703 100644 --- a/beacon-chain/p2p/discovery.go +++ b/beacon-chain/p2p/discovery.go @@ -42,11 +42,17 @@ const ( udp6 ) -type quicProtocol uint16 +type ( + quicProtocol uint16 + custodySubnetCount uint64 +) // quicProtocol is the "quic" key, which holds the QUIC port of the node. func (quicProtocol) ENRKey() string { return "quic" } +// https://github.com/ethereum/consensus-specs/blob/dev/specs/_features/eip7594/p2p-interface.md#the-discovery-domain-discv5 +func (custodySubnetCount) ENRKey() string { return "custody_subnet_count" } + // RefreshPersistentSubnets checks that we are tracking our local persistent subnets for a variety of gossip topics. // This routine checks for our attestation, sync committee and data column subnets and updates them if they have // been rotated. @@ -262,6 +268,11 @@ func (s *Service) createLocalNode( localNode.Set(quicEntry) } + if features.Get().EnablePeerDAS { + custodySubnetEntry := custodySubnetCount(params.BeaconConfig().CustodyRequirement) + localNode.Set(custodySubnetEntry) + } + localNode.SetFallbackIP(ipAddr) localNode.SetFallbackUDP(udpPort)