-
Notifications
You must be signed in to change notification settings - Fork 148
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
Update usize
serialization and deserialization
#1266
Conversation
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.
Thank you! Looks good. I left a few comments inline.
Also, I think we can roll back the AST-related changes as these will not be needed after the assembler refactoring that @bitwalker is working on.
7d27b42
to
da18d4d
Compare
852d1ee
to
82e71b8
Compare
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.
Thank you! Looks good. I left a few more comments inline.
68a993f
to
024c631
Compare
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.
Looks good! Thank you! I left a few minor nits related to naming inline. Once these are addressed, we can merge.
core/src/stack/inputs.rs
Outdated
// CONSTANTS | ||
// -------------------------------------------------------------------------------------------- | ||
|
||
pub const MAX_STACK_INPUTS_SIZE: usize = u16::MAX as usize; |
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.
The naming is a bit redundant here - e.g., StackInputs::MAX_STACK_INPUTS_SIZE
. I would probably change this to something like MAX_LEN
and then it would be StackInputs::MAX_LEN
.
core/src/stack/outputs.rs
Outdated
// CONSTANTS | ||
// -------------------------------------------------------------------------------------------- | ||
|
||
pub const MAX_STACK_OUTPUTS_SIZE: usize = u16::MAX as usize; |
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.
Same comment as above - probably MAX_LEN
would be sufficient here.
core/src/stack/inputs.rs
Outdated
/// # Errors | ||
/// Returns an error if: | ||
/// - The values do not represent a valid field element. | ||
/// - Number of values in the iterator exceeds the allowed maximum number of input values. | ||
pub fn try_from_values<I>(iter: I) -> Result<Self, InputError> |
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.
I just noticed that StackOutputs
has try_from_ints()
method. So, we should either name this one try_from_ints()
or rename the other one into try_from_values()
. I think the first option is probably a bit better.
024c631
to
bc11f61
Compare
bc11f61
to
b0df9b8
Compare
refactor: serialize usize with write_usize (#1266)
refactor: serialize usize with write_usize (#1266)
refactor: serialize usize with write_usize (#1266)
This PR changes the serialization and deserialization method of
usize
values towrite_usize()
andread_usize()
respectively.