-
Notifications
You must be signed in to change notification settings - Fork 73
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
Extended snapshot scheduler to better handle missing and zero params #1220
Conversation
snapshot_request_params sri2 = {.block_spacing = 5000, .start_block_num = 100000, .end_block_num = 300000, .snapshot_description = "Example of recurring snapshot 2 that will never happen"}; | ||
snapshot_request_params sri3 = {.block_spacing = 2, .start_block_num = 0, .end_block_num = 3, .snapshot_description = "Example of recurring snapshot 3 that will expire"}; | ||
snapshot_request_params sri4 = {.start_block_num = 1, .snapshot_description = "One time snapshot on first block"}; | ||
snapshot_request_params sri5 = {.block_spacing = 10, .snapshot_description = "Recurring every 10 blocks snapshot starting now"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any new unit tests; do we need to add any more tests to expressly cover the example given in #1152? For example, head block is 6, and then a new request to .block_spacing = 10, .start_block_num = 0, .end_block_num = 0
is made, and then we should have snapshots on blocks 10 & 20, for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, done! Extended tests to run a little longer and check for timings on first 2 snapshots
This PR add differentiation between missing and zero-valued parameters in api request for start, end and spacing of blocks, in particular, as it was observed in original issue making start_block_num assignable to "0" in request or directly in snapshot-schedule.json file, such as:
Prior implementation treated zero start as missing value and replaced it with "now" block num
Resolves #1152