Skip to content

feat: add proofless tx lookup option#23634

Closed
alexghr wants to merge 1 commit into
merge-train/spartanfrom
stack/feat-add-proofless-tx-lookup-option
Closed

feat: add proofless tx lookup option#23634
alexghr wants to merge 1 commit into
merge-train/spartanfrom
stack/feat-add-proofless-tx-lookup-option

Conversation

@alexghr

@alexghr alexghr commented May 28, 2026

Copy link
Copy Markdown
Contributor

Optionally remove tx proof for faster transfers

Fix A-1113

@alexghr alexghr requested a review from spalladino May 28, 2026 17:31
@alexghr alexghr enabled auto-merge (squash) May 28, 2026 17:31
@alexghr alexghr requested a review from nventuro May 28, 2026 17:31
}

private stripProof(tx: Tx): Tx {
return new Tx(tx.txHash, tx.data, ChonkProof.empty(), tx.contractClassLogFields, tx.publicFunctionCalldata);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is enough:

export const CHONK_PROOF_LENGTH = 1349;
class ChonkProof {
  static empty() {
    return new ChonkProof(new Array(CHONK_PROOF_LENGTH).fill(Fr.ZERO));
  }
}

We could make the proof in Tx be optional instead?

@alexghr alexghr closed this Jun 3, 2026
auto-merge was automatically disabled June 3, 2026 08:23

Pull request was closed

spalladino added a commit that referenced this pull request Jun 4, 2026
## Motivation

`AztecNode.getTxByHash`, `getTxsByHash` and `getPendingTxs` always
shipped the full chonk proof (~35-52KB per tx), which most callers
(explorers, wallets polling pending txs) never use. This change makes
proofs opt-in to cut wire transfer. Supersedes #23634, which stripped
the proof only after loading the full tx from the DB.

## Approach

The tx pool stores proofs in a separate KV map from the tx data, so a
proofless lookup never loads the proof from storage at all (the previous
attempt loaded and discarded it). The node API getters take an optional
`GetTxByHashOptions` with an `includeProof` flag that defaults to false
and is threaded down through the p2p client to the pool; pool-internal
callers default to full txs since reqresp serving and tx collection need
proofs. Internal reads that never need proofs (block-building iterators,
fee queries) explicitly skip them. The p2p store schema version is
bumped to 3 to drop old single-blob pools (the mempool repopulates via
gossip).

## Changes

- **stdlib**: `GetTxByHashOptions` type + schema on
`getTxByHash`/`getTxsByHash`/`getPendingTxs` (node and p2p APIs), a
`Tx.withoutProof` helper, and a `Tx.fromBuffers` factory that
deserializes a tx and its separately-stored proof in one pass.
- **p2p**: `TxPoolV2Impl` splits tx data and proof into separate maps
(`txs` / `tx_proofs`), written and deleted in lockstep;
`getTxByHash`/`getTxsByHash` take `includeProof` (pool default:
include); a missing proof entry logs a structured warning since it
breaks the blob/proof invariant; soft-delete resurrection reattaches the
proof before rewriting; store schema version bumped to 3.
- **p2p (tx collection)**: the node RPC tx source requests txs with
`includeProof: true` since collected txs feed block validation and
proving.
- **sequencer-client**: block-building iterators skip proofs —
conditionally in the checkpoint proposal job (`publishTxsWithProposals`
attaches the same tx objects to gossiped proposals) and always in
automine. Block-building validators exclude the proof validator, so this
is safe.
- **aztec-node**: getters forward the flag (public default: exclude);
`getTxsByHash` uses the batched pool lookup; `getMaxPriorityFees` reads
proofless; the `getTxReceipt` pending path passes the flag to the pool
instead of loading the full tx and stripping after the fact.
- **tests**: pool proof-storage suite (default round-trip, proofless
reads, separate keys, hard-delete cleanup, resurrection preserves
proof), node and p2p API schema round-trips, receipt pending-tx
assertions, `Tx.fromBuffers` round-trip.
- **docs**: migration note under v5 for the new proofless defaults.

Fixes A-1113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants