-
Notifications
You must be signed in to change notification settings - Fork 174
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
Implement serialization/deserialization for Operation
#1390
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.
Looks good! Thank you! I left a few small comments inline.
Also, would it be difficult to rebase it next
and then, once this is merged, rebase the MAST serialization PR from next
. This way, it will reduce the review surface of that PR.
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.
LGTM! Got just two formatting proposals.
core/src/lib.rs
Outdated
pub use operations::opcode_constants::*; | ||
pub use operations::{ |
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.
Probably we can join these two imports?
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.
done
core/src/mast/node/call_node.rs
Outdated
@@ -3,7 +3,8 @@ use core::fmt; | |||
use miden_crypto::{hash::rpo::RpoDigest, Felt}; | |||
use miden_formatting::prettier::PrettyPrint; | |||
|
|||
use crate::{chiplets::hasher, Operation}; | |||
use crate::chiplets::hasher; | |||
use crate::{OPCODE_CALL, OPCODE_SYSCALL}; | |||
|
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 noticed that in most of the node files you left this empty line between opcodes import and mast import. Was it intentional?
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.
No, actually I was assuming/hoping rustfmt
was aggressive enough to always give the same kind of formatting.
Fixed in all node files.
fd38ded
to
634b1b6
Compare
Operation
deserializationOperation
Rebased onto |
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 one comment inline but we can address this in the other PR.
@@ -101,8 +101,8 @@ pub mod prettier { | |||
|
|||
mod operations; | |||
pub use operations::{ | |||
AdviceInjector, AssemblyOp, DebugOptions, Decorator, DecoratorIterator, DecoratorList, | |||
Operation, SignatureKind, | |||
opcode_constants::*, AdviceInjector, AssemblyOp, DebugOptions, Decorator, DecoratorIterator, |
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'm a bit hesitant to export this many constants at the root level. Maybe we should export this as:
pub mod opcodes {
pub use super::operations::opcode_constants::*;
}
As described in #1370 (comment)