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

Record start version for new ConsensusV2 object streams #21614

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

aschran
Copy link
Contributor

@aschran aschran commented Mar 26, 2025


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Sorry, something went wrong.

@aschran aschran requested review from tnowacki and mystenmark March 26, 2025 15:18
Copy link

vercel bot commented Mar 26, 2025

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 5:40pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Mar 27, 2025 5:40pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Mar 27, 2025 5:40pm

..
}) = input_objects.get(id).map(|obj| &obj.owner)
{
*start_version = *previous_start_version;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason that start_version may not be equal to previous_start_version here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I can think of, but I copied that logic from the shared object case above to be safe

Is there a reason that it can differ for the shared objects or could all of this be simplified?

Copy link
Contributor

@tnowacki tnowacki Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the answer is "reshares" but maybe @tzakian would remember

EDIT: Yeah that looks to be the case, it might have been zero-d out in the reshare case, but we need to preserve the original initial_shared_version for that case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right that makes sense. In this case "reshare" may not even be dumb/extraneous, because you could be transferring it to a new owner/authenticator but still keeping the same ownership type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so I think the only cases were we need to preserve this are when the "owner" doesn't change, so that any transactions previously scheduled for execution don't fail?
I am presuming here that if the start_version doesn't match the start_version of the argument that we will fail in a similar manner as if a shared object was deleted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tnowacki Could you remind me what "reshare" means here?
In anyway it would be good to document the context as comment there. I am sure I will forget about this in a few months.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider this move function

public fun foo(o: MySharedObj) {
    sui::transfer::share_object(o)
}

A "reshare" is when foo is called with an input object that is a shared object (and it couldn't be any other kind of input object because we do not support upgrades currently)

This case became possible once we allowed shared objects to be taken by-value to enable shared object deletion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lxfind added a comment per your suggestion

@aschran aschran requested a review from lxfind March 26, 2025 19:14
@aschran aschran temporarily deployed to sui-typescript-aws-kms-test-env March 27, 2025 17:02 — with GitHub Actions Inactive
@tnowacki
Copy link
Contributor

LGTM, but let's make sure the comments seem fine to @lxfind--and if he wants something similar on the share object case (even though it isn't new in this PR)

}) = input_objects.get(id).map(|obj| &obj.owner)
{
// Assign existing start_version in case a ConsensusV2 object was
// re-transferred to the same Owner type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you mentioned since you could be transferring it to another address but still in the form of ConsensusV2 type, "re-transferred" seems inaccurate here. (which applies better to the old shared object case)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you say more about the inaccuracy? in case you transfer to another SingleOwner address with ConsensusV2 type, we still want this condition to trigger and preserve the original start_version, so as far as I can tell this is accurate as written?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make more sense if I just wrote "transferred" instead of "re-transferred"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing to "transferred" as agreed on chat

@aschran aschran force-pushed the aschran/cov2-start-version branch from 79e8744 to 4e97ffe Compare March 27, 2025 17:39
@aschran aschran temporarily deployed to sui-typescript-aws-kms-test-env March 27, 2025 17:39 — with GitHub Actions Inactive
@aschran aschran enabled auto-merge (squash) March 27, 2025 17:39
@aschran aschran merged commit 3f57cb5 into main Mar 27, 2025
47 checks passed
@aschran aschran deleted the aschran/cov2-start-version branch March 27, 2025 18:08
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.

None yet

4 participants