Skip to content

[3/n][object runtime type tags] Add type tags to object runtime update adapter to handle them #22092

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

Merged
merged 2 commits into from
May 14, 2025

Conversation

tzakian
Copy link
Contributor

@tzakian tzakian commented May 9, 2025

Description

This updates the object runtime to only hold TypeTags (or MoveObjecTypes where appropriate) instead of VM runtime Types.

It's generally a pretty straightforward change, however there are a couple places worth calling out specifically and I've done so in-line.

Test plan

CI + adding new tests to make sure type tags coming from the object runtime are correctly resolved in newly-published packages.


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: add a new feature flag that switches the object runtime to using TypeTags instead of VM runtime types.
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@tzakian tzakian requested review from tnowacki and a team May 9, 2025 19:54
@tzakian tzakian requested a review from mystenmark as a code owner May 9, 2025 19:54
Copy link

vercel bot commented May 9, 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 May 14, 2025 11:07pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 14, 2025 11:07pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 14, 2025 11:07pm

@tzakian tzakian temporarily deployed to sui-typescript-aws-kms-test-env May 9, 2025 19:54 — with GitHub Actions Inactive
@@ -910,6 +929,13 @@ mod checked {
written_objects.insert(id, object);
}

for package in new_packages {
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 got moved down as we need to use new_package up above when loading the type. This shouldn't have any effect, but double check me 🙏🏻

protocol_config: &ProtocolConfig,
ty: Result<Type, ExecutionError>,
) -> Result<Type, ExecutionError> {
if ty.is_err() && !protocol_config.type_tags_in_object_runtime() {
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 should never happen, but just to be paranoid, panic in case it does and we're before this feature is enabled

// they were published in the current transaction). Note that this needs to load `MovePackage`s and
// not `MovePackageObject`s.
pub trait PackageStore {
fn get_package(&self, id: &ObjectID) -> SuiResult<Option<Rc<MovePackage>>>;
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 will be used in future PRs as well. This will be quite useful for e.g., caching layers and a lot more ;)

@tzakian tzakian force-pushed the tzakian/type-tags-obj-runtime3 branch from 6ea7e45 to 34db4dc Compare May 9, 2025 20:04
@tzakian tzakian temporarily deployed to sui-typescript-aws-kms-test-env May 9, 2025 20:04 — with GitHub Actions Inactive
@tzakian tzakian force-pushed the tzakian/type-tags-obj-runtime2 branch from 0f6c369 to 6e2ed2f Compare May 9, 2025 21:28
@tzakian tzakian force-pushed the tzakian/type-tags-obj-runtime3 branch from 34db4dc to f229416 Compare May 9, 2025 21:28
Base automatically changed from tzakian/type-tags-obj-runtime2 to main May 9, 2025 22:02
@tzakian tzakian force-pushed the tzakian/type-tags-obj-runtime3 branch from f229416 to 4da3d3b Compare May 9, 2025 22:57
@tzakian tzakian temporarily deployed to sui-typescript-aws-kms-test-env May 9, 2025 22:57 — with GitHub Actions Inactive
@tzakian tzakian force-pushed the tzakian/type-tags-obj-runtime3 branch from 2053106 to 9b50333 Compare May 14, 2025 23:04
@tzakian tzakian temporarily deployed to sui-typescript-aws-kms-test-env May 14, 2025 23:04 — with GitHub Actions Inactive
@tzakian tzakian merged commit b4ea7a4 into main May 14, 2025
53 checks passed
@tzakian tzakian deleted the tzakian/type-tags-obj-runtime3 branch May 14, 2025 23:36
tzakian pushed a commit that referenced this pull request May 16, 2025
…me update adapter to handle them (#22092)" and "[sui-adapter] Add basic package cache (#22099)"

This reverts commit b4ea7a4.
@tzakian tzakian restored the tzakian/type-tags-obj-runtime3 branch May 19, 2025 18:27
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