Protocol constants and limits
Values read from the code on dev at commit 09ff4d0ca. Check them against your checkout.
| Constant | Value | Where |
|---|---|---|
| Program segments per program | at most 20 | MAX_PROGRAM_SEGMENTS, lee/program_loader/src/lib.rs |
| Bytecode per segment account | 96 KiB, the wallet’s chunk size, not a limit the loader enforces | MAX_SEGMENT_DATA_LEN, same file |
| Execution budget of a public transaction | its 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 left | MAX_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 transaction | padded to 7 | PADDED_PRIVATE_ACTIONS, lez/wallet/src/account_manager.rs |
| Note padding | 512 bytes | CIPHERTEXT_PAD_SIZE, same file |
| Clock | one account; each ReadBlockId or ReadTimestamp names its own granularity | lez/programs/clock/core/src/lib.rs |
| Note encryption | ML-KEM-768 key encapsulation, then ChaCha20 | lee/state_machine/core/src/encryption |
| Private actions per private transaction | at most 8, counting each private account, the collected root message, each claim and each padding dummy | MAX_PRIVATE_ACTIONS, lez/programs/fee/core/src/market.rs |
| Stored messages one transaction collects | one as its root, plus claims queued ahead of it, within the cap above | claims, lee/state_machine/core/src/execution_state.rs |
| Submitted transaction size | at 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 it | MAX_SUBMITTED_LEN, lez/common/src/transaction.rs |
| Boundary steps of a submitted private transaction | at 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 check | MAX_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
| Choice | Effect 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 actions | past seven the wallet pads with nothing and warns: the transaction is built, but its exact count is not hidden |