Module checkpoint_broadcast

Module checkpoint_broadcast 

Source
Expand description

Sequential pipeline that re-publishes each ingested checkpoint to a [tokio::sync::broadcast] channel, in checkpoint order.

Unlike the other pipelines this one writes nothing to the RpcStoreSchema: its “batch” is the Checkpoint itself (type Batch = Option<Arc<Checkpoint>>). The framework’s sequential committer drives commit in strict checkpoint order, and — because pipelines registered with the Synchronizer set MAX_BATCH_CHECKPOINTS = 1 — each commit corresponds to exactly one checkpoint. So sending on the broadcast channel from commit yields a gap-free, in-order checkpoint stream.

This is the standalone sui-rpc-node’s analog of the fullnode’s checkpoint-executor broadcast: it lets the node host sui-rpc-api’s checkpoint-subscription service over the same checkpoints it indexes. The pipeline is not part of PipelineLayer — it carries a runtime broadcast::Sender rather than a config toggle, so callers register it explicitly via Indexer::add_checkpoint_broadcast.

Structs§

CheckpointBroadcast
Pipeline that broadcasts each committed checkpoint. Holds the send half of the broadcast channel the subscription service reads from.

Functions§

seed_watermark_to_tip
Seed the broadcast pipeline’s resume watermark to checkpoint when it has none yet, so it starts at the live tip rather than genesis.