Skip to content
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

Conversation

Tristan-Wilson
Copy link
Member

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.

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.
@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Nov 13, 2024
Copy link
Contributor

@ganeshvanahalli ganeshvanahalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

break
}

if msg.Round == currentRound+1 &&
Copy link
Contributor

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)

Copy link
Member Author

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.

Base automatically changed from expres-lane-timeboost-fix-pr-comments to express-lane-timeboost November 21, 2024 01:34
@CLAassistant
Copy link

CLAassistant commented Nov 26, 2024

CLA assistant check
All committers have signed the CLA.

}

if msg.Round == currentRound+1 &&
timeboost.TimeTilNextRoundAfterTimestamp(es.initialTimestamp, currentTime, es.roundDuration) <= es.earlySubmissionGrace {
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this.

@Tristan-Wilson Tristan-Wilson merged commit e1344f7 into express-lane-timeboost Dec 11, 2024
5 of 10 checks passed
@Tristan-Wilson Tristan-Wilson deleted the express-lane-timeboost-early-submission-grace branch December 11, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants