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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ stopped at v0.4 until 2026-09-30, when the entries v0.5 to v0.6.7 were written f

Nothing yet.

## v0.8.7 — PLACEHOLDER-TAG-DATE (chain 22, **a chain cut**: constraint set 11; a set-11 node refuses every chain 14–21 genesis, so this release is never rolled onto chain 21)
## v0.8.8 — 2026-11-22 (chain 22, **fork at block 140 000**: open validator mint; same genesis, rolled host by host before the height)

- **Chain 22: open validator mint, height-activated** (v0.8.8 draft, [`docs/releases/v0.8.8.md`](docs/releases/v0.8.8.md)). This is a consensus rule change on the live chain and needs a flag-day roll. From `staking::CHAIN_22_OPEN_MINT_HEIGHT`, a faucet `Mint` is no longer held to `staking.faucet_recipients` or `staking.faucet_minters`. Any registered validator mints to anyone, under the same 100-RAND cap and 10 000-RAND epoch budget. The genesis does not change. The fork height is chain 22 block **140 000**.

## v0.8.7 — 2026-11-20 (chain 22, **a chain cut**: constraint set 11; a set-11 node refuses every chain 14–21 genesis, so this release is never rolled onto chain 21)

The release notes — the set-11 gas change as a governance record, the chain-22 cut, the operator
upgrade steps and the rollback — are [`docs/releases/v0.8.7.md`](docs/releases/v0.8.7.md).
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = ["crates/randprotocol-core", "crates/randprotocol-zkvm", "crates/randp
exclude = ["vendor/circuits/evm-core", "vendor/circuits/sbpf-core", "vendor/circuits/dilithium-core"]

[workspace.package]
version = "0.8.7"
version = "0.8.8"
edition = "2021"
license = "GPL-3.0-only"
authors = ["RandProtocol Contributors"]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ a time.
| v0.7.0 | node-only: the audit v7 addendum (bounded by-hash deferral, header pages capped by reply size, a prover timeout, the wallet's resumable first sync hardened) and the last audit v6 rows (a clean-clone build, an incremental token root, the key-separation schedule); the first workflow-built, signed release | 20 |
| v0.8.0 | chain 21's cut build: constraint set 9 (rVM phase 4's Merkle spans, the MODQ chip), tree aggregation, scan heads, compact blocks, the `fees` section, RPL-3 perps, public and private multisig | 21 |
| v0.8.2 | node-only on chain 21: the audit v10 node, perps and prover-pool fixes (the prover memory gate, the two-member pool pin, threshold release signatures); its consensus rules are genesis-gated to the next cut | 21 |
| v0.8.8 | chain 22 open validator mint from block 140 000: any registered validator mints to any address, same cap and budget; a height-activated rule on the running chain ([release notes](docs/releases/v0.8.8.md)) | 22 |
| v0.8.7 | chain 22's cut build: constraint set 11 (Grain Poseidon2 constants, declared poseidon2 height, rate-¼ quotient layout, versioned rVM keys, cell-count gas: bundle 22 527, auth 1 407, msauth 355 775), EVM block context and the randomness beacon, pinned perps state-proof keys, the 5-of-6 treasury; refuses chains 14–21 ([release notes](docs/releases/v0.8.7.md)) | 22 |

## v0.5: RPL, zUSD and bridge hardening
Expand Down
4 changes: 4 additions & 0 deletions crates/randprotocol-core/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,10 @@ impl Genesis {
// BIND-1: the binding domain carries the same hash, for the same reason set here; like the
// signing domain it is not state.
ledger.set_binding_domain(crate::types::BindingDomain::for_version(self.binding_domain.unwrap_or(0), block.hash()));
// A height-activated rule on a running chain (chain 22's open mint) is keyed by the
// genesis hash, so it too can only be set once the block exists. Not state, not in the
// file and not in the hash: the root and the hash above are unaffected.
ledger.set_open_mint_from(crate::ledger::staking::open_mint_activation(&block.hash().to_hex()));
Ok(GenesisState {
chain_id: self.chain_id,
faucet: self.faucet,
Expand Down
39 changes: 36 additions & 3 deletions crates/randprotocol-core/src/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ pub enum TxError {
FaucetBudgetExhausted { budget: u64, minted: u64 },
/// Chain 15's faucet allowlist (`staking.faucet_recipients`): the mint's note is for a spend
/// key the genesis does not list. The list is a genesis constant and `pk` is the mint's own
/// bytes, so this one is permanent.
/// bytes, but the list binds only below the chain's open-mint height (`Ledger::open_mint`,
/// chain 22), so the verdict depends on the height and is not a permanent one.
#[error("the faucet may not mint to this recipient (not in staking.faucet_recipients)")]
FaucetRecipientNotAllowed,
#[error("confidential computation is disabled on this chain")]
Expand Down Expand Up @@ -810,6 +811,13 @@ pub struct Ledger {
/// outside the state root and equality, restored by `reload_ledger`; `false` on chain 21 and
/// every chain cut before the field.
refuse_panicked_invokes: bool,
/// The open-mint activation height (`staking::OPEN_MINT_ACTIVATIONS`, chain 22): from this
/// height on a faucet `Mint` is no longer held to `staking.faucet_recipients` or
/// `staking.faucet_minters` ([`Ledger::open_mint`]). Not from the genesis file but from this
/// build's table keyed by the genesis hash, set by `Genesis::build` and restored by
/// `reload_ledger`; outside the state root and equality like `refuse_panicked_invokes`.
/// `None` on every other chain.
open_mint_from: Option<u64>,
/// Issue #168: genesis `program_state.reference_block_window` — how many closed blocks an
/// `InvokeAt` may name as its reference block; 0, chain 21 and every chain cut before the
/// field, is off. A parameter like `refuse_panicked_invokes`: outside the state root and
Expand Down Expand Up @@ -1003,6 +1011,7 @@ impl Ledger {
hc_auth_multisig: None,
testnet: false,
refuse_panicked_invokes: false,
open_mint_from: None,
reference_block_window: 0,
block_facts: VecDeque::new(),
proof_window_blocks: None,
Expand Down Expand Up @@ -1080,6 +1089,7 @@ impl Ledger {
hc_auth_multisig: None,
testnet: false,
refuse_panicked_invokes: false,
open_mint_from: None,
reference_block_window: 0,
block_facts: VecDeque::new(),
proof_window_blocks: None,
Expand Down Expand Up @@ -1948,6 +1958,26 @@ impl Ledger {
self.refuse_panicked_invokes = on;
}

/// The open-mint activation height this ledger runs with (`staking::OPEN_MINT_ACTIVATIONS`),
/// `None` on a chain without one.
pub fn open_mint_from(&self) -> Option<u64> {
self.open_mint_from
}

/// Set by `Genesis::build` from `staking::open_mint_activation` of the genesis hash, and by
/// `reload_ledger` on every restart.
pub fn set_open_mint_from(&mut self, height: Option<u64>) {
self.open_mint_from = height;
}

/// Whether the block being applied (`height`) is at or past the open-mint activation height:
/// a faucet `Mint` then needs neither `staking.faucet_recipients` nor `staking.faucet_minters`
/// — only the faucet switch, the per-mint cap, the epoch budget, a register row, the
/// signature and the value rule. `false` on every chain without an activation.
pub fn open_mint(&self) -> bool {
self.open_mint_from.is_some_and(|h| self.height >= h)
}

/// Issue #168: genesis `program_state.reference_block_window`; 0 is off.
pub fn reference_block_window(&self) -> u64 {
self.reference_block_window
Expand Down Expand Up @@ -2868,7 +2898,8 @@ impl Ledger {
}
// The allowlist (chain 15): the published opening's `pk` is the note's owner —
// the value rule below ties `cm` to it — so a key off the list gets nothing.
if let Some(list) = &s.faucet_recipients {
// Lifted from the chain's open-mint height on (`open_mint`, chain 22).
if let Some(list) = s.faucet_recipients.as_ref().filter(|_| !self.open_mint()) {
if !list.iter().any(|r| r.0 == *pk) {
return Err(TxError::FaucetRecipientNotAllowed);
}
Expand All @@ -2882,7 +2913,9 @@ impl Ledger {
// enough — a permissionless `Bond` writes one, and the key is active two epochs
// later — so the minter must be on the genesis list. Before the signature, like
// the row check. Chain 15 has no list and runs on the node's admission policy.
if let Some(list) = self.staking.as_ref().and_then(|s| s.faucet_minters.as_ref()) {
// Lifted from the chain's open-mint height on (`open_mint`, chain 22): any key
// with a register row mints — and `admission_by_vote` decides who gets one.
if let Some(list) = self.staking.as_ref().and_then(|s| s.faucet_minters.as_ref()).filter(|_| !self.open_mint()) {
if !list.iter().any(|m| m.0 == addr) {
return Err(TxError::MinterNotAllowed(addr));
}
Expand Down
141 changes: 141 additions & 0 deletions crates/randprotocol-core/src/ledger/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,34 @@ pub struct ValidatorEntry {
pub activation_epoch: u64,
}

/// Chain 22's open-mint activation height: **block 140 000** (set 2026-11-22 for v0.8.8, owner's
/// decision; tip 73 774 at 02:54Z, ~0.866 blocks/s, so expected ~2026-11-23 00:08Z).
///
/// From this height on, both faucet allow-lists are lifted for chain 22's genesis hash. Every
/// host must run v0.8.8 before the chain reaches it: a node still on v0.8.7 at `H` refuses the
/// first unlisted mint its peers apply, and forks off. Before `H` both builds agree on every block,
/// so the roll goes one host at a time.
pub const CHAIN_22_OPEN_MINT_HEIGHT: u64 = 140_000;

/// Height-activated rule changes on running chains, by genesis hash (hex): `(chain id, genesis
/// hash, height)`. From `height` on — the block at `height` included — a faucet `Mint` is no
/// longer held to `staking.faucet_recipients` or `staking.faucet_minters`
/// ([`Ledger::open_mint`]); see [`StakingConfig`].
///
/// Keyed by the genesis hash rather than the chain id, so a devnet or test chain that reuses id 22
/// is not affected. Set on the ledger by `Genesis::build` once the genesis hash exists, and
/// restored by the node's `reload_ledger` on every restart, like every other genesis parameter.
/// Not consensus state: outside the state root and the ledger's equality — but a consensus rule,
/// so every validator must run a build with the same row before the height arrives.
pub const OPEN_MINT_ACTIVATIONS: [(u64, &str, u64); 1] =
[(22, "29d67542941f2eb6f2c1bb68c759926f5d814c9e2c7a934292806a2d98b7e9c0", CHAIN_22_OPEN_MINT_HEIGHT)];

/// The open-mint activation height of the chain whose genesis hash is `genesis_hex`, if any
/// ([`OPEN_MINT_ACTIVATIONS`]).
pub fn open_mint_activation(genesis_hex: &str) -> Option<u64> {
OPEN_MINT_ACTIVATIONS.iter().find(|(_, h, _)| *h == genesis_hex).map(|(_, _, height)| *height)
}

/// The `staking` genesis section (audit v4, STAKE-2): a per-epoch budget for the testnet faucet
/// and an activation delay for bonds. Present only on a chain whose genesis carries it — the
/// three rules it switches on are gated on `Ledger::staking()` being `Some`, so chain 14, which
Expand Down Expand Up @@ -138,6 +166,14 @@ pub struct ValidatorEntry {
/// or duplicated list is refused; absent, the register row is the rule and every node's
/// admission policy admits the genesis validators only.
///
/// Both lists are lifted, on a running chain, from the height [`OPEN_MINT_ACTIVATIONS`] names for
/// its genesis hash (chain 22, the owner's decision of 2026-11-22: any key that runs a validator
/// may mint RAND for any recipient). From that height on neither list is read; the faucet switch,
/// [`crate::ledger::FAUCET_MAX_UNITS`], the epoch budget, the register row
/// (`TxError::MinterNotValidator`), the signature and the value rule all still hold, and
/// `admission_by_vote` still decides who gets a register row. Below it the lists hold exactly as
/// before. The genesis file and hash are untouched — the height is a property of this build.
///
/// And audit v6's (STAKE-2), each absent from every genesis through chain 18, omitted from the file
/// when absent and committed to the genesis hash under its own tag, after every tag that existed
/// before it, only when set:
Expand Down Expand Up @@ -2230,6 +2266,111 @@ mod tests {
assert_eq!(listed_stranger.validate(&attack, &StubExecutor), Ok(()));
}

/// Chain 22's open mint (`OPEN_MINT_ACTIVATIONS`). Below the activation height both genesis
/// lists hold exactly as before — an unlisted recipient is `FaucetRecipientNotAllowed`, a
/// bonded but unlisted minter `MinterNotAllowed`, at admission and at apply, the ledger
/// untouched. From the height on (the block at it included) a registered validator mints to
/// anyone, while a key with no register row is still `MinterNotValidator`, and the faucet
/// switch, the per-mint cap and the epoch budget all still bind. A ledger with no activation
/// (every other chain) keeps the lists at every height.
#[test]
fn from_the_open_mint_height_neither_faucet_list_binds_and_every_other_rule_still_does() {
use crate::ledger::FAUCET_MAX_UNITS;
const H: u64 = 50;
let genesis = key(1);
let bonder = key(9);
let stranger = key(10);
let budget = 3 * FAUCET_MAX_UNITS;
let cfg = StakingConfig {
faucet_budget_per_epoch: budget,
bond_activation_epochs: 2,
faucet_recipients: Some(vec![FaucetRecipient([5; 8])]),
faucet_minters: Some(vec![FaucetMinter(genesis.address())]),
..Default::default()
};
let mint = |l: &Ledger, k: &Keypair, pk: u32, r: u32, amount: u64| {
Transaction::mint(CHAIN, [pk; 8], l.height() as u32, [r; 8], env(), amount, k, &StubExecutor)
};
let mut base = sectioned(vec![entry(&genesis, MIN_STAKE, payout(1))], cfg);
base.set_faucet(true);
let t = bond_tx(&base, 40, &bonder, MIN_STAKE, Some(registration(&bonder, payout(9))));
base.apply_tx(&t, &genesis.address(), &StubExecutor).unwrap();
assert!(base.validators().contains_key(&bonder.address()), "the bonder has a register row");
assert_eq!(base.open_mint_from(), None, "no activation unless one is set");

let mut scheduled = base.clone();
scheduled.set_open_mint_from(Some(H));

// Below the height — and at every height without an activation — the old rules, exactly.
for (mut l, height) in [(scheduled.clone(), H - 1), (base.clone(), H - 1), (base.clone(), H), (base.clone(), H + 1_000)] {
l.set_height(height);
assert!(!l.open_mint());
let unlisted_recipient = mint(&l, &genesis, 9, 100, FAUCET_MAX_UNITS);
assert_eq!(l.validate(&unlisted_recipient, &StubExecutor), Err(TxError::FaucetRecipientNotAllowed));
let before = l.clone();
assert_eq!(l.apply_tx(&unlisted_recipient, &genesis.address(), &StubExecutor), Err(TxError::FaucetRecipientNotAllowed));
assert_eq!(l, before, "a refused mint leaves the ledger untouched");
let unlisted_minter = mint(&l, &bonder, 5, 101, FAUCET_MAX_UNITS);
let refusal = TxError::MinterNotAllowed(bonder.address());
assert_eq!(l.validate(&unlisted_minter, &StubExecutor), Err(refusal.clone()));
assert_eq!(l.apply_tx(&unlisted_minter, &genesis.address(), &StubExecutor), Err(refusal));
assert_eq!(l, before);
assert_eq!(
l.validate(&mint(&l, &stranger, 5, 102, 1), &StubExecutor),
Err(TxError::MinterNotValidator(stranger.address()))
);
// Both listed: admitted, as before.
l.apply_tx(&mint(&l, &genesis, 5, 103, FAUCET_MAX_UNITS), &genesis.address(), &StubExecutor).unwrap();
}

// At the height: a registered validator off the minter list mints to a key off the
// recipient list.
let mut l = scheduled.clone();
l.set_height(H);
assert!(l.open_mint());
let open = mint(&l, &bonder, 9, 200, FAUCET_MAX_UNITS);
assert_eq!(l.validate(&open, &StubExecutor), Ok(()));
l.apply_tx(&open, &genesis.address(), &StubExecutor).unwrap();
// A key with no register row is still no minter.
assert_eq!(
l.validate(&mint(&l, &stranger, 9, 201, 1), &StubExecutor),
Err(TxError::MinterNotValidator(stranger.address()))
);
// The per-mint cap still binds.
assert!(matches!(
l.validate(&mint(&l, &bonder, 9, 202, FAUCET_MAX_UNITS + 1), &StubExecutor),
Err(TxError::MintTooLarge { cap: FAUCET_MAX_UNITS, .. })
));
// And the epoch budget: two more full mints fill it, the next unit is refused.
l.set_height(H + 1);
assert!(l.open_mint(), "and every height after it");
l.apply_tx(&mint(&l, &genesis, 11, 203, FAUCET_MAX_UNITS), &genesis.address(), &StubExecutor).unwrap();
l.apply_tx(&mint(&l, &bonder, 12, 204, FAUCET_MAX_UNITS), &genesis.address(), &StubExecutor).unwrap();
assert_eq!(l.faucet_epoch_counters(), (H / 10, budget));
assert!(matches!(
l.validate(&mint(&l, &bonder, 13, 205, 1), &StubExecutor),
Err(TxError::FaucetBudgetExhausted { minted, .. }) if minted == budget
));
// And the faucet switch.
l.set_height(H + 10);
l.set_faucet(false);
assert_eq!(l.validate(&mint(&l, &bonder, 14, 206, 1), &StubExecutor), Err(TxError::FaucetDisabled));
}

/// The activation table: chain 22's row names chain 22's genesis hash (the one
/// `deploy/genesis-chain22.json` hashes to — held there by the node's `constraint_set` tests),
/// and nothing else is activated.
#[test]
fn the_open_mint_table_names_chain_22_only() {
assert_eq!(
open_mint_activation("29d67542941f2eb6f2c1bb68c759926f5d814c9e2c7a934292806a2d98b7e9c0"),
Some(CHAIN_22_OPEN_MINT_HEIGHT)
);
assert_eq!(open_mint_activation("ca76c2766ed6090ac6ba5dad86b724dd5d2b80c0edfaed287cd8b129e663ca9a"), None, "chain 21");
assert_eq!(open_mint_activation(&crate::Hash::ZERO.to_hex()), None);
assert_eq!(OPEN_MINT_ACTIVATIONS.len(), 1);
}

/// A ledger at height 1 of ten-block epochs under a `staking` section, holding `entries`.
fn sectioned(entries: Vec<ValidatorEntry>, cfg: StakingConfig) -> Ledger {
let mut l = Ledger::new(CHAIN, HC, register(entries), &StubExecutor);
Expand Down
Loading
Loading