feat: add proofless tx lookup option#23634
Closed
alexghr wants to merge 1 commit into
Closed
Conversation
nventuro
requested changes
May 28, 2026
| } | ||
|
|
||
| private stripProof(tx: Tx): Tx { | ||
| return new Tx(tx.txHash, tx.data, ChonkProof.empty(), tx.contractClassLogFields, tx.publicFunctionCalldata); |
Contributor
There was a problem hiding this comment.
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?
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optionally remove tx proof for faster transfers
Fix A-1113