fix: fully validate txs retrieved from tx file store (backport #21988)#21998
Merged
Conversation
Resolved import conflict in factory.ts — only importing the functions actually used in this file (createTxValidatorForReqResponseReceivedTxs and createTxValidatorForTransactionsEnteringPendingTxPool).
alexghr
approved these changes
Mar 25, 2026
alexghr
added a commit
that referenced
this pull request
Mar 25, 2026
#21998) ## Summary Backport of #21988 to v4. Adds full transaction validation (via `TxValidator`) to txs retrieved from the tx file store and node RPC sources, replacing the previous hash-only validation. This ensures downloaded txs are validated with the same rigor as txs received via p2p. ## Cherry-pick details - **Commit 1**: Raw cherry-pick with conflict markers in `yarn-project/p2p/src/client/factory.ts` - **Commit 2**: Conflict resolution — simplified import to only include functions used in this file The conflict was minor: the v4 branch had a single-line import while `next` had a multi-line import block with additional unused imports (`createCheckAllowedSetupCalls`, `getDefaultAllowedSetupFunctions`). Resolved by importing only the two functions actually used. ## Verification - Build passes (`yarn build`) - All related tests pass: - `p2p/src/services/tx_collection/tx_source.test.ts` (3/3) - `p2p/src/services/tx_file_store/tx_file_store.test.ts` (17/17) - `foundation/src/collection/array.test.ts` (61/61) ClaudeBox log: https://claudebox.work/s/9c69d8936952bb70?run=1 --------- Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
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
Backport of #21988 to v4.
Adds full transaction validation (via
TxValidator) to txs retrieved from the tx file store and node RPC sources, replacing the previous hash-only validation. This ensures downloaded txs are validated with the same rigor as txs received via p2p.Cherry-pick details
yarn-project/p2p/src/client/factory.tsThe conflict was minor: the v4 branch had a single-line import while
nexthad a multi-line import block with additional unused imports (createCheckAllowedSetupCalls,getDefaultAllowedSetupFunctions). Resolved by importing only the two functions actually used.Verification
yarn build)p2p/src/services/tx_collection/tx_source.test.ts(3/3)p2p/src/services/tx_file_store/tx_file_store.test.ts(17/17)foundation/src/collection/array.test.ts(61/61)ClaudeBox log: https://claudebox.work/s/9c69d8936952bb70?run=1