Repository navigation
ARC-0048: Deployment Freeze by Validator Vote #148
snarkworld
started this conversation in
ARCs
Replies: 2 comments
|
POC in snarkVM: aleo-labs-protocol/snarkVM#3856 |
0 replies
|
ARC-48 text updated (#155) The ARC text has been updated to match the implementation in snarkVM#3856 and snarkOS#4724. These are implementation details only, and the mechanism works the same way: same threshold, freeze limits, delay, and consensus rule.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Pull request: #147
arc: 48
title: Deployment Freeze by Validator Vote
authors: ProvableHQ
discussion: #148
topic: Protocol
status: Draft
created: 2026-11-17
signature_domain: aleo-gov-48-v1
pass_threshold: 66
quorum_threshold: 66
voting_start: 23855000
voting_end: 24157000
snapshot: 24157000
Abstract
This ARC lets validators pause program deployments for a bounded time by an on-chain, stake-weighted vote, without a network upgrade.
deployment_freeze.aleo, records validator votes. The vote that takes support past two thirds of committee stake sets a freeze window.V_F, every deployment (new program, upgrade, or amendment) that reaches a block during a freeze is rejected without being verified, and its fee is charged.Motivation
Today the only way to stop deployments is a new consensus version, a release, and a multi-day upgrade cycle. That is too slow for:
Affine::mul_bits; on off-curve witnesses that synthesis produces, old and new code panic for different inputs, so old and new nodes would disagree on some deployments and fork. It was reverted (#3675) before release. A consensus-version guard for code this deep is very invasive. Instead, validators can freeze deployments, upgrade, and thaw: while both versions are live, nobody verifies a deployment.V21, 2026-10-02) was such a case; later analysis by Provable engineers showed the V2 flaw was not feasibly exploitable, but that was unknown during the rollout.Specification
Parameters
total * 2 / 3 + 1of committee stake (Committee::quorum_threshold)MAX_FREEZE_BLOCKSFREEZE_DELAYVOTE_LIFETIMEMAX_FROZEN_DEPLOYMENTS_PER_BLOCKBlock counts assume ~3 seconds per block.
The freeze program
deployment_freeze.aleois an ordinary Aleo program whose constructor rejects every edition after 0.freeze0u8Freeze { start: u32, end: u32 }start <= height < end. Absent orend = 0means not frozen. The only value consensus reads.votesaddressVote { proposal: field, cast_at: u32 }nonce0u8u64vote_freeze(duration: u32),duration > FREEZE_DELAYend = block.height + min(duration, MAX_FREEZE_BLOCKS). If a passed freeze has not yet ended,startis kept; otherwisestart = block.height + FREEZE_DELAY.vote_thaw()start = 0,end = 0Both functions take the full committee list (
members: [address; 128]plus a count) and passself.callerto finalize, which:self.callerincredits.aleo/committee, then setsvotes[self.caller] = (BHP256(action, duration, nonce), block.height), withduration = 0for a thaw.credits.aleo/metadataand is at most 128; every address is in the committee; addresses cast tofieldare strictly increasing.totalis the sum ofcredits.aleo/delegated[v]over the list.supportsums the same over validators whose vote matches this proposal and is younger thanVOTE_LIFETIME.support >= total * 2 / 3 + 1, applies the action and incrementsnonce.Finalize processes all 128 slots and masks those at index
>= count, because it cannot skip registers after abranch.Properties:
self.caller, notself.signer, so a program a validator happens to sign for cannot cast its vote.credits.aleoat finalize time, which can briefly differ from the committee AleoBFT uses. This is harmless: the result is one committed value that every node reads identically.A proof of concept measured 2,587 finalize commands and 3 mapping writes per function, a cost of about 0.08 credits (76,167 microcredits), and a program size of ~110 kB (deployable from
V14). A committee above 128 would need a new program.Pinning
The program is deployed before the release that activates
V_F, so its name cannot be taken. The release pins the program ID, checksum, and edition 0. If the program on chain does not match atV_F, nodes treat the network as never frozen. The pin ignores the amendment count: an amendment changes only verifying keys, which must still pass the certificate check against the pinned program text, so it cannot change behavior.From block
V_F(gated on the height of the block being built), the program is locked likecredits.aleo:VM::check_transactionrefuses any deployment naming it, andfinalize_deploymentrefuses any amendment to it. No vote can change the program's rules; that requires a new program and a network upgrade.Consensus rule
For a block at height
HwithCONSENSUS_VERSION(H) >= V_F, letF = deployment_freeze.aleo/freeze[0u8]in the committed state after blockH − 1. IfF.start <= H < F.end, everyTransaction::Deployin the block is frozen.A frozen deployment is checked without touching its program, circuits, or keys. It is aborted (as an invalid transaction is today) unless all of the following hold:
MAX_TRANSACTION_SIZE, has a unique ID, and passes the one-deployment-per-fee-payer rule.MAX_FROZEN_DEPLOYMENTS_PER_BLOCKfrozen deployments precede it in the block.Otherwise it is rejected: stored as a
RejectedDeploy, its fee charged in full, andfinalize_deploymentnot run. It counts toward the per-block cap only, not toward per-program rules or synthesis density.Implementation
Against snarkVM
stagingat7e48bc69c:VM::should_abort_transaction(synthesizer/src/vm/finalize.rs:1210), run by builder and checker: return a new "reject frozen" outcome after the per-block rules and before theV16compute-spend check, which would build the stack. Runs every check above except the fee proof and ledger uniqueness.VM::prepare_for_speculate(:1410), builder only: check the fee proof and ledger uniqueness, nevercheck_transaction, soProcess::verify_deploymentnever runs. The checker covers these incheck_transactions, as for anyRejectedDeploy.VM::atomic_speculate_inner(:707): convert frozen deployments to rejected deployments ahead offinalize_deployment.VM::check_speculate(:200): beforecheck_transactions, reject a block that lists a frozen deployment as accepted.Fis read once per block, at the start ofVM::speculateandVM::check_speculate, withFinalizeStore::get_value_confirmed, and passed to every check. So a vote passed in blockhtakes effect fromh + 1, and the order of votes and deployments within a block never matters.Design rationale
max_aborted_transactionsequals block capacity. Aborting would let any validator ignoring node policy fill blocks with free deployments, a denial-of-service vector created by the freeze itself. Rejection is equally safe for rollouts: no node on either release verifies the deployment, and every check that runs is identical across releases. Because a frozen deployment's only compute is a fee check, the block spend limit does not bound them; the per-block cap of 1 does.FREEZE_DELAY. A caught honest deployment loses its whole fee, including the name premium (100,000 credits for a 5-character name). A certificate can stay in the DAG until it fallsMAX_GC_ROUNDS(100) rounds behind the last commit, and each block advances the committed round by at least 2, so 50 blocks after the vote every earlier certificate is committed or dropped. The extra 10 blocks cover nodes that have not yet applied the vote's block.Node policy (snarkOS, not consensus)
From the block after a freeze passes until
end, nodes:check_transaction_basic, and peer-receive paths, returning an error that namesend;Wallets and SDKs should check
GET /{network}/program/deployment_freeze.aleo/mapping/freeze/0u8before deploying. This policy assumes snarkOS checks transactions before admitting or gossiping them (verify-before-gossip and fee-first admission), a prerequisite for this ARC.snarkoscommandstatusshows the freeze, nonce, and support for each open proposal.freezeandthawfetch and sort the committee, then build and broadcast the vote, with the same fee options asdeveloper execute. A single default duration keeps validators' votes matching. Operators should keep a few credits in the validator's public balance for vote fees, since rewards are auto-bonded.Activation
deployment_freeze.aleoand confirm its checksum.V_Fwith the consensus rule, the pin, and thesnarkoscommand.The release must not ship before step 1 is confirmed: from
V_F, the program can never be deployed, and a squatted name never matches the pin. Votes cast beforeV_Ftake effect atV_Fif their window is still open.Usage
Emergency: validators are alerted through the usual upgrade channels, each runs
freeze, renews if needed, and runsthawonce the fix is live. Operators should practice on testnet.Rollout: a consensus-version guard remains the default. A freeze is for changes where a guard is impractical, mainly curve and field code inside the gadgets. The precondition is that no deployment already on chain changes verdict under the new code (via a guard or a census of confirmed deployments). Then validators freeze, upgrade, and thaw once non-upgraded stake is negligible. Release notes requesting a freeze should explain why a guard was not used.
Test Cases
Process::verify_deployment. With a deployment that panics in verification, old and new code build the same block.RejectedDeploys passcheck_speculatewithout verifying the deployment. A block carrying a frozen deployment as accepted fails beforecheck_transactions.Pafter a frozen deployment ofPin the same block is accepted.h − 1toh + 2around a vote in blockh, with a vote and a deployment in the same block in both orders;startandend; a deployment certified before the vote and committed as late as GC allows; renewals that shorten, or that keepstartduring the freeze or its delay; activation atV_F, including a freeze voted earlier and a pin mismatch; and refusal of any deployment of the program from blockV_F.TRANSACTION_SPEND_LIMIT.statusmatches the program's tally.Reference Implementations
A proof of concept of
deployment_freeze.aleoproduced the measurements above. Links to it and to the snarkVM and snarkOS changes will be added.Dependencies
V_F, the consensus rule, and the program pin and lock.deployment-freezecommand, and verify-before-gossip / fee-first admission.Backwards Compatibility
This is a consensus change active from
V_F; validators must upgrade before it as for any consensus version. Frozen deployments use the existingRejectedDeployformat, so no data format changes.Security & Compliance
freeze[0u8]during incidents and re-vote if it changes unexpectedly.snark.verifywith runtime verifying keys, or built-in circuits. It narrows an attacker's options; it is not a fix.Alternatives considered
Open questions
VOTE_LIFETIME. One day spans time zones; shorter limits staleness.V_Fwould stop old nodes relaying frozen deployments, at the cost of disconnecting every non-upgraded node.References
Affine::mul_bitschange and revertAll reactions