-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Convert mutable: bool
to mutability: SharedObjectMutability
. Backward compatible because of enum encoding.
#23947
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ab9a829
to
ca4f27c
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.
Change looks good! Where we can we go to learn more about what the future schema needs to expose?
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 is pulled out of #23733, which adds SharedObjectMutability::NonExclusiveWrite
, which allows transactions to perform non-conflicting dynamic field operations in parallel.
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.
Okay, for GraphQL, we can work this migration by adding a new field -- mutability
that returns an enum, and add a deprecation notice to the old mutable
flag, before disappearing it after two more releases.
ca4f27c
to
f591c1f
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.
Concerned about some possible breakages (looking at the yaml) But I imagine you are on top of it
pub fn is_mutable(&self) -> bool { | ||
match self { | ||
SharedObjectMutability::Mutable => true, | ||
SharedObjectMutability::Immutable => false, | ||
} | ||
} |
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.
Is this something we want to support? What happens after the non-exclusive variant is added?
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'll handle that in that PR, but I didn't want to bring those sorts of details backward into this change
crates/sui-types/src/transaction.rs
Outdated
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; |
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.
Is there no existing unit test file where this should go?
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.
moved to a new test file
crates/sui-types/src/transaction.rs
Outdated
Mutable, | ||
} | ||
|
||
impl std::fmt::Display for SharedObjectMutability { |
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.
Where is this used?
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.
Mostly making sure this isn't going to fork if it is used somewhere stupid
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.
removed, it was apparently unused
TYPENAME: SequenceNumber | ||
- mutable: BOOL | ||
- mutability: | ||
TYPENAME: SharedObjectMutability |
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 don't fully know the results of this change and who it will break
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 don't think there's anything that directly reads sui.yaml, if that's what you mean. For readers of BCS, the format is compatible. Am I missing your point?
…ward compatible because of enum encoding.
1399c0b
to
ff80d4e
Compare
No description provided.