Skip to content

feat!: proofless tx lookup in getTxByHash and getTxsByHash#23827

Merged
spalladino merged 9 commits into
merge-train/spartan-v5from
spl/a-1113-proofless-tx-lookup
Jun 4, 2026
Merged

feat!: proofless tx lookup in getTxByHash and getTxsByHash#23827
spalladino merged 9 commits into
merge-train/spartan-v5from
spl/a-1113-proofless-tx-lookup

Conversation

@spalladino

@spalladino spalladino commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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

@spalladino spalladino force-pushed the spl/a-1113-proofless-tx-lookup branch from 18f42bd to 1034f8a Compare June 3, 2026 19:37
@spalladino spalladino requested a review from LeilaWang as a code owner June 3, 2026 19:37
@spalladino spalladino changed the base branch from merge-train/spartan to merge-train/spartan-v5 June 3, 2026 19:37
@spalladino spalladino force-pushed the spl/a-1113-proofless-tx-lookup branch from 1034f8a to 3bd6a06 Compare June 4, 2026 13:11
@ludamad ludamad force-pushed the merge-train/spartan-v5 branch from 9ef51dc to b82384a Compare June 4, 2026 16:02
@ludamad ludamad requested review from a team and charlielye as code owners June 4, 2026 16:02
AztecNode.getTxByHash and getTxsByHash take an optional GetTxByHashOptions
argument with an includeProof flag, matching GetTxReceiptOptions semantics:
proofs are stripped unless includeProof is true, cutting ~35-52KB per tx
over the wire.

The tx pool now stores proofs in a separate map from the tx data, so a
proofless lookup never loads the proof from the DB at all. The p2p store
schema version is bumped to 3 to drop old single-blob pools.

Fix A-1113
… them

The pending-tx iterators on the p2p client take an includeProof option.
Block building in the checkpoint proposal job skips proofs unless
publishTxsWithProposals attaches the same tx objects to broadcasted
proposals, automine always skips them since it publishes straight to L1,
and getMaxPriorityFees only reads gas settings off the first pending tx.
Use the p2p client's getTxsByHashFromPool instead of issuing one
getTxByHash call per hash.
…ce test

Review feedback: a missing tx_proofs entry breaks the blob/proof invariant
(addTx always writes one, even for empty proofs), so flag it with a
structured warning instead of silently returning a proofless tx. Also pin
that NodeRpcTxSource requests proofs explicitly, since collected txs feed
block validation and proving.
…omBuffers

Replace the parse-then-rebuild pattern (Tx.fromBuffer followed by
withProof creating a second Tx) with a Tx.fromBuffers factory that takes
the separately-stored tx and proof buffers and constructs the tx once.
Removes the now-unused Tx.withProof helper.
Review feedback: getPendingTxs was the remaining bulk endpoint still
loading and returning proofs for every pending tx. It now takes the same
GetTxByHashOptions argument as the other tx getters on both the node and
p2p RPC APIs, with proofs opt-in via includeProof.
The GetTxReceiptOptions API does not exist on the v5 train.
@spalladino spalladino force-pushed the spl/a-1113-proofless-tx-lookup branch from 3bd6a06 to f0e7e80 Compare June 4, 2026 18:05
The v5 base bumped the noir submodule to v1.0.0-beta.22 without
regenerating the lockfile, leaving the noir-* portal deps pinned at
beta.21. This fails 'yarn install --immutable' in CI.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​aztec/​noir-noir_js@​1.0.0-beta.21 ⏵ 1.0.0-beta.22100100100100100

View full report

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.

2 participants