Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor blockpoller initialization to use first streamable block #67

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

billettc
Copy link
Contributor

Replaced start block with first streamable block in BlockPoller to ensure accurate initiation. Added a check for the state file's existence and integrated state initialization with fetching the first streamable block. Updated tests accordingly.

Replaced start block with first streamable block in BlockPoller to ensure accurate initiation. Added a check for the state file's existence and integrated state initialization with fetching the first streamable block. Updated tests accordingly.
blockpoller/state_file.go Outdated Show resolved Hide resolved
Refactor BlockPoller to support generic clients with type parameter 'C'. Updated associated methods, test functions, and interfaces to accommodate this change. This enhancement includes moving the retry mechanism and client handling to the poller, improving flexibility for different client types.
Removed redundant os.IsExist(err) check since err == nil is sufficient to determine file existence. This simplifies the code and avoids ambiguity in interpreting the error state.
Updated several block fetch functions and utility methods to accept a context parameter for better cancellation and timeout control. Enhanced TestBlockClient to handle block fetching delays, and adjusted tests to accommodate these changes.
Updated the Clients struct to include a maxBlockFetchDuration parameter, enhancing flexibility in specifying timeout durations for block fetching. This change was reflected in the initialization function and associated test cases.
Implemented new rolling strategy interfaces and updated RPC clients to utilize the rolling strategies. Introduced two strategies: RoundRobin and AlwaysUseFirst, modifying existing tests to incorporate these changes.
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.

2 participants