-
Notifications
You must be signed in to change notification settings - Fork 4
28 early quit event validation #81
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
Conversation
|
DO NOT MERGE YET. The tests are finally passing. But the sneaky bug that caused them to fail needs to be clarified before merging. |
b970183 to
487bce9
Compare
|
Hi! There are a lot of commits in this MR. I would merge this with a single commit with a short commit message, instead of including all the sub-commits in the commit message. |
26055ed to
2d56ebe
Compare
40a6f55 to
0724277
Compare
| } else { | ||
| return Err(ValidationError::Invalid(message)); | ||
| } | ||
| if num_occurrences + seen_events.len() > num_occurrences_expected { |
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.
this no longer checks if the number of occurrences is lower than the expected ones. if a dvf has been set up correctly, this should never happen but there are no guarantees that the dvfs are set up correctly. you can now create a dvf with an additional event that has not been emitted yet and it will validate in the future once it is emitted.
| current_from = current_to + 1; | ||
| } | ||
|
|
||
| if num_occurrences < num_occurrences_expected { |
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.
fixed here
This PR resolves #28.
Added early quit logic to the event validation, querying events in blocks and early quitting if there is a mismatch.
Refactored the get_events function into two:
get_eth_events: queries for all events in the range [from_block, to_block]get_eth_events_paginated: splits the block range in blocks of at most config.max_blocks_per_event_query, and usesget_eth_eventsto query the events.