refactor(ethereum): decompose indexer - #1092
Draft
isSerge wants to merge 6 commits into
Draft
Conversation
…r catchup and live block processing
…d clean up `TestIndexerBuilder`
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.
Refactor Ethereum indexer by extracting few largely independent concerns:
Main changes:
chain-integration-core::utils::task)CancellationTokenExttrait that implementscancelled_within(dur)method - a cancellation-aware sleepretry_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)ExecutionWatcher(chain-ethereum/src/execution_watcher.rs) to isolate execution-confirmation logicFinalizedHeadTracker(chain-ethereum/src/finalized_head.rs) - owns the finalized-headwatchchannel, exposescurrent(),wait_for(block),spawn_watcher(client, cancel)method. The optimistic-mode gate lives here now.No behavior changes.
indexer.rswent from 3177 to 1393 LOC