-
Notifications
You must be signed in to change notification settings - Fork 38
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
sergerad
wants to merge
12
commits into
0xPolygonZero:develop
Choose a base branch
from
sergerad:serge/block-hash-interval
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
WIP: BlockInterval support for hash ranges #728
sergerad
wants to merge
12
commits into
0xPolygonZero:develop
from
sergerad:serge/block-hash-interval
Conversation
This file contains 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
github-actions
bot
added
crate: zero_bin
Anything related to the zero-bin subcrates.
ci
labels
Oct 16, 2024
sergerad
force-pushed
the
serge/block-hash-interval
branch
from
October 17, 2024 00:47
b5ef272
to
7a75048
Compare
@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
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.
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 containu64
ranges, which seems like an appropriate invariant for the type and also simplifies subsequent usage (no need to match onSingleBlock
).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 typeRange<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: