-
Notifications
You must be signed in to change notification settings - Fork 0
fix: properly calculate deadline, use chrono
for calculating timestamps
#123
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
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
51d4c66
to
7613bf1
Compare
chrono
for calculating timestamps
fa955fe
to
9da0142
Compare
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, just one nit
.send_transaction(req) | ||
.instrument(span.clone()) | ||
.await | ||
.inspect_err(|e| error!(error = %e, "sending transaction")) |
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 probably written this way because it's implied with the error i assume, but i still think it can be confusing at first glance
.inspect_err(|e| error!(error = %e, "sending transaction")) | |
.inspect_err(|e| error!(error = %e, "error sending transaction")) |
We were calculating the deadline by subtracting from an
Instant::now()
, which we shouldn't do. We now simply subtract the buffer from the remaining time in the slot and add the result to the current instant instead.This also switches to using
chrono
for anything regarding timestamps instead of usingstd
, for parity with the slot calculator. Everything else usesInstant
orDuration
already.Closes ENG-1167
Closes ENG-1019