Skip to main content

Module driver

Module driver 

Source
Expand description

Periodic entropy reconciliation driver.

EntropyDriver is the long-running task that walks a ServerPool’s peer list at a configured cadence and calls reconcile_with_peer for every non-local entry. Each cycle produces a ReconCycle summary that is logged at INFO level so operators can verify the run loop is alive and observe divergence / repair counters as the cluster’s state settles.

The driver uses the existing crate::entropy::send::EntropySender::push primitive: each peer interaction is one snapshot push of the configured crate::entropy::SnapshotSource. Embedders that supply a richer source (e.g. one that carries per-range Merkle digests) get the corresponding richer reconciliation semantics for free; the default in-memory or RDB-backed sources still drive a full snapshot push per cycle.

§Shutdown

EntropyDriver::run_until_shutdown honours a tokio::sync::watch::Receiver<bool>: when the flag flips to true the loop drains the in-flight cycle (the per-peer reconciliations of the current tick complete) and returns. The next tick is suppressed.

Structs§

EntropyDriver
Periodic reconciliation driver.
ReconCycle
Outcome of a single reconciliation pass.

Constants§

DEFAULT_ENTROPY_PORT
Default TCP port the entropy receiver listens on.
DEFAULT_RECON_INTERVAL
Default cadence for the entropy run loop (five minutes).

Functions§

reconcile_with_peer
Run one reconciliation pass against peer.