refactor(pool): add IntoIter: Send bounds to avoid unnecessary Vec collect#22001
Merged
refactor(pool): add IntoIter: Send bounds to avoid unnecessary Vec collect#22001
Conversation
…atcher - Add `origin` field to `BatchTxRequest` so the batcher respects the caller-specified origin instead of hardcoding `TransactionOrigin::Local` - Add `origin` parameter to `EthTransactions::send_transaction` trait method - Update `EthApiInner::add_pool_transaction` to accept and forward origin - `BatchTxProcessor::process_batch` groups requests by origin before batch insertion via `add_transactions` - Derive `PartialOrd, Ord` on `TransactionOrigin` for `BTreeMap` grouping - Existing callers (`send_raw_transaction`, `send_transaction_request`) continue to use `TransactionOrigin::Local` Co-authored-by: klkvr <klkvr@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019c3f5c-0c1c-703a-9da7-c46be75e7acf Co-authored-by: Amp <amp@ampcode.com>
…atcher - Add `origin` field to `BatchTxRequest` - Add `TransactionOrigin` parameter to `EthTransactions::send_transaction` - Add `TransactionPool::add_transactions_with_origins` accepting per-tx origins via `Vec<(TransactionOrigin, Transaction)>` - Make `TransactionPool::add_transactions` a default method delegating to `add_transactions_with_origins` - Inner `Pool::add_transactions` delegates to `Pool::add_transactions_with_origins` - `BatchTxProcessor::process_batch` uses `add_transactions_with_origins` directly - Existing callers (`send_raw_transaction`, `send_transaction_request`) continue to use `TransactionOrigin::Local` Co-authored-by: klkvr <klkvr@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019c3f5c-0c1c-703a-9da7-c46be75e7acf
- task.rs: collect mapped iterator into Vec before passing to validate_transactions, fixing Send bound error - transaction.rs: change send_raw_transaction to use TransactionOrigin::External instead of Local Amp-Thread-ID: https://ampcode.com/threads/T-019c4401-f497-7668-a25e-64c6fe49d873 Co-authored-by: Amp <amp@ampcode.com>
Avoids unnecessary Vec collect by requiring the iterator itself to be Send, not just the container. This allows Map adapters to pass through without allocation. Amp-Thread-ID: https://ampcode.com/threads/T-019c4401-f497-7668-a25e-64c6fe49d873 Co-authored-by: Amp <amp@ampcode.com>
Keep IntoIter: Send bounds from this branch, which main changed to plain IntoIterator + Send. Amp-Thread-ID: https://ampcode.com/threads/T-019c444a-f34b-705c-a8db-38b689d000d5 Co-authored-by: Amp <amp@ampcode.com>
Contributor
✅ Changelog found on PR. |
- Default trait impl now delegates to validate_transactions instead of duplicating join_all logic - Remove redundant validate_transactions_with_origin overrides from TransactionValidationTaskExecutor and Either impl (the default delegation handles both correctly) Amp-Thread-ID: https://ampcode.com/threads/T-019c444a-f34b-705c-a8db-38b689d000d5 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c444a-f34b-705c-a8db-38b689d000d5 Co-authored-by: Amp <amp@ampcode.com>
klkvr
approved these changes
Feb 9, 2026
mattsse
approved these changes
Feb 9, 2026
CarlBeek
added a commit
to CarlBeek/reth
that referenced
this pull request
Feb 10, 2026
* paradigmxyz/main: (144 commits) feat(engine): add getPayloadBodiesV2 endpoints for EIP-7928 BAL support (paradigmxyz#21774) ci: skip scheduled workflows on forks (paradigmxyz#22022) chore: rm random log file (paradigmxyz#22023) chore: remove base.reth.rs public endpoint references (paradigmxyz#22019) feat(rpc): add `subscribeFinalizedChainNotifications` endpoint (paradigmxyz#22011) feat(trie): remove `SerialSparseTrie` (paradigmxyz#21808) fix(rocksdb): set max_open_files to prevent fd exhaustion (paradigmxyz#22005) refactor(txpool): rename and document validation methods (paradigmxyz#22008) feat(engine): prefetch withdrawal addresses in pre-warming (paradigmxyz#21966) refactor(pool): add IntoIter: Send bounds to avoid unnecessary Vec collect (paradigmxyz#22001) fix(rpc): enforce blockHash constraint in append_matching_block_logs (paradigmxyz#22007) chore: move Kurtosis failures to the hive slack channel (paradigmxyz#21983) feat(rpc): propagate TransactionOrigin through send_transaction and batcher (paradigmxyz#21969) feat(engine): reorg depth commitment metric (paradigmxyz#21992) feat(storage): add use_hashed_state storage setting (paradigmxyz#21997) perf: better scheduling for storage roots computation (paradigmxyz#21987) chore(deps): bump alloy 1.6.2 -> 1.6.3 (paradigmxyz#21986) fix(stages): skip sender unwind when fully pruned (paradigmxyz#21988) chore(net): remove OP stack bootnodes (paradigmxyz#21984) ci: use depot for hive and kurtosis image builds, run daily (paradigmxyz#21976) ... # Conflicts: # .github/workflows/compact.yml # .github/workflows/dependencies.yml # .github/workflows/docker-tag-latest.yml # .github/workflows/docker.yml # .github/workflows/e2e.yml # .github/workflows/hive.yml # .github/workflows/integration.yml # .github/workflows/kurtosis.yml # .github/workflows/lint.yml # .github/workflows/release.yml # .github/workflows/reproducible-build.yml # .github/workflows/stale.yml # .github/workflows/sync-era.yml # .github/workflows/sync.yml # .github/workflows/unit.yml # bin/reth/Cargo.toml # crates/cli/commands/src/node.rs # crates/node/core/src/node_config.rs
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
Follow-up to #21969 per @klkvr's review comment.
Changes
IntoIter: Sendbounds tovalidate_transactionsandvalidate_transactions_with_originin theTransactionValidatortrait and all implsVeccollect invalidate_transactions_with_origin(task.rs) — the iterator can now be passed directly sinceMap<SendIter, F>satisfies the boundvalidate_transactions_with_originto delegate tovalidate_transactionsinstead of duplicatingjoin_alllogicvalidate_transactions_with_originoverrides fromTransactionValidationTaskExecutorandEitherimpl (the default delegation handles both correctly)Testing