Skip to main content

Module sync

Module sync 

Source
Expand description

Syncer task for maintaining a non-finalized state in Zebra’s ReadStateService and updating ChainTipSender via RPCs

Structs§

TrustedChainSync
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_block fetch 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_change when 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 the SocketAddr of a Zebra node’s RPC server.
update_finalized_chain_tip 🔒