Skip to content

feat: tx effects tree - #25332

Open
IlyasRidhuan wants to merge 2 commits into
nextfrom
ir/tx-effects-tree
Open

feat: tx effects tree#25332
IlyasRidhuan wants to merge 2 commits into
nextfrom
ir/tx-effects-tree

Conversation

@IlyasRidhuan

Copy link
Copy Markdown
Contributor

Adds a tx effects unbalanced tree to the rollup, enabling more efficient proofs of tx effects.

Today, proving "tx X was included in this block and produced effects E" means replaying the whole checkpoint's blob sponge. With this root, it takes a single membership proof against one header field.

Summary

Structured leaf hash

  • Each variable-length field of a TxEffect (note hashes, nullifiers, l2l1 msgs, public data writes, private logs, public logs, contract class logs) is hashed independently over that field's portion of the existing blob encoding.
  • The tx start marker, transaction fee, and the seven field sub-hashes (from above) combine into a tx effect hash;
  • This hash is combined with the tx hash to form the leaf (compute_tx_effect_leaf).

Wiring

  • tx_base emits the leaf as TxRollupPublicInputs.tx_effects_tree_root
  • tx_merge combines children via accumulate_tx_effects_tree_root
  • block_root writes the result into BlockHeader.tx_effects_tree_root.
    Blob encoding refactor.
  • The per-field blob-slice builders (create_public_data_writes_blob_fields, create_private_logs_blob_fields, create_contract_class_logs_blob_fields) are extracted out of tx_blob_data.nr so the same formats are used for the blob encoding and the new per-field hashes

Breaking / versioning

  • BlockHeader and TxRollupPublicInputs both grow by one field (tx_effects_tree_root)
  • Genesis header hash and archive root are recomputed (header serialization changed).
  • ORACLE_VERSION_MAJOR 30 → 31 (noir-contracts and aztec-nr), TXE_ORACLE_VERSION_MAJOR 8 → 9.
  • C++ world_state.cpp adds the matching zero field when hashing the initial (genesis) block header.

Adds a per-block commitment to tx effects: the tx base circuit computes a
leaf binding the tx hash to a structured hash of the tx's effects, tx
merges accumulate leaves pairwise up the (unbalanced, greedily filled)
rollup tree, and the block root writes the root into the new
BlockHeader.tx_effects_tree_root field. The tree shape is a pure function
of the tx count, so a header holder can verify "tx X was included and
produced exactly effects E" with a single membership proof instead of
replaying the checkpoint's sponge blob.

The tx effect hash is structured: each variable-length field is hashed on
its own over its slice of the existing blob encoding (shared slice
builders extracted in tx_blob_data.nr), so proving one field only needs
that field's preimage. Four new domain separators keep field hashes,
effect hashes, leaves and internal nodes mutually incompatible.

The header change shifts the genesis constants and bumps the oracle
interface major version (30 -> 31) and the TXE oracle major version
(8 -> 9); the C++ world state adds the zero field to the initial block
header hash.
@IlyasRidhuan
IlyasRidhuan requested review from iAmMichaelConnor and removed request for LeilaWang and nventuro August 27, 2026 17:00
Rollup Prover.toml sample inputs regenerated from a mock orchestrator run
and the private kernel reset config from the gate-count refresh; both
pick up the new header/tx-rollup field. The private kernel and tx base
sample inputs are carried from the pre-rebase generation: they still
execute, except private-kernel-init-simulated, which embeds
protocol-contract storage reads and needs a regeneration that requires
re-pinning the standard contracts. Drops the pinned mock protocol-circuit
build so the circuits rebuild from source with the new header layout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant