Commit Graph

12250 Commits

Author SHA1 Message Date
Yong Kang
5c2b9c4d8c added comments 2025-11-25 09:34:24 +00:00
Yong Kang
5b46ac15c7 refactor(payload_validator): extract spawn_deferred_trie_task method
Extracts deferred trie task spawning into a dedicated method for better
code organization and maintainability.

Key change: moves `merge_overlay_trie_input` call OUTSIDE `spawn_blocking`
to prevent deadlocks. Previously, blocking threads could wait on each
other's `trie_data()` calls and deadlock by exhausting the thread pool.
2025-11-25 09:27:08 +00:00
Yong Kang
1793c0f596 refactor: extract deferred trie task logic into a dedicated method
This change introduces the `spawn_deferred_trie_task` method to encapsulate the logic for computing and sorting trie data in a background task. This refactor improves code readability and maintains the validation hot path's efficiency by allowing immediate returns after state root verification. The new method handles merging of trie inputs and manages the deferred computation process, ensuring that consumers only block when they require the sorted trie data.
2025-11-25 09:21:21 +00:00
Yong Kang
7c75044d34 refactor: introduce AnchoredTrieInput to group anchor_hash and trie_input
Encapsulates anchor_hash and trie_input into a single AnchoredTrieInput
struct, and makes it optional in ComputedTrieData. This ensures both
fields are either present together or absent together.

- Some(AnchoredTrieInput): For in-memory blocks that need trie input
  anchored to a persisted ancestor (validation, state root computation)
- None: For pending blocks and payload building where anchored trie
  input is not needed
2025-11-25 08:56:44 +00:00
Yong Kang
b02c00c7aa refactor: explicit ExecutedBlock constructors for safe vs deferred trie data
The API now makes it explicit which path is safe vs potentially blocking:

- `ExecutedBlock::new()` takes `ComputedTrieData` directly - safe default
  for sequencers, payload builders, and other contexts where trie data is
  immediately available.

- `ExecutedBlock::with_deferred_trie_data()` takes `DeferredTrieData` -
  explicitly signals that the caller MUST call `set_ready()` on the handle,
  otherwise `trie_data()` will block forever.

This addresses the API footgun where creating an ExecutedBlock with a
pending DeferredTrieData but never calling set_ready() would cause silent
deadlocks.
2025-11-25 08:08:50 +00:00
Yong Kang
a99eeb3aba chore: remove Eq impl for ExecutedBlock and BlockState
The Eq impl is removed because ExecutedBlock contains DeferredTrieData
which uses Mutex internally. This makes equality comparisons potentially
blocking, which is not appropriate for Eq semantics.
2025-11-25 07:54:55 +00:00
Yong Kang
fc606f4237 fix: fast path lock
and there is a logical error here where the fast path checks blocks.last() which is the oldest in-memory block (not the tip). but blocks_by_hash returns blocks in newest-to-oldest order.
this results in
wrong data: The oldest block's trie_input only has its own overlay, missing all newer blocks' state changes
waiting on the oldest block, blocks the validation thread on the wrong  trie_data(), starves the blocking pool, and even when it unblocks the reused trie input is missing  newer overlays.
2025-11-25 06:42:37 +00:00
Yong Kang
ac281195f4 feat: fast path compute trie 2025-11-25 05:59:44 +00:00
Yong Kang
7708956493 refactor: streamline trie input computation in payload validator
ref 0d8091066e

Consolidate the logic for merging overlay trie inputs into a dedicated function, `merge_overlay_trie_input`, to improve readability and maintainability. Remove redundant code and enhance error handling in deferred trie tasks. Update documentation to clarify the purpose and process of computing `TrieInputSorted` from in-memory blocks.
2025-11-25 05:42:23 +00:00
Yong Kang
9cdf6705c0 chore: remove PartialEq impl for ComputedTrieData
Remove the manual PartialEq implementation for ComputedTrieData since
the trie_input field was intentionally excluded from comparisons, which
could lead to subtle bugs. Update test assertions to explicitly compare
the relevant fields individually.

