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
[breaking][libra framework] Remove LibraTransactionTimeout module #5674
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.
@wrwg: there are some other TODOs in LibraTimestamp
like
/// > TODO(wrwg): we MUST have a capability which only tests can have to be able to call
/// > this function before we go to production
public fun reset_time_has_started_for_test() acquires TimeHasStarted {
; let me know if you want me to take care of them as long as I'm already doing a breaking change here.
❗ Invalid command Bors help and documentationBors is a Github App used to manage merging of PRs in order to ensure that CI is always green. It does so by maintaining a Merge Queue. Once a PR reaches the head of the Merge Queue it is rebased on top of the latest version of the PR's General
CommandsBors actions can be triggered by posting a comment which includes a line of the form
OptionsOptions for Pull Requests are configured through the application of labels. |
d6b3725
to
f7988cf
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.
I like this a lot! It's better to do the comparison in seconds instead of microseconds, since the expiration is specified in terms of seconds, and there's no risk of overflow this way.
f7988cf
to
dbbe2ca
Compare
noted, thanks! |
Looks good! |
dbbe2ca
to
ddfd2bc
Compare
release binaries dependency change summary:
|
@@ -151,7 +153,7 @@ module LibraTimestamp { | |||
} | |||
|
|||
|
|||
/// Gets the timestamp representing `now` in microseconds. | |||
/// Gets the current time in microseconds. | |||
public fun now_microseconds(): u64 acquires CurrentTimeMicroseconds { |
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.
More of a meta question here: now that we have now_seconds
do we want to keep now_microseconds
around as part f the public API since we don't need that fine of a granularity on 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.
Great question! I don't see now_microseconds
used anywhere else except for AccountLimits
, and I would be very much in favor of replacing that usage with now_seconds
and hiding now_microseconds
. Let me try to tackle this before landing.
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.
Starting looking at this and it feels like a big enough change that it should happen in a separate PR. But definitely worth doing!
ddfd2bc
to
5ae0e45
Compare
/land |
The only purpose of LibraTransactionTimeout was to an enforce upper and lower bounds on transaction expiration time. The lower bound check is very simple to do and the upper bound check is no longer a requirement, so we can kill this module. The PR deletes LibraTransactionTimeout and moves the lower bound check into the transaction prologue. To keep the check simple, it adds a LibraTimestamp::now_seconds function that can be directly compared against the transaction expiration time (which is specified in seconds). This is a breaking change in the sense that it removes the LibraTransactionTimeout module and orphans the TTL resource, but it is not observable to clients and should be deployable via a WriteSet. Closes: diem#5674
Cluster Test Result
Repro cmd:
|
5ae0e45
to
0aa7461
Compare
After diem#5674, the maximum value for transaction expiration is no longer constrained by a factor of 1_000_000, so update the comment to reflect that.
The only purpose of
LibraTransactionTimeout
was to an enforce upper and lower bounds on transaction expiration time. The lower bound check is very simple to do and the upper bound check is no longer a requirement, so we can kill this module.The PR deletes
LibraTransactionTimeout
and moves the lower bound check into the transaction prologue. To keep the check simple, it adds aLibraTimestamp::now_seconds
function that can be directly compared against the transaction expiration time (which is specified in seconds).This is a breaking change in the sense that it removes the
LibraTransactionTimeout
module and orphans theTTL
resource, but it is not observable to clients and should be deployable via a WriteSet.