# Packages
Package encoder allows for registering custom data encoders for information
sent as raw bytes over the wire via p2p to other nodes.
Package peers provides information about peers at the Ethereum consensus protocol level.
Package testing includes useful utilities for mocking a beacon node's p2p service for unit tests.
Package types contains all the respective p2p types that are required for sync but cannot be represented as a protobuf schema.
# Functions
AllTopics returns all topics stored in our gossip mapping.
ConvertPeerIDToNodeID converts a peer ID (libp2p) to a node ID (devp2p).
ExtractGossipDigest extracts the relevant fork digest from the gossip topic.
GossipTopicMappings is a function to return the assigned data type versioned by epoch.
MakePeer from multiaddress string.
MsgID is a content addressable ID function.
MultiAddressBuilder takes in an ip address string and port to produce a go multiaddr format.
NewService initializes a new p2p service compatible with shared.Service interface.
PeersFromStringAddrs converts peer raw ENRs into multiaddrs for p2p.
SerializeENR takes the enr record in its key-value form and serializes it.
TopicDeconstructor splits the provided topic to its logical sub-sections.
TopicFromMessage constructs the rpc topic from the provided message type and epoch.
VerifyTopicMapping verifies that the topic and its accompanying message type is correct.
# Constants
AggregateAndProofSubnetTopicFormat is the topic format for the aggregate and proof subnet.
Topic Formats
AttestationSubnetTopicFormat is the topic format for the attestation subnet.
AttesterSlashingSubnetTopicFormat is the topic format for the attester slashing subnet.
BeaconBlocksByRangeMessageName specifies the name for the beacon blocks by range message topic.
BeaconBlocksByRootsMessageName specifies the name for the beacon blocks by root message topic.
BlobSidecarsByRangeName is the name for the BlobSidecarsByRange v1 message topic.
BlobSidecarsByRootName is the name for the BlobSidecarsByRoot v1 message topic.
BlobSubnetTopicFormat is the topic format for the blob subnet.
BlockSubnetTopicFormat is the topic format for the block subnet.
BlsToExecutionChangeSubnetTopicFormat is the topic format for the bls to execution change subnet.
ExitSubnetTopicFormat is the topic format for the voluntary exit subnet.
GoodbyeMessageName specifies the name for the goodbye message topic.
GossipAggregateAndProofMessage is the name for the attestation aggregate and proof message type.
Message Types
GossipAttestationMessage is the name for the attestation message type.
GossipAttesterSlashingMessage is the name for the attester slashing message type.
GossipBlobSidecarMessage is the name for the blob sidecar message type.
GossipBlockMessage is the name for the block message type.
GossipBlsToExecutionChangeMessage is the name for the bls to execution change message type.
GossipContributionAndProofMessage is the name for the sync contribution and proof message type.
GossipExitMessage is the name for the voluntary exit message type.
GossipProposerSlashingMessage is the name for the proposer slashing message type.
GossipProtocolAndDigest represents the protocol and fork digest prefix in a gossip topic.
GossipSyncCommitteeMessage is the name for the sync committee message type.
MetadataMessageName specifies the name for the metadata message topic.
PingMessageName Specifies the name for the ping message topic.
ProposerSlashingSubnetTopicFormat is the topic format for the proposer slashing subnet.
RPCBlobSidecarsByRangeTopicV1 is a topic for requesting blob sidecars in the slot range [start_slot, start_slot + count), leading up to the current head block as selected by fork choice.
RPCBlobSidecarsByRootTopicV1 is a topic for requesting blob sidecars by their block root.
RPCBlocksByRangeTopicV1 defines v1 the topic for the blocks by range rpc method.
V2 RPC Topics RPCBlocksByRangeTopicV2 defines v2 the topic for the blocks by range rpc method.
RPCBlocksByRootTopicV1 defines the v1 topic for the blocks by root rpc method.
RPCBlocksByRootTopicV2 defines the v2 topic for the blocks by root rpc method.
RPCGoodByeTopicV1 defines the v1 topic for the goodbye rpc method.
RPCMetaDataTopicV1 defines the v1 topic for the metadata rpc method.
RPCMetaDataTopicV2 defines the v2 topic for the metadata rpc method.
RPCPingTopicV1 defines the v1 topic for the ping rpc method.
V1 RPC Topics RPCStatusTopicV1 defines the v1 topic for the status rpc method.
SchemaVersionV1 specifies the schema version for our rpc protocol ID.
SchemaVersionV2 specifies the next schema version for our rpc protocol ID.
StatusMessageName specifies the name for the status message topic.
SyncCommitteeSubnetTopicFormat is the topic format for the sync committee subnet.
SyncContributionAndProofSubnetTopicFormat is the topic format for the sync aggregate and proof subnet.
# Variables
ErrMessageNotMapped occurs on a Broadcast attempt when a message has not been defined in the GossipTypeMapping.
GossipTypeMapping is the inverse of GossipTopicMappings so that an arbitrary protobuf message can be mapped to a protocol ID string.
OmitContextBytesV1 keeps track of which RPC methods do not write context bytes in their v1 incarnations.
RPCTopicMappings map the base message type to the rpc request.
# Interfaces
Broadcaster broadcasts messages to peers over the p2p pubsub protocol.
ConnectionHandler configures p2p to handle connections with a peer.
EncodingProvider provides p2p network encoding.
Listener defines the discovery V5 network interface that is used to communicate with other peers.
MetadataProvider returns the metadata related information for the local peer.
P2P represents the full p2p interface composed of all of the sub-interfaces.
PeerManager abstracts some peer management methods from libp2p.
PeersProvider abstracts obtaining our current list of known peers status.
PubSubProvider provides the p2p pubsub protocol.
PubSubTopicUser provides way to join, use and leave PubSub topics.
Sender abstracts the sending functionality from libp2p.
SenderEncoder allows sending functionality from libp2p as well as encoding for requests and responses.
SetStreamHandler configures p2p to handle streams of a certain topic ID.
# Type aliases
RPCTopic is a type used to denote and represent a req/resp topic.