-
Notifications
You must be signed in to change notification settings - Fork 270
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
Respect grace ticks #2354
Respect grace ticks #2354
Conversation
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.
Nice, this was a straightforward fix!
e4cb4ef
to
80bb3d0
Compare
changes look good but there's a failing poh related test |
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'm in favor of this change.
One potential problem I see is that it's possible we already produced (or partially produced) our first block but have now switched the fork we're building off of. This would causes us to respect grace ticks even if we don't really have to.
As a follow up I think we should keep track of whether we have already waited for grace ticks / produced any shreds for our current leader slots in order to skip waiting again.
This is because the next_poh_slot computed in reached_leader_slot is based on the current tick_height
I am also in favor of always producing the earliest slot we can once we reach grace ticks. Otherwise it seems like a slow previous leader can always cause you to skip half your slots.
Also it might be too early to call without some more data, but it seems like turning delay_leader_block_for_pending_fork
on as the default is beneficial. Of the 7 slots we saw on mainnet recently that fit this category:
279650852
279589292
279773684
280090288
280260040
280519864
280352012
All were skipped with the flag off
Had to update this test to pass in the pubkey from the PoH start bank so it would match, conclude that previous slot is ours, ignore grace ticks, and thus return we've reached our leader slot. |
Problem
There's a bug where we will not respect grace ticks (currently set to 2 slots worth) because once we tick through 1 slot worth of ticks, we think we will now be building off our own block (or at least have produced a block) and don't need to respect grace ticks.
Summary of Changes
test_reached_leader_tick
to cover all the possible paths.Notes
next_poh_slot
computed inreached_leader_slot
is based on the currenttick_height