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

[json] Add modified_at_versions to SuiTransactionEffects #7237

Closed
wants to merge 1 commit into from

Conversation

tnowacki
Copy link
Contributor

@tnowacki 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
@tnowacki tnowacki requested a review from patrickkuo January 9, 2023 00:17
@vercel
Copy link

vercel bot commented Jan 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated
explorer-storybook ⬜️ Ignored (Inspect) Jan 9, 2023 at 0:18AM (UTC)
wallet-adapter ⬜️ Ignored (Inspect) Jan 9, 2023 at 0:18AM (UTC)

// 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)>,
Copy link
Contributor Author

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?

Copy link
Contributor

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,
Copy link
Collaborator

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.

Copy link
Member

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.

@tnowacki
Copy link
Contributor Author

tnowacki commented Jan 9, 2023

Broader fixes here will be a part of #6529

@tnowacki tnowacki closed this Feb 14, 2023
@tnowacki tnowacki deleted the modified-at-versions branch March 31, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants