feat(firehose): async emission, shutdown drain, and startup gap detection#1
Draft
Copilot wants to merge 3 commits into
Draft
feat(firehose): async emission, shutdown drain, and startup gap detection#1Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
… detection - Create `crates/firehose/` crate (`reth-firehose`) with: - `FirehoseArgs`: clap CLI args for `--firehose.emission-mode`, `--firehose.channel-capacity`, `--firehose.live-threshold`, `--firehose.cursor-path` - `init_tracer()`: one-shot global tracer initialisation returning `ShutdownHandle` - `check_gap_and_re_trace()`: detects gaps between cursor file and execution stage checkpoint, re-emits missing blocks - `firehose_re_trace_range()`: pruning guard + per-block re-execution loop (full EVM inspector integration noted as TODO) - Patch `rbase64` (transitive dep of `firehose-tracer`) to remove its `#[global_allocator]` declaration that conflicts with reth's jemalloc allocator - Add `firehose-tracer = "5.1.0"` and `reth-firehose` to workspace `Cargo.toml` - Modify `bin/reth/src/main.rs` to use `FirehoseArgs` as CLI extension type and wire the `on_component_initialized` startup hook that: initialises the tracer, checks for gaps, and registers `ShutdownHandle::drain()` with `spawn_with_graceful_shutdown_signal` Agent-Logs-Url: https://github.com/streamingfast/reth/sessions/088879c2-d333-44f1-83d2-83a9ae603230 Co-authored-by: maoueh <123014+maoueh@users.noreply.github.com>
- Fix incorrect pruning guard: remove flawed `best_block_number > first` check that would have triggered spurious fatal errors on any synced node; pruning detection now happens naturally during block execution with context-enriched error message - Remove unused lock acquisition in `re_trace_single_block`; tracer init check uses `let _ =` pattern without holding the lock - Improve `read_cursor` docstring to explicitly document that file corruption is treated the same as a missing file - Clarify `init_tracer` panic documentation: explain that double-init is a programming error (not just "development artifact") to prevent silent data loss - Fix misleading "automatically generated" comment in vendor/rbase64/Cargo.toml - Remove unused `error` tracing import Agent-Logs-Url: https://github.com/streamingfast/reth/sessions/088879c2-d333-44f1-83d2-83a9ae603230 Co-authored-by: maoueh <123014+maoueh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Expose EmissionMode via CLI and update dependency
feat(firehose): async emission, shutdown drain, and startup gap detection
Apr 30, 2026
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.
Wires
firehose-tracerv5.1.0 into the reth node with emission-mode selection, graceful shutdown draining, and cursor-based gap detection before the sync pipeline starts.New crate:
crates/firehose(reth-firehose)FirehoseArgs— clap argument group flattened into the node command:--firehose.emission-mode blocking|async|auto(default:auto)--firehose.channel-capacity <N>(default: 32)--firehose.live-threshold <SECS>(default: 60)--firehose.cursor-path <PATH>(default:<datadir>/firehose.cursor)init_tracer(config) -> Option<ShutdownHandle>— one-shot globalOnceLock<Mutex<Tracer>>init; panics on double-init to surface programming errors earlycheck_gap_and_re_trace(provider, cursor_path)— reads the cursor file, compares against the execution stage checkpoint, and callsfirehose_re_trace_rangewhen a gap existsfirehose_re_trace_range(range, provider)— iterates the gap; pruning detection surfaces naturally from execution errors with a clear fatal message pointing to archive-node requirements; full call-level tracing pendingFirehoseEvmInspectorintegration (documented as TODO inre_trace_single_block)bin/reth/src/main.rsSwitch to
Cli::<EthereumChainSpecParser, FirehoseArgs>and add anon_component_initializedhook — runs before the sync pipeline starts:Dependency conflict:
vendor/rbase64firehose-tracerdepends onrbase64v2.0.3, which unconditionally sets#[global_allocator](MiMalloc) in its library crate — a bug that conflicts with reth's jemalloc. A minimal vendor patch removes that declaration; wired via[patch.crates-io]in the workspaceCargo.toml.Original prompt
Created from VS Code.