Also fix unused import warning for CanonStateSubscriptions in flashblocks.
2025-11-25 05:25:22 +00:00
YK
dee0543224 Merge branch 'main' into fix/tokio-runtime-executor 2025-11-25 12:37:28 +08:00
Dan Cline
e57fe4510c docs(cli): remove reference to engine experimental (#19944) 2025-11-24 22:47:49 +00:00
Vitalyr
f2600ace51 chore: avoid needless clone in module array conversion (#19939) 2025-11-24 21:50:17 +00:00
Matthias Seitz
366f509b2f chore: spawn tx iter earlier (#19948) 2025-11-24 21:22:59 +00:00
Francis Li
118fd3b372 feat(flashblocks): Cache recent flashblocks (#19786)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2025-11-24 18:01:46 +00:00
cui
b546aca5c1 fix: npm run build failed in docs/vocs directory (#19937) 2025-11-24 16:35:38 +00:00
Acat
c7b689016a fix(txpool): ensure skipped high-priority transactions are tracked in BestTransactions (#19940) 2025-11-24 15:31:47 +00:00
Arsenii Kulikov
4467bc9f4b fix: correctly fetch pending hashes (#19938) 2025-11-24 14:36:43 +00:00
YK
c2d73988de chore(test): Increase timeout for ethereum e2e tests (#19933) 2025-11-24 11:30:30 +00:00
Arsenii Kulikov
c2912a7333 refactor(tracing): introduce DebugInspector (#19925) 2025-11-24 10:38:13 +00:00
David Klank
bd9e41c551 chore(era): move reth-ethereum-primitives to dev-dependencies (#19847) 2025-11-24 09:56:30 +00:00
cui
b6f62473e0 feat: update docs link in cli/SUMMARY.mdx (#19909) 2025-11-24 09:56:02 +00:00
Bashmunta
d429a665b2 chore: remove unused lifetime from map_internal_err impl (#19924) 2025-11-24 09:52:39 +00:00
Andrés David Ramírez Chiquillo
75af47c456 feat(payload): enforce Osaka validation for GetPayloadV4 (#19929) 2025-11-24 09:51:12 +00:00
YK
f1fc979116 feat(reth-bench-compare): add standard deviation metrics to comparison report (#19928) 2025-11-24 09:39:27 +00:00
Maximilian Hubert
d278b75c3a chore(stages): fix naming and simplify add_stages implementation (#19923) 2025-11-24 08:47:54 +00:00
Đạt Nguyễn
e03c9da85c refactor: remove unused add_transactions_with_origins trait (#19824) 2025-11-24 06:53:10 +00:00
Arsenii Kulikov
ee63c7d6b4 refactor: simplify rpc state provider traits (#19920) 2025-11-23 19:06:10 +00:00
Matthias Seitz
1702107028 feat: make txpool notify fns pub (#19918) 2025-11-23 14:07:59 +01:00
github-actions[bot]
32f0a74462 chore(deps): weekly cargo update (#19917)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2025-11-23 11:50:58 +00:00
Arsenii Kulikov
a83ac8cc63 refactor(e2e): relax bounds (#19913) 2025-11-23 13:05:48 +01:00
Yong Kang
c79cb3cf4d fix: run on the same tokio runtime for executor 2025-11-22 03:28:34 +00:00
Léa Narzis
7f40013cf6 feat(tracing-otlp): make trace id ratio sample customizable with --tracing-otlp.sample-ratio arg (#19438) 2025-11-21 21:05:43 +00:00
Arsenii Kulikov
6e365949c4 feat: allow customizing dev block timestamp (#19904) 2025-11-21 20:38:20 +00:00
Léa Narzis
e15b404a30 feat(era-file): back to era file support (#19482) 2025-11-21 20:03:28 +00:00
Alexey Shekhirin
39ef6216fb feat(provider, static-file): transaction senders segment (#19508)
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-21 19:34:16 +00:00
Francis Li
5e0732404c chore(op-alloy): update op-alloy to v0.22.4 (#19905) 2025-11-21 18:25:05 +00:00
gustavo
9f3949cd35 chore(examples): complete state_provider_example (#19903) 2025-11-21 15:58:49 +00:00
Mablr
b0494a158a chore(rpc-eth-types): use FillTransaction from alloy (#19890) 2025-11-21 15:52:28 +00:00
YK
002e755dd4 chore(bench-compare): Add latency distribution stats to reth-bench-compare (#19873)
Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com>
2025-11-21 14:52:55 +00:00
Arsenii Kulikov
a43128277f fix: correctly poll tx fetcher (#19900) 2025-11-21 14:41:28 +00:00
Alexey Shekhirin
86825ac3b7 refactor(cli): deduplicate ethereum init_tracing implementations (#19898) 2025-11-21 14:23:57 +00:00
Alexey Shekhirin
0ba122923a ci: partition cargo-checks job (#19897) 2025-11-21 12:48:31 +00:00
Dan Cline
2a953a821a fix: remove noisy storage proof spans (#19892) 2025-11-21 11:48:32 +00:00
Yong Kang
bb7cb4b853 error log 2025-11-21 10:03:31 +00:00
Yong Kang
c7326ad23d comment 2025-11-21 10:03:17 +00:00
Yong Kang
c1db78a1dc comment formatting 2025-11-21 09:50:28 +00:00
Yong Kang
4e3c7f5e05 clippy, fmt 2025-11-21 09:26:57 +00:00
Yong Kang
b009ed922a fix compile
add reth-trie-common dependency and update usages in flashblocks and rpc-eth-api
2025-11-21 09:15:47 +00:00
Yong Kang
56efae84b7 comment 2025-11-21 08:36:09 +00:00