-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
introduce the new integer types (u16, u32 & u256) #5626
Conversation
api/types/src/derives.rs
Outdated
A string containing a 256-bit unsigned integer. | ||
|
||
We represent u256 values as a string to ensure compatibility with languages such | ||
as JavaScript that do not parse u64s in JSON natively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this needs to be cleaned up for u64 -> u256
7db1901
to
7c6dd75
Compare
4bfb359
to
81255df
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
U64 => "uint64".into(), | ||
U128 => "serde.Uint128".into(), | ||
U256 => unimplemented!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a followup issue for U256 support for the go generator btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -143,7 +158,7 @@ describe("BuilderUtils", () => { | |||
}).toThrow("Invalid type tag."); | |||
|
|||
expect(() => { | |||
new TypeTagParser("u32").parseTypeTag(); | |||
new TypeTagParser("u3").parseTypeTag(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be u32
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentional. It's a test trying to parse an invalid type tag.
|
||
/// Specify the version of the bytecode the compiler is going to emit. | ||
#[clap(long)] | ||
pub bytecode_version: Option<u32>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. By default, this flag is not set and the cli will tell the move compiler to use bytecode version 5 so to maintain compatibility with our current testnet and mainnet. The user can however, opt into version 6 using this flag if they want to try out the new integer types.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Overview
Support for the missing integer types (u16, u32 & u256) has landed in upstream Move. This PR brings them into
aptos-core
and makes other Move dependencies up to date.Backward Compatibility
This introduces a new gas schedule version (5) and a new feature flag
VM_BINARY_FORMAT_V6
. The VM will only start to accept the new binary format version if both conditions are met.Work Items
This change is