fix(p2p)!: fix BLOCK_TXS response under proposer equivocation#23786
Open
fcarreiro wants to merge 1 commit into
Open
fix(p2p)!: fix BLOCK_TXS response under proposer equivocation#23786fcarreiro wants to merge 1 commit into
fcarreiro wants to merge 1 commit into
Conversation
spalladino
approved these changes
Jun 2, 2026
Comment on lines
73
to
+74
| const responseTxs = (await txPool.getTxsByHash(requestedTxsHashes)).filter(tx => !!tx); | ||
| const response = new BlockTxsResponse(new TxArray(...responseTxs), responseBitVector); | ||
| const response = new BlockTxsResponse(new TxArray(...responseTxs), availableIndicesBitVector); |
Contributor
There was a problem hiding this comment.
Shouldn't we check if requestedTxHashes is non-empty before this, and if it is, return NOT_FOUND?
Base automatically changed from
fc/fix-block-txs-validation
to
merge-train/spartan
June 2, 2026 01:56
12c4d5c to
c8f703b
Compare
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.
Summary
Fixes A-1070: a malicious proposer who sends two different proposals with the same archive root but different tx sets could make two honest nodes fail the
BLOCK_TXSexchange and penalize each other.In the
BLOCK_TXSprotocol the requester asks for txs by their index within a block (proposal), identified only by its archive root. If an equivocating proposer gives node A and node B two proposals that share an archive root but differ in their tx list, then:[i, j, …]of "the block with this archive root".validateRequestedBlockTxsConsistencyrejects the response and penalizes B — an honest node punished for honest behavior.Fix
The request now carries a commitment to the full set of block tx hashes (
blockTxHashesCommitment, a SHA-256 over the serialized tx hashes) alongside the archive root. The responder only serves txs by index (and advertises availability via the bitvector) when its own block's tx-hash commitment matches the request's. Otherwise it treats the request as "I don't have that block" — returning an empty bitvector and only servicing any explicitly-requested tx hashes — so neither side is penalized for an equivocation it didn't cause.This closes the gap that the archive root alone could not: identical archive roots no longer imply identical tx sets.
Why not use proposal hash?
That would work when the BLOCK_TXS request is from a proposal, but it cannot be used when it's done from a block (e.g., in the prover node).
Changes
BlockTxsRequestgains ablockTxHashesCommitmentfield and acomputeBlockTxHashesCommitmenthelper; serialization andfromTxsSourceAndMissingTxsupdated accordingly.reqRespBlockTxsHandlerverifies the commitment before serving txs by index; on mismatch it falls back to the "block not available" path instead of returning indexed txs.BLOCK_TXSvalidation revamp commit (consistency checks on the requester side, response no longer echoes the archive root).block_txs,block_txs_handler, andlibp2p_service, plus a new handler test covering the equivocation case (different proposal under the same archive root → responder refuses to serve by index).Closes https://linear.app/aztec-labs/issue/A-1070/malicious-proposer-can-make-honest-nodes-to-fail-tx-validation .