-
Notifications
You must be signed in to change notification settings - Fork 1
fix flashblock timing #34
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
| } | ||
|
|
||
| #[test] | ||
| fn many_flashblocks_with_large_remaining_time() { |
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.
Can we also add test for zero remaining time?
This happens when FCU arrived later then dealine
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.
Added. It expects 0 flashblocks and the first flashblock time doesn't really matter since it'll break out
d508863 to
7371ca5
Compare
| { | ||
| let gas_used = payload.cumulative_gas_used(); | ||
| let remaining_gas = enclosing.gas_limit.saturating_sub(gas_used); | ||
| tracing::warn!( |
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 was super useful log (but should be info, let's bring it back)
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.
Done, and changed to info
d352346 to
089f961
Compare
| flashblock_number.clone(), | ||
| )), | ||
| ) | ||
| .with_step(BreakAfterDeadline), |
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.
Why haven't you combined steps?
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 tried but it ended up breaking a couple tests
Refactor and fix flashblock timing
partition_time_into_flashblocksto calculate the first flashblock time and number of flashblocks and unit test it throughly.BreakAfterMaxFlashblocksto stop once we hit the maximum number of flashblocksThe new tests all pass, some old ones are still broken.
Also tested with builder-playground and fbutil and flashblocks are being produced at the right time:
Occasionally flashblocks without a base will be produced but that seems out-of-scope for this PR.