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

Migrate to move v6 and u16, u32, u256 support #5659

Merged
merged 10 commits into from
Oct 31, 2022
Merged

Migrate to move v6 and u16, u32, u256 support #5659

merged 10 commits into from
Oct 31, 2022

Conversation

oxade
Copy link
Contributor

@oxade oxade commented Oct 29, 2022

After ensuring Move v6 types are backward compatible and not breaking existing Sui, we're now ready to migrate to Move v6.
This enables newer features including new integer support like u16, u32, u256.
Follow up PRs will flesh out new integer support for Typescript modules & apps if needed.

@oxade oxade changed the title Migrate to move v6 Migrate to move v6 and u16, u32, u256 support Oct 29, 2022
@oxade oxade mentioned this pull request Oct 29, 2022
@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label Oct 31, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2022

⚠️ 🦋 Changesets Warning: This PR has changes to public npm packages, but does not contain a changeset. You can create a changeset easily by running pnpm changeset, and following the prompts. If your change does not need a changeset (e.g. a documentation-only change), you can ignore this message. This warning will be removed when a changeset is added to this pull request.

Learn more about Changesets.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2022

💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3358431058#artifacts

@oxade oxade marked this pull request as ready for review October 31, 2022 04:22
@oxade oxade requested a review from randall-Mysten as a code owner October 31, 2022 04:22
@oxade
Copy link
Contributor Author

oxade commented Oct 31, 2022

@damirka I could use some feedback on the BCS TS module please.
Also is the TS BCS support blocking for landing this support in other areas?

Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, but I'm not personally familiar with this process of updating our move integration, so holding off on the stamp for that reason.

crates/sui-framework/sources/math.move Show resolved Hide resolved
crates/sui-framework/tests/math_tests.move Show resolved Hide resolved
@@ -591,5 +619,5 @@ fn convert_string_to_u128(s: &str) -> Result<u128, anyhow::Error> {
if !s.starts_with(HEX_PREFIX) {
bail!("Unable to convert {s} to unsigned int.",);
}
u128::from_str_radix(s.trim_start_matches(HEX_PREFIX), 16).map_err(|e| e.into())
U256::from_str_radix(s.trim_start_matches(HEX_PREFIX), 16).map_err(|e| e.into())
Copy link
Member

Choose a reason for hiding this comment

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

Is there a performance implication to changing from a built-in type to the library type here? Maybe not something we care about, but I wanted to check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There probably is. I can try to benchmark this and follow up with a tweak if needed.

@@ -7,8 +7,11 @@ import { SuiObjectRef } from './objects';

bcs
.registerVectorType('vector<u8>', 'u8')
.registerVectorType('vector<u16>', 'u16')
Copy link
Member

Choose a reason for hiding this comment

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

Heads up @damirka, potential merge conflict with your recent BCS TS library work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! I expected this to happen and will use "theirs".

@oxade oxade added the rust-sdk label Oct 31, 2022
Copy link
Contributor

@damirka damirka left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Multiple vector definitions will go away once #5427 is landed.

@oxade oxade merged commit aa807cf into main Oct 31, 2022
@oxade oxade deleted the migrate_to_move_v6 branch October 31, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move rust-sdk ts-sdk Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants