Documentation ¶
Overview ¶
Package sync TODO(3147): Add details on how sync works.
Package sync includes all chain-synchronization logic for the beacon node, including gossip-sub validators for blocks, attestations, and other p2p messages, as well as ability to process and respond to block requests by peers.
Index ¶
- func ReadChunkedBlock(stream libp2pcore.Stream, p2p p2p.P2P) (*eth.SignedBeaconBlock, error)
- func ReadStatusCode(stream io.Reader, encoding encoder.NetworkEncoding) (uint8, string, error)
- func WriteChunk(stream libp2pcore.Stream, encoding encoder.NetworkEncoding, msg interface{}) error
- type Checker
- type Config
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadChunkedBlock ¶
func ReadChunkedBlock(stream libp2pcore.Stream, p2p p2p.P2P) (*eth.SignedBeaconBlock, error)
ReadChunkedBlock handles each response chunk that is sent by the peer and converts it into a beacon block.
func ReadStatusCode ¶
ReadStatusCode response from a RPC stream.
func WriteChunk ¶
func WriteChunk(stream libp2pcore.Stream, encoding encoder.NetworkEncoding, msg interface{}) error
WriteChunk object to stream. response_chunk ::= | <result> | <encoding-dependent-header> | <encoded-payload>
Types ¶
type Checker ¶
Checker defines a struct which can verify whether a node is currently synchronizing a chain with the rest of peers in the network.
type Config ¶
type Config struct { P2P p2p.P2P DB db.NoHeadAccessDatabase AttPool attestations.Pool ExitPool *voluntaryexits.Pool SlashingPool *slashings.Pool Chain blockchainService InitialSync Checker StateNotifier statefeed.Notifier BlockNotifier blockfeed.Notifier AttestationNotifier operation.Notifier StateSummaryCache *cache.StateSummaryCache StateGen *stategen.State }
Config to set up the regular sync service.
type Service ¶ added in v0.3.0
type Service struct {
// contains filtered or unexported fields
}
Service is responsible for handling all run time p2p related operations as the main entry point for network messages.
Source Files ¶
- deadlines.go
- decode_pubsub.go
- doc.go
- error.go
- log.go
- metrics.go
- pending_attestations_queue.go
- pending_blocks_queue.go
- rpc.go
- rpc_beacon_blocks_by_range.go
- rpc_beacon_blocks_by_root.go
- rpc_chunked_response.go
- rpc_goodbye.go
- rpc_metadata.go
- rpc_ping.go
- rpc_status.go
- service.go
- subscriber.go
- subscriber_beacon_aggregate_proof.go
- subscriber_beacon_blocks.go
- subscriber_committee_index_beacon_attestation.go
- subscriber_handlers.go
- validate_aggregate_proof.go
- validate_attester_slashing.go
- validate_beacon_blocks.go
- validate_committee_index_beacon_attestation.go
- validate_proposer_slashing.go
- validate_voluntary_exit.go
Directories ¶
Path | Synopsis |
---|---|
Package initialsync includes all initial block download and processing logic for the beacon node, using a round robin strategy and a finite-state-machine to handle edge-cases in a beacon node's sync status.
|
Package initialsync includes all initial block download and processing logic for the beacon node, using a round robin strategy and a finite-state-machine to handle edge-cases in a beacon node's sync status. |
testing
Package testing includes useful mocks for testing initial sync status in unit tests.
|
Package testing includes useful mocks for testing initial sync status in unit tests. |
Package initialsyncold is deprecated, it includes old logic for initial chain sync.
|
Package initialsyncold is deprecated, it includes old logic for initial chain sync. |