Expand description
Syncer task for maintaining a non-finalized state in Zebra’s ReadStateService and updating ChainTipSender via RPCs
Structs§
- Trusted
Chain Sync - Syncs non-finalized blocks in the best chain from a trusted Zebra node’s RPC methods.
Constants§
- COMMIT_
RETRY_ 🔒DELAY - How long to wait before re-subscribing after a block fails to commit to the non-finalized state.
- GET_
BLOCK_ 🔒TIMEOUT - How long to wait for a single
get_blockfetch while bridging the finalized gap before giving up. A single block fetch from a co-located node should return promptly, so this bounds a wedged connection without false-triggering; the bridge retries on the next subscription. - KEEPALIVE_
INTERVAL 🔒 - HTTP/2 keep-alive ping interval for the indexer gRPC connection, so a half-open connection is detected promptly instead of hanging a stream read indefinitely.
- KEEPALIVE_
TIMEOUT 🔒 - How long to wait for a keep-alive ping response before treating the connection as dead.
- POLL_
DELAY 🔒 - How long to wait between calls to
subscribe_to_non_finalized_state_changewhen it returns an error. - STREAM_
MESSAGE_ 🔒TIMEOUT - How long to wait for a message on a gRPC subscription stream before assuming the stream is dead and re-subscribing.
- SUBSCRIBE_
TIMEOUT 🔒 - How long to wait to establish a gRPC subscription stream before assuming the request is wedged and retrying. The subscription handshake should complete promptly.
Functions§
- finalized_
chain_ 🔒tip_ block - Reads the finalized tip block from the secondary db instance and converts it to a
ChainTipBlock. - init_
read_ state_ with_ syncer - Accepts a zebra-state configuration, a
Network, and theSocketAddrof a Zebra node’s RPC server. - update_
finalized_ 🔒chain_ tip