feat: Directory Client: TM Light Client Anchor#6941
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f07b05f to
b5c054b
Compare
19001b3 to
a1cbee6
Compare
b5c054b to
bc25634
Compare
Add a Tendermint light-client trust anchor for the directory client
What
Adds
LightClientAnchor, a secondDirectoryTrustAnchorimplementation that verifies the blockapp_hashvia the Tendermint light-client protocol (validator-set consensus) instead of trusting a configured RPC. It's a drop-in alternative toProvenTrustAnchor, gated behind a newlight-clientfeature onnym-directory-client.Why
ProvenTrustAnchor(phase 1a) readsheader[H+1].app_hashfrom a configured RPC and trusts it.LightClientAnchor(phase 1b) removes that honest-RPC assumption: starting from a caller-pinned checkpoint, it accepts anapp_hashonly after verifying the signed header carrying it against the trusted validator set. A forged header from an adversarial RPC fails verification before any downstream ICS23 proof is checked.How
Checkpoint { height, signed_header, validators, next_validators }the caller has verified out-of-band. It verifies a target header directly from the checkpoint (one hop for a stable validator set), and on insufficient trusted-validator overlap (Verdict::NotEnoughTrust) bisects to the arithmetic midpoint and recurses instead of stepping every block.HeightBelowCheckpoint.next_validators. Each verified hop fetchesvalidators(target+1)and passes it asUntrustedBlockState.next_validators, tying the set the next skip hop trusts to the verified header'snext_validators_hash.Options(trust threshold, trusting period, clock drift) withnyx_default_options().Testing
MockRpcClient(validator-client, behind amocksfeature) serving pre-registeredcommit/validatorsresponses with a call log.nyxmainnet fixtures covering: direct verification advances + caches, skip resolves in a single hop, cache hit avoids re-fetch, stale checkpoint fails, below-head/below-checkpoint handling, and bisection (via a checkpoint padded with a dominant non-signing validator, asserted through thecommitcall sequence).This change is