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

[breaking][libra framework] Remove LibraTransactionTimeout module #5674

Merged
merged 1 commit into from Aug 21, 2020

Conversation

sblackshear
Copy link
Contributor

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.

Copy link
Contributor Author

@sblackshear sblackshear left a 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.

@bors-libra
Copy link
Contributor

❗ Invalid command

Bors help and documentation

Bors 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 base-branch (generally master) and then triggers CI. If CI comes back green the PR is then merged into the base-branch. Regardless of the outcome, the next PR is the queue is then processed.

General

  • This project's Merge Queue can be found here.
  • This project requires PRs to be Reviewed and Approved before they can be queued for merging.
  • Before PR's can be merged they must be configured with "Allow edits from maintainers" enabled. This is needed for Bors to be able to update PR's in-place so that Github can properly recognize and mark them as "merged" once they've been merged into the upstream branch.

Commands

Bors actions can be triggered by posting a comment which includes a line of the form /<action>.

Command Action Description
Land land, merge attempt to land or merge a PR
Canary canary, try canary a PR by performing all checks without merging
Cancel cancel, stop stop an in-progress land
Cherry Pick cherry-pick <target> cherry-pick a PR into <target> branch
Priority priority set the priority level for a PR (high, normal, low)
Help help, h show this help message

Options

Options for Pull Requests are configured through the application of labels.

          Option           Description
label: bors-high-priority Indicates that the PR is high-priority. When queued the PR will be placed at the head of the merge queue.
label: bors-low-priority Indicates that the PR is low-priority. When queued the PR will be placed at the back of the merge queue.
label: bors-squash Before merging the PR will be squashed down to a single commit, only retaining the commit message of the first commit in the PR.

@MIRAI-bot
Copy link

[move-prover] Move Prover test (language/move-prover/cargo test) on commit d6b3725 did fail. See details.

Copy link
Contributor

@bob-wilson bob-wilson left a 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.

@riyazdf
Copy link
Contributor

riyazdf commented Aug 20, 2020

noted, thanks!

@n4ss
Copy link
Contributor

n4ss commented Aug 20, 2020

Looks good!

@github-actions
Copy link

release binaries dependency change summary:

target packages:
  M serde-generate 0.11.3 (direct third-party, crates.io)
    * version upgraded from 0.11.0
    * (unchanged features: [none])

@@ -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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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!

@sblackshear
Copy link
Contributor Author

/land

@bors-libra bors-libra moved this from In Review to Queued in bors Aug 20, 2020
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
@bors-libra bors-libra moved this from Queued to Testing in bors Aug 21, 2020
@github-actions
Copy link

Cluster Test Result

all up : 890 TPS, 5083 ms latency, 6250 ms p99 latency, no expired txns

Repro cmd:

./scripts/cti --tag land_0aa74618 -E RUST_LOG=debug --report report.json --suite land_blocking

@bors-libra bors-libra removed this from Testing in bors Aug 21, 2020
@bors-libra bors-libra merged commit 0aa7461 into diem:master Aug 21, 2020
bob-wilson pushed a commit to bob-wilson/diem that referenced this pull request Aug 25, 2020
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.
bors-libra pushed a commit that referenced this pull request Aug 25, 2020
After #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.

Closes: #5767
@sblackshear sblackshear deleted the cleanup_libra_time branch September 21, 2020 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants