-
Notifications
You must be signed in to change notification settings - Fork 41
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
feature: add conditional support for serde #180
Conversation
7b7b693
to
19f7a68
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.
Left a suggestion inline. Let me know what you think.
7109eca
to
9e53d0a
Compare
some notes:
I now have to look how to skip encoding the inner nodes of the trees / merkle store edit: for the time being we are serializing the whole structures, if it becomes a necessity skipping the inner nodes can be implemented |
9e53d0a
to
1e77341
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 question/comment inline - if you agree, we can implement these checks and merge.
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! Would be good if we can leverage the hex utilities you have introduced for midne-vm
as currently have a bit of logic duplication.
impl std::error::Error for HexParseError {} | ||
|
||
/// Parses a hex string into an array of bytes of known size. | ||
pub fn hex_to_bytes<const N: usize>(value: &str) -> Result<[u8; N], HexParseError> { |
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.
We have a similar utility downstream in miden-vm
. Would be good if we can purge that and leverage this. https://github.com/0xPolygonMiden/miden-vm/blob/105ee9e241fafeac97fbcd14861b2eaed5548e1e/assembly/src/ast/parsers/labels.rs#L77-L93
1e77341
to
8cf5e9f
Compare
Describe your changes
Adds conditional support to serde. This can be used to serialize the data as JSON to encode the mock chain data.
This depends on facebook/winterfell#209
Checklist before requesting a review
next
according to naming convention.