feat(node): expose the GRANDPA RPC so external verifiers can prove Orbinum finality - #144
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
While reviewing our testnet onboarding request (#1200), Hyperbridge asked us to wire the GRANDPA RPC into our node, they found it exposes no GRANDPA methods.
They were right: it was never wired in, so
sc-consensus-grandpa-rpcwasn't even a dependency. Their prover needsgrandpa_proveFinalityto verify Orbinum finality.Node-side only: no runtime change,
spec_versionstays at 11.What
Wires
sc_consensus_grandpa_rpc::Grandpafollowing the canonical pattern frompolkadot-service/polkadot-rpc.One thing needed care:
SharedVoterStateis now created once and shared with the voter. It used to be built inline at the voter, and a detached instance leavesgrandpa_roundStatereporting zeroed rounds instead of failing.Pinned to
sc-consensus-grandpa-rpc0.44.0 — 0.45.0 would put two copies ofsc-consensus-grandpain the lockfile.Verified on a dev node
grandpa_roundStatereturns live data (round: 87, real weights), which is what proves the voter state is shared.Same binary, same flags, only the code differs:
Exactly four added, nothing removed. All work under
--rpc-methods Safe, which the public endpoint uses, they serve finality proofs for already-final blocks, public by definition.cargo test12/12, clippy and fmt clean.