Skip to content

feat: merge-train/spartan-v5#23885

Merged
AztecBot merged 3 commits into
v5-nextfrom
merge-train/spartan-v5
Jun 5, 2026
Merged

feat: merge-train/spartan-v5#23885
AztecBot merged 3 commits into
v5-nextfrom
merge-train/spartan-v5

Conversation

@AztecBot

@AztecBot AztecBot commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
feat!: proofless tx lookup in getTxByHash and getTxsByHash (#23827)
END_COMMIT_OVERRIDE

## 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

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot

AztecBot commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot AztecBot added this pull request to the merge queue Jun 5, 2026
@AztecBot

AztecBot commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/e1b486ddf5d39638�e1b486ddf5d396388;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_slashing/attested_invalid_proposal.test.ts (370s) (code: 0)

Merged via the queue into v5-next with commit 426a675 Jun 5, 2026
14 checks passed
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