Skip to content

Conversation

cgswords
Copy link
Contributor

Description

This refactors a large part of the execution AST in order to change every index in the bytecode to use a VM pointer instead. On the way, we also completely revised how types are stored in vtables and wrote down type definition IDs. The tracer and evaluator got much-simplified, but the translation had to change dramatically to accommodate.

Test plan

All the tests still pass. I plan to use ASAN / valgrind on this code in the coming days to ensure no memory is leaked.


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:

@cgswords cgswords requested a review from tzakian February 14, 2025 00:43
Copy link

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

DUPLICATE_NATIVE_FUNCTION = 2022,
ARITHMETIC_OVERFLOW = 2023,
DUPLICATE_TYPE_DEFINITION = 2050,
VTABLE_KEY_LOOKUP_ERROR = 2033,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably change this to a different number, it feels like 2024 or 2051 would fit better.

Also, why is there a jump from 2023 to 2050... 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to 2024

module_name,
member_name,
},
match &self.datatype_info.inner_ref() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this the same as qualified_name above? Understandable if you don't want to remove this in this PR, but maybe add a TODO for it (or reuse it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

Comment on lines +1014 to +1016
Datatype::Enum(ptr) => ptr.def_vtable_key.inner_pkg_key,
Datatype::Struct(ptr) => ptr.def_vtable_key.inner_pkg_key,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider rewriting in terms of qualified_name possibly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would technically clone the whole key instead of just the inner key, which is a much larger copy.

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