-
Notifications
You must be signed in to change notification settings - Fork 464
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
Add early timeboost submission grace period #2788
Add early timeboost submission grace period #2788
Conversation
This allows the winner of the next round to submit their txs for that round during a short grace period at the end of the current round (2s by default). The call to timeboost_sendExpressLaneTransaction will not return, and the tx will not be sequenced, until the next round starts. This allows winners of the auction to take advantage of the full round without having to spam transactions around the round tickover time to ensure their transaction is included as soon as possible.
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.
LGTM
…ments' into express-lane-timeboost-early-submission-grace
break | ||
} | ||
|
||
if msg.Round == currentRound+1 && |
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.
you can have weird conditions where currentRound is 7, byt by the time you computed timeTillNextRound currentRound became 8 and timeTillNextRound is now a full round's time.
easiest option would be to first take a timeStamp (time.Now) and then do both computations against that timestamp.
I'd also consider having some "expressLAneParams" that holds initialTimeStamp and roundDuration and has methonds like: timeTillNextRound (which takes no params) and timeTillNextRoundAt (which takes timestamp as param)
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 the race condition. Not sure if making the params an object with methods makes much difference in clarity so I haven't done it for now.
…ly-submission-grace
} | ||
|
||
if msg.Round == currentRound+1 && | ||
timeboost.TimeTilNextRoundAfterTimestamp(es.initialTimestamp, currentTime, es.roundDuration) <= es.earlySubmissionGrace { |
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.
currentTime must be updated inside the loop so if we're missing a few ms we'll only sleep for a few ms.
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 this.
…ly-submission-grace
…ly-submission-grace
This allows the winner of the next round to submit their txs for that round during a short grace period at the end of the current round (2s by default). The call to timeboost_sendExpressLaneTransaction will not return, and the tx will not be sequenced, until the next round starts. This allows winners of the auction to take advantage of the full round without having to spam transactions around the round tickover time to ensure their transaction is included as soon as possible.