Add get_seq_commit_lane_proof RPC (gRPC + wRPC)#961
Conversation
|
Thanks -- the substance is solid: the consensus impl faithfully ports Two independent peer reviews ran (upstream review + architect peer review on the design surfaces); the issues consolidate into two HIGH concerns to fix before merge, three MEDIUMs, five LOW polish items, and one process note. HIGH (must fix before merge)H1 -- genesis-block panic via Fix: check H2 -- op number MEDIUMM1 -- M2 -- new Recommended resolution: keep the dedicated variants (they're useful for in-process / wRPC consumers and the service handler at M3 -- (a) Wire schema: (b) Type discipline: One coherent fix addresses both: collapse to LOW (polish; not blockers)L1 -- L2 -- L3 -- negative-test L4 -- L5 -- Process / surface notesP1 -- PR description under-represents the consensus-core impact. The body says "consensus-core: new
Suggest extending the PR description with an "API surface extension" subsection so reviewers don't miss them and downstream consumers know what to update on bump. Architect-level positions on design topics(Recorded for the author's reference; none are blockers beyond the items already covered above.)
Static evidence on HEADThe integration test ( The op-collision in H2 was verified by checking PR #991's HEAD ( |
Adds
get_seq_commit_lane_proof(block_hash, lane_key)— returns the witness a client needs to verify a single KIP-21 active-lane against theseq_commitin the block header, without running a full node.Response
smt_proof—OwnedSmtProofwire bytes (inclusion or non-inclusion).lane_tip,lane_blue_score—Someiff the lane has an entry at this POV;Nonesignals a non-inclusion proof.payload_and_ctx_digest,parent_seq_commit— the remaining inputs toverify_smt_metadataso a client can chainlanes_root → seq_commit.Client verification pattern:
OwnedSmtProof::from_bytes→compute_root::<SeqCommitActiveNode>→verify_smt_metadataagainstheader.accepted_id_merkle_root.Changes
consensus-core: newConsensusApi::get_seq_commit_lane_proof+SeqCommitLaneProofreturn type.consensus: implementation onConsensus(ports the pattern fromTestConsensus::seq_commit_lane_proof— pruning lock, canonicality check,SmtStores::prove_lane/get_lane,SmtMetadataStore::get).debug_assert!s that the returned proof re-verifies against the header.async_get_seq_commit_lane_proof.rpc-core: request/response types, serde round-trip tests.bytes, emptylaneTip= absent), conversions, ops, server factory, rpc-core mock.rpc-service.seq_commit_lane_proof_test(gRPC + wRPC): verifies an absence proof at a fresh block, asserts cross-transport equality, tests unknown-block error, and covers an existing lane by mining a second block and querying the coinbase-subnetwork lane (populated via the selected parent's coinbase acceptance).