Skip to content

chain-22 cut: reference_block_window and the beacon commitments (stacked on #189) - #190

Merged
dendisuhubdy merged 3 commits into
mainfrom
feat/chain22-beacon-cut
Nov 18, 2026
Merged

dendisuhubdy merged 3 commits into
mainfrom
feat/chain22-beacon-cut

Conversation

@dendisuhubdy

Copy link
Copy Markdown
Member

Gate 5 of the chain-22 cut. Stacked on #189: retarget to main after #189 merges.

Inputs

  • REFERENCE_BLOCK_WINDOW (default 256, 256..=4096; required — the beacon needs it) and BEACON_COMMIT_DELAY_BLOCKS (default 256): both listed as owner values to confirm (OPEN 9, OPEN 10).
  • BEACON_TSV (default ~/.rand-chain22/beacon-commitments.tsv): one <name> <commitment> per validator, joined by name. Refused: missing/extra/duplicate names, non-64-hex or all-zero commitments, duplicate commitments, an address that does not match its public key.

Checks

  • Field probe: 38 variants (window and beacon removed, changed, each of the 26 commitments changed alone). Run through the 0.8.6 binary: every variant moves the hash; removing both fields gives back chain 21's ca76c276….
  • check-limits reads back the window, the delay, rand_getBlockContext and every commitment through rand_getBeacon.
  • New deploy/check-beacon-seed.sh, run on each validator host before its node starts (only the host can see its seed). Tested against real beacon init files: passes the right one, refuses a copied, edited or wrong seed.

Tested

SELFTEST=1 deploy/cut-chain22-genesis.sh: 309 → 403 passed, 0 failed. shellcheck clean on both scripts.

Not exercised

DRY_RUN and the real cut; live rand_getBeacon/rand_getBlockContext (fake node only); the cutover gate (cutover-fleet-chain22.sh does not exist yet); exact checking of commitments that moved above height 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo

Base automatically changed from feat/randomness-beacon to main November 18, 2026 10:20
@dendisuhubdy
dendisuhubdy force-pushed the feat/chain22-beacon-cut branch from fd122fa to d1cbb2c Compare November 18, 2026 10:22
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

dendisuhubdy added a commit that referenced this pull request Nov 18, 2026
…#191)

The RPC bursts slept a fixed 500 ms after the answers and then required the
heap to be back within 16 MiB of the baseline. On a loaded runner the last
copies of a burst are still being dropped then: run 44284862601 (PR #190,
which touches no Rust) left 28 MiB after the 24-submission burst, while the
pull_request run of the same commit passed. Poll every 250 ms until the heap is
within the limit or 15 s pass; the assertion is unchanged, so a leak still fails.


Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
dendisuhubdy and others added 3 commits November 19, 2026 03:42
…ts genesis commitment

Run on each validator host before its node starts on a beacon chain
(PR #189): the node key's address has a commitment in the genesis
beacon section; rand-node beacon commitment re-derives the seed file
and names this key's address and the genesis chain id (a file copied
from another host is refused); a chain in the file has that
commitment; the file is 0600. With --rpc, rand-node beacon status
exits 0 and, at height 0, holds the genesis commitment in force.
Reads commitments only, never prints a seed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
The owner decided on 2026-11-18 that chain 22 launches with EVM block
context (#168 / PR #184) and the randomness beacon (PR #189).

- REFERENCE_BLOCK_WINDOW (default 256, 256..=4096) and
  BEACON_COMMIT_DELAY_BLOCKS (default 256, 1..=2^20): owner values to
  confirm, OPEN 9 and 10.
- BEACON_TSV (name <-> commitment) joined by name with the validators;
  refused unless exactly one 64-lowercase-hex commitment per validator,
  all distinct, none missing, no extras. Addresses are the ones each
  public key derives (rand-node admit sign under a throwaway key); a
  VALIDATORS_TSV / registration address that differs is refused.
- Both sections are spliced (rand-node genesis refuses the window on
  the base file, which has no bridge or perps yet); the real cut
  refuses a build whose genesis --help lacks the two flags, DRY_RUN
  skips both loudly (BLOCK_CONTEXT_SKIPPED).
- Asserted on the finished file; field-probed (38 variants: the window
  with the beacon, the window at another value, the beacon, its delay,
  and each one of the 26 commitments changed); read back by
  check-limits (rand_getLimits.program_state, rand_getBlockContext,
  rand_getBeacon); written to the cut record with the operator seed
  procedure; the record must name both features.
- SELFTEST: 309 -> 403 checks, all passing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
…rator seed procedure

docs/deploy.md: table rows for reference_block_window and the beacon
(OPEN 9 / 10, owner values to confirm), the inputs, what is refused,
the field probe and read-backs, the per-host seed procedure and where
check-beacon-seed.sh runs. AGENTS.md: a chain-22 cut entry; the beacon
and block-context "Not done" lists no longer name the cut script.
CHANGELOG: an Unreleased deploy line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNLS2uLR7w6m2JtejVo
@dendisuhubdy
dendisuhubdy force-pushed the feat/chain22-beacon-cut branch from d1cbb2c to 5d88bb7 Compare November 18, 2026 19:43
@dendisuhubdy
dendisuhubdy merged commit a148e9c into main Nov 18, 2026
23 checks passed
@dendisuhubdy
dendisuhubdy deleted the feat/chain22-beacon-cut branch November 18, 2026 20:40
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