Skip to content

Update snarkVM to v4.9.1 - #1394

Merged
iamalwaysuncomfortable merged 3 commits into
mainnetfrom
update-snarkvm-v4.9.1
Aug 19, 2026
Merged

Update snarkVM to v4.9.1#1394
iamalwaysuncomfortable merged 3 commits into
mainnetfrom
update-snarkvm-v4.9.1

Conversation

@iamalwaysuncomfortable

@iamalwaysuncomfortable iamalwaysuncomfortable commented Aug 19, 2026

Copy link
Copy Markdown
Member

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 bumps lru to 0.18.2 — the only non-snarkvm lockfile churn here (lru 0.16.3 → 0.18.2, pulling in hashbrown 0.17.1).

Consensus-version count

NUM_CONSENSUS_VERSIONS goes 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.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.

Testing

  • yarn build:all succeeds on both networks
  • yarn test:wasm: 204 passed, 0 failed
  • yarn test:sdk: 1083 passing, 49 pending; the 6 failures are RecordScanner encrypted-registration tests that hit the live api.provable.com/scanner endpoint and fail Unauthorized without API credentials — unrelated to this change
  • RUN_SKIPPED=true mocha tmp/**/wasm.test.js --grep Consensus: the 19-height list is accepted end-to-end on both testnet and mainnet builds

Note

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 getOrInitConsensusVersionTestHeights example and test CSV gains one more height (…,18), including wasm utilities tests and sdk JSDoc mirrors.

WASM proving/verification no longer hardcodes VarunaVersion::V2 where a block height is available: execute_inner, offline prove paths, join/split/transfer, execute_fee!, and verifyFunctionExecution now use varuna_version_from_consensus after resolving CONSENSUS_VERSION. Standalone snarkVerify / 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/process and synthesizer/src/vm surfaced that only execute_authorization_inner derived its Varuna version via varuna_version_from_consensus — every other proving/verification site hardcoded VarunaVersion::V2 despite having the block height in hand. This PR now derives it in execute_inner, join, split, transfer, the execute_fee! macro, and verifyFunctionExecution. Equivalent on mainnet/testnet today (consensus ≥ V4 → Varuna V2); matters on devnets pinned below consensus V4 and future-proofs against a VarunaVersion::V3 upstream. Intentional hardcodes remain in executeFunctionOffline (no height in scope) and snarkVerify/snarkVerifyBatch (raw proofs, no chain height).

Re-ran yarn build:all and yarn test:wasm after the change: 204 passed, 0 failed.

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread wasm/src/programs/manager/execute.rs
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.
@iamalwaysuncomfortable
iamalwaysuncomfortable merged commit 00ff9ee into mainnet Aug 19, 2026
7 checks passed
@iamalwaysuncomfortable
iamalwaysuncomfortable deleted the update-snarkvm-v4.9.1 branch August 19, 2026 20:23
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