Skip to content

MIP-009: Increase zkApp account update limit (verifier-only) #2183

@richardpringle

Description

@richardpringle

Summary

MIP-009
triples the zkApp account update limit by replacing the old weighted
cost formula with a simpler segment-count rule. This is a hard fork
change. As a verifier-only node, we must accept and validate
transactions/blocks that use the new higher limits.

Background

  • MIP: MIP-009
  • Status: Finalization (last call deadline 2025-10-29)
  • Author: Yihang Liu (o1labs)
  • OCaml PR: MIP Ref Impl: Increase zkApp account update limit MinaProtocol/mina#17386
  • OCaml reference:
    src/lib/node_config/unconfigurable_constants/node_config_unconfigurable_constants.ml
  • Old formula: 10.26*np + 10.08*n2 + 9.14*n1 < 69.45
  • New formula: np + n2 + n1 <= 16
  • Where np = proof segments, n2 = signed pair segments,
    n1 = signed single segments
  • Max per transaction: 31 signed/no-auth updates (16 paired
    segments) or 15 proof updates + 1 fee payer segment
  • Prerequisite: SNARK worker proof-level parallelization from
    the slot reduction MIP

Files requiring changes

1. Cost constants

  • crates/ledger/src/scan_state.rs (lines 14-39)
    • GenesisConstant struct and GENESIS_CONSTANT values
    • zkapp_proof_update_cost: 10.26 -> 1.0
    • zkapp_signed_single_update_cost: 9.14 -> 1.0
    • zkapp_signed_pair_update_cost: 10.08 -> 1.0
    • zkapp_transaction_cost_limit: 69.45 -> 16.0
    • Alternatively, simplify the formula entirely to use integer
      comparison and remove the float fields

2. Cost comparison operator

  • crates/ledger/src/scan_state/transaction_logic/zkapp_command.rs
    (line 2846)
    • Change Self::zkapp_cost(...) < cost_limit to
      Self::zkapp_cost(...) <= cost_limit
    • The MIP specifies <= (inclusive), the old code uses <
      (strict). This is the difference between allowing exactly
      16 segments vs only 15.
    • The zkapp_cost() function (line 2778) and valid_size()
      (line 2799) both consume GENESIS_CONSTANT; updating the
      constants + operator is sufficient

3. Test data

  • tools/testing/data/daemon.json (lines 4-7)
    • Update cost values to match the new constants

Verification path

The valid_size() method (zkapp_command.rs:2799) is used in both
verification paths:

  1. Transaction pool prevalidation --
    transaction_pool.rs:2108 calls check_well_formedness()
    which calls valid_size()
  2. Block application -- staged_ledger.rs:1271 calls
    check_commands() during apply(), verifying transactions
    in incoming blocks

Not required for verifier-only

  • Block production / diff creation (staged_ledger/resources.rs)
  • Scan state capacity (transaction_capacity_log_2: 7 = 128 base
    jobs, already sufficient)
  • zkapp_cmd_limit_hardcap: 128 (already accommodates new limit)
  • SNARK verification pipeline (handles any valid proof tree)
  • Consensus rules (unchanged by this MIP)

Scope

Minimal change: update 4 constants in one file, change one
comparison operator in another, and update test data. Optionally
simplify by replacing the float-based cost formula with a direct
integer segment count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions