-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[json] Add modified_at_versions to SuiTransactionEffects #7237
Conversation
tnowacki
commented
Jan 9, 2023
- Added missing field present in TransactionEffects but not for the JSON copy of it
- Added missing field present in TransactionEffects but not for the JSON copy of it
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
// The version that every modified (mutated or deleted) object had before it was modified by | ||
// this transaction. | ||
#[serde(default, skip_serializing_if = "Vec::is_empty")] | ||
pub modified_at_versions: Vec<(ObjectID, SequenceNumber)>, |
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 style, the pair (ObjectID, SequenceNumber)
, does not seem in line with the rest of this struct, but I was unsure if I should make a type just for this case.
Any advice @patrickkuo?
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.
We use custom type (e.g. SuiObjectRef
) to give the values names before serialisation to make it more readable.
IIRC this is preferred in typescript? CC @666lcz for comments
@@ -1916,6 +1920,7 @@ impl SuiTransactionEffects { | |||
Ok(Self { | |||
status: effect.status.into(), | |||
gas_used: effect.gas_used.into(), | |||
modified_at_versions: effect.modified_at_versions, |
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.
Separate issue, but wondering why the existing modified_at_versions
doesn't include the input object digest. This is important info if you want to replay the tx by reading the input values from an untrusted store.
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.
Originally modified_at_versions
was included to support reverting state updates, which assume a trusted store (the validator's own), so that's the reason for the omission. We chatted about this question in a recent meeting, and while this isn't necessary to support querying object history, it will be for replaying a transaction against an untrusted store -- if that's something that we support, we should add the digest.
Broader fixes here will be a part of #6529 |