Update snarkVM to v4.9.1 - #1394
Merged
Merged
Conversation
Moves all ten snarkvm-* dependencies from 4.9.0 to 4.9.1 on crates.io. Lockfile churn beyond snarkvm-* is confined to lru 0.16.3 -> 0.18.2 (bumped upstream in this release), which pulls in hashbrown 0.17.1. snarkVM v4.9.1 introduces ConsensusVersion::V19 (per-transaction deployment limits), so NUM_CONSENSUS_VERSIONS goes from eighteen to nineteen and get_or_init_consensus_version_heights now requires nineteen heights. All copies of the eighteen-value consensus CSV are extended by one: - sdk/tests/wasm.test.ts and the test_set_genesis_block_non_zero_fails input in wasm/src/utilities/mod.rs - the getOrInitConsensusVersionTestHeights doc example in wasm/src/utilities/mod.rs - the JSDoc examples in sdk/src/program-manager.ts and their docs/api_reference mirror - create-leo-app/template-devnode-js/index.js No wasm source changes are needed: the manager code only compares consensus versions relationally (< V9, < V14) and already delegates Varuna selection to snarkVM's varuna_version_from_consensus. yarn.lock is updated alongside the version bump since CI installs with --immutable.
…t is known The v4.9.0 upgrade switched execute_authorization_inner from a hand-rolled consensus match to snarkVM's varuna_version_from_consensus, but every other proving and verification site kept a hardcoded VarunaVersion::V2. Those sites all fetch the latest block height before proving, so the version can be derived instead: - execute_inner (buildExecutionTransaction), join, split, and transfer now compute the consensus version once, right after the height fetch, and thread the derived Varuna version through both prove_execution and verify_execution. - The execute_fee! macro does the same for prove_fee and verify_fee. - verify_function_execution derives it from its block_height parameter. The two are equivalent on mainnet and testnet today (every consensus version >= V4 maps to Varuna V2), so no behavior changes there. The difference shows on devnets pinned below consensus V4, which expect V1 proofs, and if upstream ever adds a VarunaVersion::V3: hardcoded sites would silently keep producing V2 proofs, while derived ones follow snarkVM's mapping. Three intentional hardcodes remain: executeFunctionOffline, which has no block height in scope, and snarkVerify/snarkVerifyBatch, which verify raw proofs with no notion of a chain height.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 065fc6e. Configure here.
Cursor's review of the previous commit caught an inconsistency it introduced: executeFunctionOffline still proved with a hardcoded VarunaVersion::V2 while verifyFunctionExecution now derives its version from the block height, so an offline proof made on a devnet below consensus V4 (a V2 proof) would fail the updated verifier (expecting V1). Before, both sides hardcoded V2 and at least agreed. The proving branch already snapshots ledger state over the network for inclusion proofs, so taking the block height from the same query object adds no new dependency; the non-proving branch is untouched. This was the last VarunaVersion::V2 in the file, so the import goes too. The only remaining hardcodes are snarkVerify/snarkVerifyBatch, which verify raw proofs with no notion of a chain height.
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.

Summary
Updates all ten
snarkvm-*dependencies from 4.9.0 to 4.9.1 (crates.io) and bumps the package versions to 0.11.7, following the same shape as #1387.What v4.9.1 brings
snarkVM v4.9.1 introduces
ConsensusVersion::V19(per-transaction deployment limits, keeping the block-wide synthesis limit on the first V19 block) and bumpslruto 0.18.2 — the only non-snarkvm lockfile churn here (lru0.16.3 → 0.18.2, pulling inhashbrown0.17.1).Consensus-version count
NUM_CONSENSUS_VERSIONSgoes 18 → 19, so every copy of the consensus-heights CSV is extended by one value (the same set of sites #1387 converged on):sdk/tests/wasm.test.tsand thetest_set_genesis_block_non_zero_failsinput inwasm/src/utilities/mod.rsgetOrInitConsensusVersionTestHeightsdoc example inwasm/src/utilities/mod.rssdk/src/program-manager.tsand theirdocs/api_referencemirrorcreate-leo-app/template-devnode-js/index.jsNo wasm source changes are needed: the manager code only compares consensus versions relationally (
< V9,< V14) and already delegates Varuna selection to snarkVM'svaruna_version_from_consensus.Testing
yarn build:allsucceeds on both networksyarn test:wasm: 204 passed, 0 failedyarn test:sdk: 1083 passing, 49 pending; the 6 failures are RecordScanner encrypted-registration tests that hit the liveapi.provable.com/scannerendpoint and failUnauthorizedwithout API credentials — unrelated to this changeRUN_SKIPPED=true mocha tmp/**/wasm.test.js --grep Consensus: the 19-height list is accepted end-to-end on both testnet and mainnet buildsNote
Medium Risk
Touches core proving and verification in WASM (Varuna selection); behavior matches mainnet/testnet today but changes devnets below consensus V4. Dependency bump across the whole monorepo adds release-wide regression surface.
Overview
Bumps @provablehq/sdk / @provablehq/wasm and create-leo-app to 0.11.7, pins all snarkvm-* crates to 4.9.1 (including lru 0.18.2 via the lockfile), and aligns workspace templates, e2e packages, docs, and yarn lock with the new SDK.
For snarkVM v4.9.1’s 19th consensus version, every devnode
getOrInitConsensusVersionTestHeightsexample and test CSV gains one more height (…,18), including wasm utilities tests and sdk JSDoc mirrors.WASM proving/verification no longer hardcodes
VarunaVersion::V2where a block height is available:execute_inner, offline prove paths, join/split/transfer,execute_fee!, andverifyFunctionExecutionnow usevaruna_version_from_consensusafter resolvingCONSENSUS_VERSION. StandalonesnarkVerify/ batch verify stay on V2 because no chain height is in scope.Reviewed by Cursor Bugbot for commit dde578e. Bugbot is set up for automated code reviews on this repo. Configure here.
Derive the Varuna version wherever a height is known (065fc6e)
Comparing the manager against snarkVM's
synthesizer/processandsynthesizer/src/vmsurfaced that onlyexecute_authorization_innerderived its Varuna version viavaruna_version_from_consensus— every other proving/verification site hardcodedVarunaVersion::V2despite having the block height in hand. This PR now derives it inexecute_inner, join, split, transfer, theexecute_fee!macro, andverifyFunctionExecution. Equivalent on mainnet/testnet today (consensus ≥ V4 → Varuna V2); matters on devnets pinned below consensus V4 and future-proofs against aVarunaVersion::V3upstream. Intentional hardcodes remain inexecuteFunctionOffline(no height in scope) andsnarkVerify/snarkVerifyBatch(raw proofs, no chain height).Re-ran
yarn build:allandyarn test:wasmafter the change: 204 passed, 0 failed.