-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[diem-framework] Implement CRSNs in the Diem Framework #8403
Conversation
@@ -0,0 +1,310 @@ | |||
/// A module implementing conflict-resistant sequence numbers (CRSNs). | |||
/// The specification, and formal description of the acceptance and rejection | |||
/// criteria, force expiration and window shifting of CRSNs is described in DIP-168. |
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.
Hyperlink to the DIP could be useful (once it lands)
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.
Looks pretty excellent to me! One related question: what is the migration plan for SlidingNonce
?
/// The specification, and formal description of the acceptance and rejection | ||
/// criteria, force expiration and window shifting of CRSNs is described in DIP-168. | ||
module 0x1::CRSN { | ||
use 0x1::BitVector::{Self, BitVector}; |
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 think we can still call BitVector
methods without the Self
important (but could be wrong)
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.
Still need the Self import in order to call BitVector
functions -- this is similar to self
imports in Rust.
@@ -0,0 +1,314 @@ | |||
|
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.
File name looks wrong here--checked in by mistake?
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.
Woops...I'll remove
7282343
to
e8dabab
Compare
Good question. My thinking is:
Later on, we can update all of the scripts, and remove the sliding nonce module/remove the resource, but I think that would be better to be done separately from the switchover, otherwise step 2 will also involve switching to an entirely new set of scripts simultaneously. What are your thoughts on this migration strategy? |
e8dabab
to
eedb247
Compare
Yep, that sounds like a good plan to me! I was initially thinking that trying to combine the code might make sense, but I think having both + deprecating is much more sensible. |
eedb247
to
de9044c
Compare
/land |
Cluster Test Result
Repro cmd:
🎉 Land-blocking cluster test passed! 👌 |
💔 Test Failed - ci-test |
f224348
to
91ddcc9
Compare
91ddcc9
to
5077cd9
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@tzakian We should reopen this, right? (I'm not sure if it might have been copied to a different version of the PR or I would just do it myself.) |
@bob-wilson Good question. This PR has been rolled into #8528 so I'm planning on landing (/would prefer to land) these changes in that PR since there were some additional changes needed to make things work with mempool/prologue/epilogue that only work in context with the other changes. So I think keeping this PR closed makes sense. |
This PR implements CRSNs as defined in DIP-168, along with the transactions to opt-in to CRSNs, and force expire CRSNs.
This will need to be plumbed into the account prologue (
CRSN::check
) and epilogue (CRSN::record
). But that will be done later in a separate PR.Testing
Added a number of Move unit tests to the CRSN module