Expand description
Net Processing — Chain synchronization and message handling
This module implements the “brain” of the P2P protocol, corresponding to
Bitcoin Core’s net_processing.cpp. It orchestrates:
- Headers-first sync: Send
getheaders, receiveheaders, add to block index - Block download: Request blocks via
getdatafor headers we’ve accepted - Transaction relay: Process
inv/getdata/txmessages for mempool - Initial Block Download (IBD): Fast sync from genesis to chain tip
§Architecture
SyncManager holds references to the BlockIndex, PeerManager, and storage
ports. It processes PeerEvent messages and drives the sync state machine.
Structs§
- Sync
Manager - The sync manager drives chain synchronization.
Enums§
- Handshake
State - State of the P2P handshake with a peer.
- Sync
Action - Actions that the infrastructure layer should take after processing events.
- Sync
State - Current state of the blockchain sync process.