Skip to content

fullnode e79070a7 (constraint set 11) for chain 22 / v0.8.7, and cut-chain22.sh - #15

Merged
dendisuhubdy merged 5 commits into
mainfrom
feat/cs11-chain22
Nov 21, 2026
Merged

dendisuhubdy merged 5 commits into
mainfrom
feat/cs11-chain22

Conversation

@dendisuhubdy

Copy link
Copy Markdown
Member

This moves the bridge onto fullnode main e79070a7: zkVM constraint set 11, for the chain-22 cut and v0.8.7. It includes fullnode #194 (the set-11 re-vendor, circuits 41d64acd) and #197 (deploy/cutover-fleet-chain22.sh). Do not merge before the cut gates. The live bridge serves chain 21 until the cut. Nothing here was deployed, and no live server was contacted.

Set 11 and the bridge

The bridge computes nothing that set 11 changes:

  • crates/bridge-codec and randprotocol-core/src/bridge are byte-identical from v0.8.6 to e79070a7.
  • The daemons use blake3, keccak and sha, and sign with ECDSA and Dilithium2. They never use Poseidon2.
  • The note commitments that a mint creates are made inside rand bridge-mint, the wallet the relayer calls.

So:

  • Guardian and relayer binaries: no rebuild for set 11.
  • Contract side: no calls. cut-chain22-genesis.sh carries chain 21's bridge section and asserts it: emitter, emitters, guardian sets, PQ set, pause key, fees and rotation.

What moved

  • CI (coverage.yml): fullnode was checked out at an unpinned main. It is now checked out at FULLNODE_REF = e79070a714988105c571ddae3dfeed96b4b39e93. Set v0.8.7 at the tag.
  • Lockfiles (daemons, tools/vectors, solana): only the path crates bridge-codec / randprotocol-core move, 0.8.0/0.8.2 → 0.8.6.
  • Vectors: no change. vectors/attestations.json regenerates byte for byte and matches fullnode's copy at e79070a7. pq-cosignatures.json also regenerates byte for byte. The chain-21 governance vectors stay: they pin a layout at a real genesis.
  • daemons/mainnet/cut-chain22.sh (new, derived from cut-chain21.sh): the steps are status / stop / relayer-rand / droplet 1..6 / relayer / laptop / start / rollback-rand / selftest.
    • It switches both chain_id 21 → 22 and genesis_hash (BR-1005).
    • Its inputs have no defaults, because none of them exists before the cut:
      • GENESIS_HASH comes from chain22.record. It is checked against RAND_RPC and each guardian host's own node, and chain 21's hash is refused.
      • BURN_SEQ is checked against the chain, as before.
      • RAND_OLD_SHA is read with status.
      • RAND_NEW_SHA comes from v0.8.7's signed SHA256SUMS.
    • A host config without a genesis_hash line is left without one, and the script prints a NOTE. Such a config belongs to a pre-BR-1005 daemon: bridge tags up to v0.8.6 lack the field and refuse an unknown one.
  • config.example.toml: chain_id = 22. The genesis hash is a marked TODO.
  • Unchanged: the repo's mainnet/*.toml stay on chain 21 because they mirror the live hosts. This follows every earlier cut, where the repo copies were updated after the cut.
  • README / AGENTS.md: the vectors commands now pass --bin vectors, and AGENTS.md has a chain-22 prep entry.

Tests (build droplet, Rust 1.98.1, against fullnode e79070a7)

Run Result
daemons: cargo test --release --locked 328 passed, 0 failed, 2 ignored (30 test binaries)
anvil_e2e (anvil/forge/cast installed, so it ran, not skipped) 1 / 1
daemons: cargo clippy --release --all-targets -D warnings clean
solana: cargo test --release --locked 63 passed, 0 failed, 4 ignored
tools/vectors: --bin vectors -- --check, --bin pq-vectors -- --check both byte-identical
evm: forge test (Mac; OZ v5.0.2) 147 passed, 0 failed, 4 skipped
cut-chain22.sh selftest (Mac; shellcheck -S warning clean) 35 / 35
cut-chain21.sh selftest passes, unchanged

Not run: Tron (deploy/trx.sh nile --dry-run). Its sources mirror evm/, and nothing in them changed.

At the cut (the bridge's part of cutover-fleet-chain22.sh)

  1. Before the snapshot, run cut-chain22.sh status (to record RAND_OLD_SHA), then stop. Settle every in-flight lock on chain 21 first.
  2. After the fleet's switch, run relayer-rand <v0.8.7 Linux rand>. A set-9 rand cannot mint on chain 22. The relayer wallet's first scan on chain 22 empties and rescans its note store.
  3. Run droplet 1..6, relayer and laptop with GENESIS_HASH, BURN_SEQ and RAND_NEW_SHA. Then run the fleet's BRIDGE_ON_CHAIN22=yes … bridge-start, or this script's start (guardians first, the relayer last).
  4. Afterwards:
    • commit mainnet/*.toml with chain 22 and its genesis;
    • re-make the kept-ready pause file, which binds the genesis;
    • run rand-bridge-audit;
    • do a 1 USDT round trip.

Decide before the cut: rand1 addresses change under set 11.

  • pk = H_PK(nk) is a Poseidon2 output, so the same wallet seed has a new address and a new recipient hash on chain 22.
  • Consider the relayer's recipients table, a lock that names a pre-cut recipient hash, or a randbridge.org deposit address cached from a set-9 wallet. Each of these would mint to a set-9 pk, and no set-11 wallet can spend that note.
  • What to do with the recipients store on chain 22 (carry, archive, or refuse old hashes) is the owner's call. This PR changes nothing there.
  • randbridge.org must derive addresses with a set-11 wallet core.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo

dendisuhubdy and others added 3 commits November 20, 2026 06:41
…s take the 0.8.6 path crates

The coverage job checked out fullnode main unpinned; it now checks out FULLNODE_REF, fullnode
main e79070a7 (PR #194 set-11 re-vendor, circuits 41d64acd; #197 the chain-22 fleet cutover).
Set v0.8.7 at the tag. bridge-codec and randprotocol-core/src/bridge are byte-identical between
v0.8.6 and e79070a7, so the lockfiles move only the path entries (0.8.0/0.8.2 -> 0.8.6).
vectors/attestations.json regenerates byte for byte and matches fullnode's copy at e79070a7.
README: the vectors tool has two binaries, so its commands name --bin vectors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
…set 11), with a selftest

Derived from cut-chain21.sh. Differences: genesis_hash moves with chain_id (BR-1005), from
GENESIS_HASH, which has no default because it exists only at the cut, and is checked against
RAND_RPC and each guardian host's own node. A host config without a genesis line (a pre-BR-1005
daemon) is left without one, with a NOTE. Chain 21's genesis is never accepted. The relayer's
rand swap to v0.8.7 takes RAND_OLD_SHA (read with the new read-only status step) and
RAND_NEW_SHA (v0.8.7's signed SHA256SUMS) from the environment and keeps rand.pre-c22.
selftest: 35 checks, ssh/scp/curl shimmed, contacts nothing.
config.example.toml: chain_id 22, genesis_hash a marked TODO for the cut.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dendisuhubdy
dendisuhubdy marked this pull request as ready for review November 21, 2026 04:36
@dendisuhubdy
dendisuhubdy merged commit fdb5e34 into main Nov 21, 2026
2 checks passed
@dendisuhubdy
dendisuhubdy deleted the feat/cs11-chain22 branch November 21, 2026 04:46
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