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

[move] Make usage of move serialization version explicit #17502

Merged
merged 1 commit into from
May 7, 2024

Conversation

tzakian
Copy link
Contributor

@tzakian tzakian commented May 3, 2024

Description

Require explicit binary version when serializing Move modules.

Test plan

Make sure existing tests pass.


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):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@tzakian tzakian requested review from cgswords, tnowacki, dariorussi and a team May 3, 2024 19:51
@tzakian tzakian requested a review from mystenmark as a code owner May 3, 2024 19:51
Copy link

vercel bot commented May 3, 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 3, 2024 9:40pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:40pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:40pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:40pm

Comment on lines +46 to +48
let version = if config.bytecode_version > VERSION_6 {
module.version
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unreachable currently, yeah?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct!

@@ -66,6 +69,7 @@ impl Default for VerifierConfig {
max_idenfitier_len: Some(DEFAULT_MAX_IDENTIFIER_LENGTH),
allow_receiving_object_id: true,
reject_mutable_random_on_entry_functions: true,
bytecode_version: VERSION_MAX,
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work when we cut a version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Normally when cutting an execution version, however when adding a new bytecode_version we will need to manually fix the bytecode_version in previous versions to the particular VERSION_MAX at the time they were cut. Overall I don't view this as too big of an issue though since when adding a new bytecode version a bunch of stuff needs to change all over the place anyways.

@tzakian tzakian merged commit 2726269 into main May 7, 2024
46 of 47 checks passed
@tzakian tzakian deleted the tzakian/explicit-move-version-ser branch May 7, 2024 16:33
benr-ml pushed a commit that referenced this pull request May 8, 2024
## Description 

Require explicit binary version when serializing Move modules.

## Test plan 

Make sure existing tests pass. 

---

## 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): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
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