Repository navigation
perf(rpc): stop long blocking jobs once their request is dropped - #27462
Merged
Merged
Conversation
Blocking tasks keep running after their request is dropped. Expose the request's cancellation state to the blocking task and check it between iterations of the longest running jobs.
DaniPopes
approved these changes
Sep 30, 2026
The thread-local cancellation state and is_cancelled helper are generic over any spawned work, so they now live next to CancelOnDrop as CancelOnDrop::scope and reth_tasks::cancel::is_cancelled. The scope stores the shared flag rather than a CancelOnDrop clone, so leaving it does not cancel.
Collaborator
Author
|
cyclops audit fast |
Contributor
|
cc @mattsse Cyclops audit event published. View workflow run Config: config: |
mattsse
enabled auto-merge
September 30, 2026 11:29
mattsse
disabled auto-merge
September 30, 2026 11:30
tempoxyz-bot
left a comment
Member
There was a problem hiding this comment.
👁️ Cyclops Review — No actionable findings.
Thegreatsura
pushed a commit
to Thegreatsura/tempo
that referenced
this pull request
Oct 2, 2026
Automated nightly update of reth dependencies from `paradigmxyz/reth` main branch. ## Upstream reth changes [`5723a3f...5b68630`](paradigmxyz/reth@5723a3f...5b68630) 🔗 Amp thread: https://ampcode.com/threads/T-01a0f577-22fa-769d-adda-29c049ad2fbd **Engine** - Fed early transactions to BAL execution first ([#27544](paradigmxyz/reth#27544)). - Made sparse trie reuse fork-safe ([#27270](paradigmxyz/reth#27270)). - Preserved tracing context across engine and worker tasks ([#27529](paradigmxyz/reth#27529)). - Moved the precompile cache into `execution-cache` ([#27604](paradigmxyz/reth#27604)). **RPC** - Returned EIP-1186 account extensions in proofs. This adds the `account-ext` feature and trie-side recovery, with test coverage ([#27501](paradigmxyz/reth#27501), [#27524](paradigmxyz/reth#27524), [#27574](paradigmxyz/reth#27574), [#27575](paradigmxyz/reth#27575)). - Timed out slow compressed requests and stopped long blocking jobs once their request is dropped ([#27530](paradigmxyz/reth#27530), [#27462](paradigmxyz/reth#27462)). - Acquired tracing permits for Otterscan trace methods ([#27465](paradigmxyz/reth#27465)). - Kept calls with omitted gas within the RPC gas cap ([#27586](paradigmxyz/reth#27586)). **Storage / DB** - Re-enabled BAL store activation ([#27472](paradigmxyz/reth#27472)). - Added an overlay wait-time metric ([#27495](paradigmxyz/reth#27495)). - Rejected snap sync on the legacy state layout ([#27540](paradigmxyz/reth#27540)). - Pruned transaction row zero during recovery ([#27229](paradigmxyz/reth#27229)). **Snap Sync** - Repaired stale state at the pivot and logged peers that don't serve the pivot ([#27457](paradigmxyz/reth#27457), [#27536](paradigmxyz/reth#27536)). **Stages / Pruning** - Added `Pipeline::run_until` ([#27537](paradigmxyz/reth#27537)). - Rebuilt pruned history from empty, and treated `Before(0)` as nothing to prune ([#27602](paradigmxyz/reth#27602), [#27603](paradigmxyz/reth#27603)). **Networking** - Explicitly added peers are now dialed right away ([#27499](paradigmxyz/reth#27499)). - Simplified network test utils ([#27453](paradigmxyz/reth#27453)). **Txpool** - Capped intrinsic regular gas under EIP-8037 ([#27587](paradigmxyz/reth#27587)). **CLI** - `download` now exits right after completion ([#27498](paradigmxyz/reth#27498)). **Perf** - Switched hash-keyed maps to `B256Map` ([#27558](paradigmxyz/reth#27558)). - Updated keccak-asm to 0.1.9 ([#27496](paradigmxyz/reth#27496)). **Refactoring** - Replaced hand-rolled logic with existing alloy and revm helpers across chainspec, era, payload, engine, RPC, net, trie, and EVM ([#27454](paradigmxyz/reth#27454), [#27505](paradigmxyz/reth#27505), [#27506](paradigmxyz/reth#27506), [#27507](paradigmxyz/reth#27507), [#27509](paradigmxyz/reth#27509), [#27510](paradigmxyz/reth#27510), [#27511](paradigmxyz/reth#27511), [#27512](paradigmxyz/reth#27512), [#27513](paradigmxyz/reth#27513), [#27514](paradigmxyz/reth#27514), [#27519](paradigmxyz/reth#27519), [#27520](paradigmxyz/reth#27520), [#27521](paradigmxyz/reth#27521), [#27522](paradigmxyz/reth#27522), [#27504](paradigmxyz/reth#27504), [#27545](paradigmxyz/reth#27545), [#27549](paradigmxyz/reth#27549), [#27550](paradigmxyz/reth#27550), [#27551](paradigmxyz/reth#27551), [#27552](paradigmxyz/reth#27552), [#27553](paradigmxyz/reth#27553), [#27554](paradigmxyz/reth#27554), [#27556](paradigmxyz/reth#27556), [#27557](paradigmxyz/reth#27557), [#27559](paradigmxyz/reth#27559), [#27562](paradigmxyz/reth#27562), [#27563](paradigmxyz/reth#27563), [#27564](paradigmxyz/reth#27564), [#27565](paradigmxyz/reth#27565), [#27567](paradigmxyz/reth#27567), [#27568](paradigmxyz/reth#27568), [#27516](paradigmxyz/reth#27516), [#27517](paradigmxyz/reth#27517)). - Dropped redundant RLP length checks ([#27547](paradigmxyz/reth#27547)). - Replaced `cfg-if` with `cfg_select` ([#27577](paradigmxyz/reth#27577)). - Made codec crates build standalone ([#27546](paradigmxyz/reth#27546)). **Testing** - Added e2e helpers: - Control the next payload timestamp ([#27596](paradigmxyz/reth#27596)). - Wait for the pool to process a new head ([#27597](paradigmxyz/reth#27597)). - `import_payload` ([#27599](paradigmxyz/reth#27599)). - Advance-until helpers ([#27598](paradigmxyz/reth#27598)). - Made e2e tests less timing-dependent: fixed sleeps became pool waits, stale notifications are skipped, and RocksDB pruning tests wait for the pruner ([#27500](paradigmxyz/reth#27500), [#27583](paradigmxyz/reth#27583), [#27601](paradigmxyz/reth#27601)). - ef-tests now run and validate Amsterdam block access list fixtures and build the genesis trie before block 1 ([#27607](paradigmxyz/reth#27607), [#27571](paradigmxyz/reth#27571)). - Covered a disk reorg with a partial state trie ([#27578](paradigmxyz/reth#27578)). - Fixed flaky or nondeterministic tests in ethstats, bsc, txpool and net ([#27533](paradigmxyz/reth#27533), [#27534](paradigmxyz/reth#27534), [#27531](paradigmxyz/reth#27531), [#27532](paradigmxyz/reth#27532), [#27494](paradigmxyz/reth#27494)). - Test code now uses existing helpers and constants instead of hand-written equivalents ([#27508](paradigmxyz/reth#27508), [#27515](paradigmxyz/reth#27515), [#27518](paradigmxyz/reth#27518), [#27548](paradigmxyz/reth#27548), [#27555](paradigmxyz/reth#27555), [#27560](paradigmxyz/reth#27560), [#27561](paradigmxyz/reth#27561), [#27572](paradigmxyz/reth#27572)). **Release / Deps** - Released 2.7.0 ([#27489](paradigmxyz/reth#27489)). - Bumped base64 to 0.23.1 ([#27486](paradigmxyz/reth#27486)). - Dependabot can now update indirect Cargo dependencies ([#27585](paradigmxyz/reth#27585)). ## Migrations 🔗 Amp thread: https://ampcode.com/threads/T-01a0f577-c5c4-728b-aaa4-f65c61dd63a8 - Bumped all git-pinned `reth-*` dependencies in `Cargo.toml` from rev `5723a3f` to `5b68630` to track a newer upstream reth commit. - Updated `reth-revm` to the same rev. Its `std` and `optional-checks` features stay the same. - Left the crates.io-versioned `reth-codecs` and `reth-primitives-traits` at `0.8.1`. - Kept every crate's feature flags and `default-features = false` settings as they were. The diff contains no source-code API migrations. [GitHub Workflow](https://github.com/tempoxyz/tempo/actions/runs/36809326198)
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.
Blocking tasks keep running when their request is dropped, for example because the client disconnected or timed out, and the long running ones only check for that before they start.
spawn_blocking_ionow runs the task insideCancelOnDrop::scope, which makes the request's cancellation state available to the blocking thread viareth_tasks::cancel::is_cancelled. This is checked between iterations of theeth_estimateGasbinary search, between calls ineth_callMany,debug_traceCallManyandtrace_callMany, between transactions of block traces anddebug_intermediateRoots, and while replaying the transactions preceding a traced transaction.The thread-local scope lives in
reth-tasksnext toCancelOnDropso any spawned work can use it. Leaving a scope restores the previous state, also on unwind, and does not itself cancel.Over WS and IPC this depends on calls being dropped when the connection closes, see #27458 and paritytech/jsonrpsee#1656.