Skip to content

feat(runtime)!: import the Groth16 host function so proofs verify natively; nodes older than 0.4.0 cannot import spec 19 (zk-verifier 3.3.0, pallet-zk-verifier 0.18.0) - #168

Merged
nol4lej merged 1 commit into
mainfrom
feat/groth16-host-function-activation
Oct 13, 2026

Conversation

@nol4lej

@nol4lej nol4lej commented Oct 13, 2026

Copy link
Copy Markdown
Member

Summary

Spec 19 imports bn254_groth16_verify: Groth16 proof verification runs natively in the node instead of in Wasm (verify_proof 2.43 → 0.61 ms). The host function has been registered (register_only) since node 0.4.0, which is live with spec 18.

Versions

Crate From To
orbinum-zk-verifier 3.2.0 3.3.0
pallet-zk-verifier 0.17.1 0.18.0
orbinum-runtime / orbinum-node 0.5.0 0.5.0 (spec 19, unreleased)

Changes

Crate Change
orbinum-zk-verifier #[version(1, register_only)] → #[version(1)]. Symbol and behaviour unchanged
pallet-zk-verifier New feature groth16-native: do_verify calls the host function; without it, verify_prepared in Wasm as before
orbinum-runtime Feature groth16-native-runtime (in default); build.rs enables it for the Wasm, except try-runtime builds
Tests the_runtime_does_not_import_the_groth16_host_function_yet → the_runtime_imports_the_groth16_host_function
CI test.yml no_std matrix also checks orbinum-zk-verifier with and without groth16-native
Docs CHANGELOGs of both crates; RUNTIME_VERSIONS.md spec 19 § 4 "Groth16 host function"

Both paths run the same function (verify_prepared), so verification results and consensus do not change. Weights are unchanged: they were measured in Wasm, so they overcharge; re-benchmarking can lower fees later.

⚠️ Rollout requirement

A node without the host function cannot instantiate this runtime and stops importing at the upgrade block. Before setCode:

  1. Every node — validators, RPC, archive, bootnodes, indexer nodes — runs ≥ 0.4.0.
  2. On testnet, all 14 Aura authorities declare a version (today 13/14 do; Aura index 5, validator 0x747bd58e…4205, does not and must upgrade).
  3. setMinAuthorVersion cannot be used as a guard on spec 18: the author-identification bug fixed in spec 19 leaves its quorum unreachable. Set the minimum after the upgrade.

Test plan

  • cargo test -p orbinum-zk-verifier --lib
  • cargo test -p pallet-zk-verifier --features groth16-native
  • cargo check -p pallet-zk-verifier --features groth16-native,runtime-benchmarks,skip-proof-verification
  • cargo test --release -p orbinum-runtime --lib (Wasm built; import test runs)
  • cargo test -p orbinum-node service (node registers the function)
  • cargo check -p orbinum-zk-verifier --no-default-features [--features groth16-native]

…ively; nodes older than 0.4.0 cannot import spec 19 (zk-verifier 3.3.0, pallet-zk-verifier 0.18.0)
@nol4lej
nol4lej merged commit a509c15 into main Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant