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

WIP: BlockInterval support for hash ranges #728

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

sergerad
Copy link

@sergerad sergerad commented Oct 16, 2024

WIP

Relates to #287.

Refactored BlockInterval::new() to allow for the simplest support for block hash ranges in the runtime and associated scripts.

Changes BlockInterval to only contain u64 ranges, which seems like an appropriate invariant for the type and also simplifies subsequent usage (no need to match on SingleBlock).

This approach requires flag usage to be in the form of --start-block [num|hash] --end-block [num|hash]. An alternative approach would be to modify the CLI flags to be of type Range<u64> separately to the block hash flags, but that feels like a messier approach.

The current approach is not without its own UX issues. For example, to specify a single block, you need to use both start/end flags where the input value is identical. This could be addressed with a separate flag without being too messy, however.

TODO:

  • Update any other related scripts / workflows
  • Replace the unit tests removed with unit tests involving mocks for the provider
  • Any impl changes requested from review

@github-actions github-actions bot added crate: zero_bin Anything related to the zero-bin subcrates. ci labels Oct 16, 2024
@sergerad
Copy link
Author

@atanmarko I have reimplemented the existing unit tests with mocks and added new tests for hash-based inputs.

The functionality is all in place, just need to clean things up. But I'll hold off for now until you get a chance to do a review pass. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci crate: zero_bin Anything related to the zero-bin subcrates.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant