Problem Statement / Feature Objective
The light client committee tracks finality across heterogeneous chains with different block times (e.g., 2s Substrate vs 15s Ethereum). Committee synchronization drift exceeds the timeout threshold during periods of high network latency, causing the light client to incorrectly report non-finalized headers as finalized.
Technical Invariants & Bounds
- Max clock drift: 500ms per hop.
- Committee sync timeout: 3x max block time of the target chain.
- Header cache: 256 most recent headers.
- Finality threshold: 2/3 + 1 of committee weight.
- Sync retry backoff: exponential, 1s -> 2s -> 4s -> capped at 30s.
Codebase Navigation Guide
src/cross-chain/light-client/committee-sync.rs — committee synchronization.
src/cross-chain/light-client/finality-verifier.rs — finality verification.
src/cross-chain/consensus/header-cache.rs — header storage.
src/cross-chain/types.rs — chain configuration types.
Implementation Blueprint
- In
types.rs, add BlockTimeMs to ChainConfig; compute SyncTimeout = max(3 * BlockTimeMs, 60000) per chain.
- In
committee-sync.rs, adjust the sync interval per chain: sync at BlockTimeMs / 4 frequency.
- In
finality-verifier.rs, add a grace period multiplier (1.5x sync timeout) before marking headers as finalized when sync drift is detected.
- Add
chain_finality_lag_ms gauge metric for each connected chain.
- Integration test: simulate two chains at 2s and 15s block times with 800ms injected latency, verify finality lag < 10s on both.
Problem Statement / Feature Objective
The light client committee tracks finality across heterogeneous chains with different block times (e.g., 2s Substrate vs 15s Ethereum). Committee synchronization drift exceeds the timeout threshold during periods of high network latency, causing the light client to incorrectly report non-finalized headers as finalized.
Technical Invariants & Bounds
Codebase Navigation Guide
src/cross-chain/light-client/committee-sync.rs— committee synchronization.src/cross-chain/light-client/finality-verifier.rs— finality verification.src/cross-chain/consensus/header-cache.rs— header storage.src/cross-chain/types.rs— chain configuration types.Implementation Blueprint
types.rs, addBlockTimeMstoChainConfig; computeSyncTimeout = max(3 * BlockTimeMs, 60000)per chain.committee-sync.rs, adjust the sync interval per chain: sync atBlockTimeMs / 4frequency.finality-verifier.rs, add a grace period multiplier (1.5x sync timeout) before marking headers as finalized when sync drift is detected.chain_finality_lag_msgauge metric for each connected chain.