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

[sui-adapter] Resolve Move abort locations to package ID instead of runtime ID #17884

Merged
merged 2 commits into from
May 23, 2024

Conversation

tzakian
Copy link
Contributor

@tzakian tzakian commented May 22, 2024

Description

Updates Move aborts so that the address in the abort location uses the package ID as opposed to the runtime module ID.

Basically, before if you had a package P with a module M

module P::M {
  public fun aborter() { abort 0 }
}

published at 0xA for version 1, 0xB for version 2, and 0xC for version 3, then before this change

0xA::aborter().location.address == 0xA
0xB::aborter().location.address == 0xA
0xC::aborter().location.address = 0xA

After this change

0xA::aborter().location.address == 0xA
0xB::aborter().location.address == 0xB
0xC::aborter().location.address == 0xC

The only meaningful changes are in sui-execution/latest/sui-adapter/src/error.rs the other changes are just plumbing/protocol config updates and tests.

Test plan

Added tests to make sure existing behavior is preserved, and that new behavior works as expected.


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: Added new protocol version (47) and enabled resolving Move abort locations to their package ID instead of runtime ID.
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@tzakian tzakian requested review from amnn, tnowacki and a team May 22, 2024 19:45
@tzakian tzakian requested a review from mystenmark as a code owner May 22, 2024 19:45
Copy link

vercel bot commented May 22, 2024

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 May 23, 2024 3:47am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 23, 2024 3:47am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 23, 2024 3:47am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 23, 2024 3:47am

sui-execution/latest/sui-adapter/src/error.rs Outdated Show resolved Hide resolved
@@ -13,7 +13,7 @@ use tracing::{info, warn};

/// The minimum and maximum protocol versions supported by this build.
const MIN_PROTOCOL_VERSION: u64 = 1;
const MAX_PROTOCOL_VERSION: u64 = 46;
const MAX_PROTOCOL_VERSION: u64 = 47;
Copy link
Contributor

Choose a reason for hiding this comment

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

With the cut tomorrow, was surprised you needed to do this, but makes a bit of sense I suppose looking at what was enabled in 46

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, was likewise surprised that there wasn't a protocol version sitting already for the cut. But yea, we definitely need to protocol config this change since it will change transaction effects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course there is now a merge conflict on another PR that landed that added 47... 🎉

@tzakian tzakian force-pushed the tzakian/resolve-abort-code-pkg-id branch from af0cfa6 to 8a03b18 Compare May 23, 2024 03:45
@tzakian tzakian merged commit be586e7 into main May 23, 2024
48 checks passed
@tzakian tzakian deleted the tzakian/resolve-abort-code-pkg-id branch May 23, 2024 04:10
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.

2 participants