Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Protocol constants and limits

Values read from the code on dev at commit 09ff4d0ca. Check them against your checkout.

ConstantValueWhere
Program segments per programat most 20MAX_PROGRAM_SEGMENTS, lee/program_loader/src/lib.rs
Bytecode per segment account96 KiB, the wallet’s chunk size, not a limit the loader enforcesMAX_SEGMENT_DATA_LEN, same file
Execution budget of a public transactionits declared gas_limit, at most 10M cycles. The same 10M caps a whole block: the sequencer adds a transaction only while its declared gas_limit fits in what the gas charged to the block’s earlier transactions leftMAX_GAS_EXEC, lez/programs/fee/core/src/market.rs
Default public cycle budget in LEE, used on execution paths that carry no transaction budget (the private dry-run simulator among them)32M cycles (32 × 2^20)DEFAULT_PUBLIC_CYCLE_BUDGET, lee/state_machine/src/program/mod.rs
Private actions per wallet-built private transactionpadded to 7PADDED_PRIVATE_ACTIONS, lez/wallet/src/account_manager.rs
Note padding512 bytesCIPHERTEXT_PAD_SIZE, same file
Clockone account; each ReadBlockId or ReadTimestamp names its own granularitylez/programs/clock/core/src/lib.rs
Note encryptionML-KEM-768 key encapsulation, then ChaCha20lee/state_machine/core/src/encryption
Private actions per private transactionat most 8, counting each private account, the collected root message, each claim and each padding dummyMAX_PRIVATE_ACTIONS, lez/programs/fee/core/src/market.rs
Stored messages one transaction collectsone as its root, plus claims queued ahead of it, within the cap aboveclaims, lee/state_machine/core/src/execution_state.rs
Submitted transaction sizeat most 1,835,008 bytes as estimated from the base64 length, the largest max_block_size any chain can set; the sequencer’s RPC refuses a larger submission before decoding itMAX_SUBMITTED_LEN, lez/common/src/transaction.rs
Boundary steps of a submitted private transactionat most 1024 in its boundary and in its fee fallback’s; the sequencer’s RPC and gossip validation refuse a longer one, while transactions inside blocks are decoded without this checkMAX_BOUNDARY_STEPS, lee/state_machine/src/encoding/privacy_preserving_transaction.rs

Limits that are missing

No constant caps these two, though both may change:

  • The size of an actor’s state.
  • The number of messages one transaction may send. Execution is bounded by the cycle budget, not by a count; the only count is the submission check on a private transaction’s boundary steps above, which bounds only the messages crossing between private and public execution.

Design as if both were capped: keep state small and bounded, and keep conversations short.

Interim choices

ChoiceEffect on a design
The wallet claims only pending native credits, at most four per send and only in the slots of the seven its private accounts and received root leave (MAX_SWEPT_CLAIMS, lez/wallet/src/lib.rs)a proof clears up to five credits; any other stored message costs a proof of its own
Padding to seven private actionspast seven the wallet pads with nothing and warns: the transaction is built, but its exact count is not hidden