Repository navigation
Re-vendor circuits: constraint set 11 (Grain constants, declared poseidon2 height, rate-¼ quotient layout, versioned rVM keys, cell-count gas) - #194
Merged
Conversation
…idon2 height, rate-1/4 quotient layout, versioned rVM keys, cell-count gas) Issue #166 step 7, for the chain-22 cut and v0.8.7. CIRCUITS_PIN b3e21d9 -> 76a48dca (circuits org/main), synced with deploy/sync-zkvm.sh; seven guests (evm-v1 added). - BUILD_CONSTRAINT_SET 11; chain 21 joins CHAINS_THIS_BUILD_CANNOT_RUN. Set 11 moves every Poseidon2 output, so no chain 14-21 genesis file builds any more: constraint_set::build_genesis refuses them by chain id at init/run/verify, before any datadir is touched. Chain 22's CHAIN_CONSTRAINT_SETS row is owed at its cut. - Guest digests: bundle v1 71eedbfb, v2 3aff6361, v3 00782b22, auth 8373994c, msauth 41db73c5 (guest_provenance pins both these and the set-10 values chains 14-21's files carry). - Gas mirror gas_max_declared(t,k,s,m,p2): bundle 22527, auth 1407, msauth 355775 (MSAUTH_POSEIDON2_LOG_HEIGHT 16). poseidon2_log_height carried through ProofShape, MsauthShape, CallDryRun and the aggregate path; bundle/auth inner proofs and the canonical perp state proof declare the tier's full height. - msauth key blobs: production 23851 B 168d79a8 (reproduced by keygen), test d30472df. - Executor FRI mirror follows machine::LOG_BLOWUP (2): 92 queries / 24 pow bits. - Recursion fixtures Test-0..2 re-proved and re-pinned; inner vk b9046f5d, interface digest 517d13e4, production aggregate program digest 43e02700. msig signer-check fixtures regenerated. - deploy/cut-chain22-genesis.sh: EXPECT_HC_BUNDLE, EXPECT_HC_AUTH, HC_AUTH_MULTISIG_DECIDED, BUNDLE_GAS_LIMIT to set 11's; chain 21's file asserted at its set-9 values. Perps engine pins left as chain 21's (durian must rebuild). - Docs, CHANGELOG (Unreleased) and AGENTS.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The optional git dependency's rev moved with the re-vendor but the lock still named 71e1a04, so every `--locked` job (clean-clone, wallet-e2e, release) refused to update it. `cargo update -p rand-zkvm-cuda` under the pinned 1.98.1 toolchain: the cuda crate's new p3 deps, one itertools dropped, range-compatible picks below it. Checked with --locked on the build droplet in all three CI layouts: fullnode alone (metadata + check --workspace --tests), beside circuits at the pin, and nested as wallet-e2e checks it out (release build of rand-node and rand-prover). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
…N-601) A block carrying a tier-18 perps state proof made every validator build that shape's verifier key (~1.7 GB with `parallel`, ~3.3-4 GB without), so a 2 GB validator could OOM on a valid block. Chain 22 pins the keys instead. - core: gated genesis field `perps.state_proof_keys` (serde default + skip, bound into the genesis hash only when set, `rand-perps-ext-3` persisted); check() admits only canonical shapes of the chain (<= 8, ordered, needs engine_program_log_height). When set, an unpinned declared shape is refused before any key is touched, at validate and at apply. - zkvm (node-local executor.rs): `perp_vk` module (chain-22 shapes, compiled-in SHA-256 pins, file names, blob/check); pinned mode refuses unpinned shapes in perp_pre_key, verifies only against loaded keys and never builds one. - node: `perps_key` loads every pinned file at startup (--perps-key-dir, RAND_PERPS_KEY_DIR, beside the binary), refuses to start on a missing or mismatched file, reports rand_status.perps_keys; rand_getPerps serves the list; `rand-node keygen-perp-vk` (--print-pinned, --check, --genesis-json, --profile --out-dir); `verify` loads them too. - client: `rand perp prove` refuses non-canonical shapes on a pinned chain. - keys: the four chain-22 Production files (tier 18, program 14, input 16, poseidon2 20, public 7/8/9/10), 13 685 bytes each, in crates/randprotocol-zkvm/keys/. - deploy: the chain-22 cut sets the field from the shipped files held to the cutting rand-node's pins, asserts it, probes it in the hash and reads it back in check-limits (selftest 467 passed, 0 failed); release.yml ships, sums, attests and checks the files; roll-all.sh installs them (PERPS_VK_DIR). - docs: deploy.md, perps.md, CHANGELOG. Chain 21's genesis and pins are unchanged (the field is absent there). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
…is root a45d8fda… Set 11's Grain Poseidon2 constants move the engine's hc and the perps genesis root; neither the image nor the genesis words change (durian.market #2, measured on a5e08a9): - ENGINE_HC_DECIDED = 482215a8df02dff341265c38212c47e23fc8bfb3c3297afe9c385d6a63e65073 (chain 21's image, sha256 77dfc228...); chain 21's f286a611... is kept as ENGINE_HC_CHAIN21 for the check on chain 21's genesis. The finished file's engine_hc must be the set-11 hc and not chain 21's; check-limits wants it from rand_getPerps. - PERP_GENESIS_ROOT_DECIDED = a45d8fdab8cf7dab972e76dd6a7a18d9e82fc8210afab672a161ee60021698b4 (perp-prover genesis-state over BTC-PERP -> rand perp genesis-root; the 26 words are chain 21's, sha256 bb32f0c4...). The genesis_root check is now "equals the recorded set-11 root" (was "equals chain 21's da0e3a53..."); chain 21's root is refused. The derivation moves into perp_genesis_root_step, which refuses the set-9 root and any other before the section is written. - Selftest: perp_genesis_root_step against a fake prover and rand (5 cases), and refusals of chain 21's root and engine hc in the finished file: 474 passed, 0 failed. - crates/randprotocol-core/tests/vectors/perps-v1.json: the three perp_digest vectors regenerated under set 11 (PERPS_WRITE_VECTORS=1); randprotocol-zkvm's perps_vectors failed on the set-9 values on #194/#195. core's golden test still passes. - docs/deploy.md, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
… issue #168) CIRCUITS_PIN 76a48dca -> 41d64acd, and both rand-zkvm-cuda revs with it (Cargo.lock updated with cargo update -p rand-zkvm-cuda). deploy/sync-zkvm.sh from circuits 41d64acd; the recursion VM did not move (crates/randprotocol-rvm unchanged). - evm.bin hc 3869b014...8920720d (program id 0eff0627...), evm-v1.bin 040c01c8...3454; the guests-compiled and vendor/circuits manifests and PROVENANCE.md re-synced. No hand-held evm hc pin existed elsewhere in fullnode (guest_provenance checks the manifests). - evm_core::Host gained read_public: the vendored HostRef answers 0 (no context version, so the block opcodes trap as under a version-1 context), the new HostPublic reads a segment and panics past its end (no proof in the guest), and HostBox (ffi) forwards to READ_PUBLIC. No fullnode-owned Host impl exists. - New crates/randprotocol-zkvm/tests/invoke_at_context.rs (excluded from the sync): the guest's CTX_* offsets equal the ledger's; the vendored interpreter over the segment the ledger builds (Transition::context_at over BlockFacts::context_words) pushes NUMBER, TIMESTAMP, CHAINID, BASEFEE, GASPRICE and PREVRANDAO from words 11-27, traps PREVRANDAO without a beacon and every block opcode under version 1; and a Test-profile InvokeAt proof of an RV32 program reading words 8+{0,11,12,13,16,17,19,27} verifies on its own block's segment and is refused on another time, another beacon value and a version-1 context. - docs/evm-block-context.md, CHANGELOG.md, AGENTS.md: the guest side is vendored. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
dendisuhubdy
added a commit
that referenced
this pull request
Nov 20, 2026
…t 11) - Workspace version 0.8.7: Cargo.toml, the seven workspace crates in Cargo.lock (cargo update -w on the build droplet; offline failed on the rand-zkvm-cuda git dependency), the rand_getVersion test. - CHANGELOG: Unreleased becomes v0.8.7 (tag date a PLACEHOLDER), with a row for #197's cutover-fleet-chain22.sh and the asset list. - docs/releases/v0.8.7.md: the set-11 gas change as a governance record (bundle 20 479 -> 22 527, auth 1 279 -> 1 407, msauth 436 159 -> 355 775; the per-row weights), the chain-22 cut, the operator upgrade steps and the rollback. The chain-22 genesis hash and the CHAIN_CONSTRAINT_SETS row are PLACEHOLDER-... until the cut. - README release table: v0.8.7. AGENTS.md: #194 is merged. Not tagged, not signed, not published. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
dendisuhubdy
added a commit
that referenced
this pull request
Nov 20, 2026
…t 11) (#198) * v0.8.7: version, changelog and release notes (chain 22, constraint set 11) - Workspace version 0.8.7: Cargo.toml, the seven workspace crates in Cargo.lock (cargo update -w on the build droplet; offline failed on the rand-zkvm-cuda git dependency), the rand_getVersion test. - CHANGELOG: Unreleased becomes v0.8.7 (tag date a PLACEHOLDER), with a row for #197's cutover-fleet-chain22.sh and the asset list. - docs/releases/v0.8.7.md: the set-11 gas change as a governance record (bundle 20 479 -> 22 527, auth 1 279 -> 1 407, msauth 436 159 -> 355 775; the per-row weights), the chain-22 cut, the operator upgrade steps and the rollback. The chain-22 genesis hash and the CHAIN_CONSTRAINT_SETS row are PLACEHOLDER-... until the cut. - README release table: v0.8.7. AGENTS.md: #194 is merged. Not tagged, not signed, not published. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo * v0.8.7 notes: the set-11 address re-derivation (#199) and WALLET22 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Issue #166 step 7: re-vendor the zkVM circuits from constraint set 9 (circuits
b3e21d9) to constraint set 11 (circuits org/main76a48dca), for the chain-22 cut and v0.8.7. This is a chain cut. Never roll it onto chain 21. Squash-merge only. Do not merge before the cut gates are met.Pins, old → new
CIRCUITS_PINb3e21d976a48dca92a2d0382370f383d6680971db0cc574.github/workflows/ci.yml, both PROVENANCE.mdBUILD_CONSTRAINT_SETcrates/randprotocol-node/src/node.rs83d3a370…0ef871eedbfb…ee70tests/guest_provenance.rs651043e2…839b3aff6361…6046hc_bundle)60af094a…3fce00782b22…141eEXPECT_HC_BUNDLEhc_auth)1e4e347f…39c18373994c…6078EXPECT_HC_AUTHhc_auth_multisig)9705f8e2…824741db73c5…9cd1MSAUTH_HC;HC_AUTH_MULTISIG_DECIDED4a27356f…4afb6e968302…dc1dguest_provenance.rs68facb06…cd30168d79a8…71b3keys/msauth-vk-production.bin,MSAUTH_VK_SHA256_PRODUCTIONc82250e7…43f5d30472df…db3dkeys/msauth-vk-test.bingas_max(14,0,0)/bundle_gas_limitcore/src/gas.rs; cutBUNDLE_GAS_LIMITgas_max(10,0,0)(auth)auth_gas_limit_pinmsauth_gas_limit_pinmachine::LOG_BLOWUP= 2, 92 q / 24 powexecutor.rs1b0c4b00…ddc7b9046f5d…32daagg_executor.rs3753f2fd…86b4517d13e4…a8c0agg_executor.rs,scripts/recursion-fixtures.sh792a66d4…a98243e02700…aa5bagg_executor.rs(= the vendored rVM test's pin)1f837913…,3f19d551…,08fddfc0…2cd78847…,641544f4…,c21895dd…scripts/recursion-fixtures.sh69010a43…ffb524ad1bc2…fef8main.rsthe_genesis_hash_is_pinnedagg_executor::admitted_tiersChain 22 vs chain 21
Moved for chain 22:
poseidon2_log_heightis now part of the proof header and is carried throughProofShape,MsauthShape,CallDryRun, the 8-componentVerifierKeyShapeandInnerShape.INNER_POSEIDON2_REFUSAL);DeclaredShape(consensus-visible) is unchanged.gas_max_declaredmirror.deploy/cut-chain22-genesis.shchanged only in its hc and gas values:EXPECT_HC_BUNDLE,EXPECT_HC_AUTHandHC_AUTH_MULTISIG_DECIDEDtake the set-11 values;BUNDLE_GAS_LIMITis 22527;Stayed for chain 21:
deploy/genesis-chain21.jsonand every chain-14–21 file are byte-identical.(21, ca76c276…, 9).invoke_wire_pinandbeacon_gate_off_pinpass.constraint_set::build_genesisrefuses those files by chain id. The refusal names the chain's set, says nothing was written, and points to the release for that set (v0.8.6 for chain 21).CHAIN_CONSTRAINT_SETS.node::tests::chain_21_is_byte_for_byte_what_it_was_before_the_beaconandchain_21_restarts_from_its_checkpoint…are#[ignore]d with that reason. The v0.8.6 line runs them.Not done (cannot be): chain 22's
CHAIN_CONSTRAINT_SETSrow. There is nogenesis-chain22.jsonuntil the cut. The cut prints the row (check-constraint-set.sh --print-row), andcheck-limitsrefuses until it is committed.Tests (build droplet, Rust 1.98.1; the Mac built nothing)
cargo test --workspace --lib --bins --release -- $(scripts/ci-fixture-skips.sh)prover::tests::the_trusted_proverssubmit,ws,public_rpc_check; proverhttp/service/pairing/wire/retired_flag/cli; clientcli_*,rpc_methods; nodeprover_hosted,keygen_cli,prover_flag,network,cli_multisig,cli_staking,cli_vesting,cli_datadir,cli_bridge_gov;genesis_cli(15/15 after its msauth pin);dandelion;burst_memory;rpc_contractguest_provenance(19),verifier_key(zkvm, rvm),invoke_wire_pin,beacon_gate_off_pin,no_pre_phase4_recursion_pins-D warnings)scripts/recursion-fixtures.sh --checkcheck-constraint-set.sh(with and without--upstreamat the pin) and its tests inconstraint_setSELFTEST=1 bash deploy/cut-chain22-genesis.sh(after the rebase onto #193)unit-limitsandroll-fleetrefuse to run as root, so they ran on the Mac: 66/66 each)keygen-msauth-vk --profile production168d79a8…71b3byte for byteOwed downstream
rand perp image-hcgives482215a8df02dff341265c38212c47e23fc8bfb3c3297afe9c385d6a63e65073forartifacts/perp-engine.image.bin, withengine_program_log_heightstill 14 (wasf286a611…);be19a49a668d80a8e72b941e2ec0b0ca18d09da6794f02103c547cd7e4bb8fb1(height 11);perp-prover genesis-statemust re-derivegenesis_root, since chain 21'sda0e3a53…is a set-9 Poseidon2 root;ENGINE_HC_DECIDED/PERPS_DECIDED/genesis_rootchecks stay at chain 21's values and are left for that re-pin. They are not guessed here.crates/randprotocol-msig/tests/fixtureswere regenerated, so any copy of them in clients must follow.CIRCUITS_PINstep. This PR stops at76a48dca.rand's non-CPU fee estimate still prices at the full-heightgas_max. This over-charges and never under-charges.🤖 Generated with Claude Code
https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo