Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# What is measured: `daemons/` (the guardian, the relayer, the governance tool and the audit tool,
# with the shared vectors) in the release profile, which is how README.md runs them. The daemons
# crate depends on `bridge-codec` from a sibling fullnode checkout
# (`../../fullnode/crates/bridge-codec`), so fullnode's `main` is checked out next to it. The
# (`../../fullnode/crates/bridge-codec`), so fullnode is checked out next to it at FULLNODE_REF. The
# Solana program under `solana/` needs the Solana toolchain and is not measured; the tests that
# need Foundry's anvil skip themselves when it is absent.
#
Expand All @@ -28,6 +28,11 @@ concurrency:
group: coverage-${{ github.ref }}
cancel-in-progress: true

env:
# The fullnode the daemons build against: constraint set 11, the v0.8.7 release (tag bf5aabdf),
# which chain 22 has run since 2026-11-21 (v0.8.6 is set 9, chain 21).
FULLNODE_REF: v0.8.7

jobs:
coverage:
runs-on: ubuntu-latest
Expand All @@ -42,6 +47,7 @@ jobs:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
repository: randprotocol/fullnode
ref: ${{ env.FULLNODE_REF }}
path: fullnode
- uses: dtolnay/rust-toolchain@89b12181fb390509a0842a86cc55eeb8eb928c1d # stable (branch head, 2026-10-05)
# llvm-tools for the toolchain the checkout pins (rust-toolchain.toml, where there is one),
Expand Down
25 changes: 24 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ read it before touching anything there, it is worked on by many sessions in para
or script defaults; scripts read them from `~/.rand-bridge/mainnet-set1/hosts.txt` and
`~/.rand-bridge/relayer-host/host.txt` (`public <ip>`, `hostkey SHA256:…`) or the environment.

## State as of 2026-11-20 — chain-22 prep: fullnode e79070a7 (zkVM constraint set 11), NOT cut, NOT deployed

- **Branch `feat/cs11-chain22`** builds against fullnode main `e79070a7` (PR #194's set-11 re-vendor,
circuits `41d64acd`; #197 `deploy/cutover-fleet-chain22.sh`). CI's `FULLNODE_REF` pins it (it was
an unpinned `main` checkout); set `v0.8.7` at the tag. Lockfiles: `bridge-codec` /
`randprotocol-core` path entries 0.8.0/0.8.2 → 0.8.6, nothing else moved.
- **What set 11 touches here: nothing the bridge computes.** `crates/bridge-codec` and
`randprotocol-core/src/bridge` are byte-identical v0.8.6 → e79070a7; the daemons hash with
blake3/keccak/sha and sign ECDSA + Dilithium2, never Poseidon2. `vectors/attestations.json` and
`vectors/pq-cosignatures.json` regenerate byte for byte; the chain-21 governance vectors stay (a
layout pinned at a real genesis, still true). No guardian or relayer rebuild is needed for set 11.
- **What does move, at the cut** (`daemons/mainnet/cut-chain22.sh`, selftest included):
`chain_id` 21 → 22 and `genesis_hash` chain 21's → chain 22's (`GENESIS_HASH`, an input: it exists
only once the chain is cut), the Rand cursor (`BURN_SEQ`), and the relayer's `rand` → v0.8.7
(`RAND_OLD_SHA` from `status`, `RAND_NEW_SHA` from v0.8.7's signed SHA256SUMS). `bridge-start` of
the fleet script waits for these (`BRIDGE_ON_CHAIN22=yes`). The repo's `mainnet/*.toml` stay on
chain 21 until the cut, as at every earlier cut: they mirror the hosts.
- **Trap — every rand1 address changes under set 11.** `pk = H_PK(nk)` is Poseidon2, so the same
wallet seed has a new address and a new recipient hash on chain 22. A mint to a set-9 address
(a recipient registered before the cut, or a lock naming its hash) seals a note no set-11 wallet
can spend. Settle every lock before the cut and decide what the relayer's `recipients` table holds
on chain 22 (see the PR).

## State as of 2026-10-12 — bridge LIVE on Rand chain 21 (fullnode v0.8.0), cut with `daemons/mainnet/cut-chain21.sh`

- **Rand chain 21** (fullnode **v0.8.0**, tag at `c0878c3f`; genesis
Expand Down Expand Up @@ -192,7 +215,7 @@ read it before touching anything there, it is worked on by many sessions in para
external audit (bridge issue #4).
- **All test suites green**: `cd evm && forge test` (51), `cd solana && cargo test` (41 incl.
solana-program-test), fullnode `cargo test -p randprotocol-core bridge` (50),
`cd tools/vectors && cargo run --release -- --check` (both vector copies byte-identical).
`cd tools/vectors && cargo run --release --bin vectors -- --check` (both vector copies byte-identical).
- **Progress later the same day**: fullnode issue #1 is fixed and closed (fullnode `544926c`:
`check_bridge` now refuses a guardian set whose quorum attestation exceeds
`MAX_ATTESTATION_BYTES` — boundary pinned at 367 accepted / 368 refused — plus the two stale
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ cd solana && cargo test
deploy/trx.sh nile --dry-run

# Shared attestation vectors — regenerate, or verify the two copies match
cd tools/vectors && cargo run --release # regenerate vectors/attestations.json and the fullnode's copy
cd tools/vectors && cargo run --release -- --check # verify the two copies are byte-identical
cd tools/vectors && cargo run --release --bin vectors # regenerate vectors/attestations.json and the fullnode's copy
cd tools/vectors && cargo run --release --bin vectors -- --check # verify the two copies are byte-identical

# Rehearse an EVM deployment against a local node
anvil --port 18545 & ANVIL_RPC_URL=http://127.0.0.1:18545 deploy/evm.sh anvil --yes
Expand Down
2 changes: 1 addition & 1 deletion daemons/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion daemons/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ start_sequence = 0
# what the Dilithium2 co-signature is over, so it is configured, never asked of a node.
# At startup the node at `rpc` must answer and serve this chain, and the stored Rand
# cursor must not be past the chain's burn_sequence (BR-401); otherwise the daemon stops.
# chain_id = 21
# chain_id = 22
# The chain's genesis hash (what `rand_getGenesisHash` serves on it), from the chain's cut
# record — not copied from the node this daemon reads. With chain_id it names the one Rand
# chain this daemon works for (BR-1005): both are checked against every Rand node at startup
# and again on every poll, before a burn is read and before it is handed on to be signed, so
# a node switched to another chain yields nothing to sign. rand-guardian does NOT START
# without both lines; rand-relayer warns. A cut to a new chain changes both.
# TODO(chain-22 cut): chain 22's genesis hash exists only once the chain is cut (fullnode
# deploy/cut-records/chain22.record); daemons/mainnet/cut-chain22.sh takes it as GENESIS_HASH.
# genesis_hash = "<64 hex: the chain's genesis hash>"

# ---- source endpoints ------------------------------------------------------
Expand Down
Loading
Loading