Skip to content

refactor(ethereum): decompose indexer - #1092

Draft
isSerge wants to merge 6 commits into
developfrom
isserge/refactor-extract-exec-watcher
Draft

refactor(ethereum): decompose indexer#1092
isSerge wants to merge 6 commits into
developfrom
isserge/refactor-extract-exec-watcher

Conversation

@isSerge

@isSerge isSerge commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Refactor Ethereum indexer by extracting few largely independent concerns:

  1. Execution confirmation watching
  2. Finalized-head tracking
  3. Cancellation-aware retry

Main changes:

  • New shared primitives (chain-integration-core::utils::task)
    • Add CancellationTokenExt trait that implements cancelled_within(dur) method - a cancellation-aware sleep
    • Add retry_until_ok(cancel, delay, label, process) helper - retries async operation in the loop with backoff until Ok or cancel (re-used in both Ethereum and Solana crates)
  • Create ExecutionWatcher (chain-ethereum/src/execution_watcher.rs) to isolate execution-confirmation logic
  • Create FinalizedHeadTracker (chain-ethereum/src/finalized_head.rs) - owns the finalized-head watch channel, exposes current(), wait_for(block), spawn_watcher(client, cancel) method. The optimistic-mode gate lives here now.

No behavior changes. indexer.rs went from 3177 to 1393 LOC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant