You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: proofless tx lookup in getTxByHash and getTxsByHash (#23827)
## 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
Copy file name to clipboardExpand all lines: docs/docs-developers/docs/resources/migration_notes.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -959,6 +959,22 @@ The empire slashing model has been removed. Only the tally-based slashing model
959
959
960
960
## Unreleased (v5)
961
961
962
+
### [Aztec Node]`getTxByHash`, `getTxsByHash` and `getPendingTxs` no longer return tx proofs by default
963
+
964
+
`AztecNode.getTxByHash`, `AztecNode.getTxsByHash` and `AztecNode.getPendingTxs` (also exposed on the P2P API) now take an optional `GetTxByHashOptions` argument with an `includeProof` flag. The proof is stripped from returned txs unless `includeProof: true` is passed, cutting roughly 35-52KB per tx over the wire.
**Impact**: Callers that read the proof off returned txs (eg to re-broadcast or validate them) must now pass `{ includeProof: true }` explicitly; by default the returned txs carry an empty proof.
The `returnReceipt` option in deploy wait options has been removed. `DeployMethod.send()` now always returns an object with `contract`, `receipt`, and `instance` at the top level, provided the user waits for the transaction to be included.
0 commit comments