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

Implement serialization/deserialization for Operation #1390

Merged
merged 10 commits into from
Jul 11, 2024

Conversation

plafer
Copy link
Contributor

@plafer plafer commented Jul 10, 2024

As described in #1370 (comment)

@plafer plafer requested a review from bobbinth July 10, 2024 17:01
@plafer plafer mentioned this pull request Jul 10, 2024
Copy link
Contributor

@bobbinth bobbinth left a 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.

@bobbinth bobbinth requested a review from Fumuran July 10, 2024 18:54
Copy link
Contributor

@Fumuran Fumuran left a 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
Comment on lines 103 to 104
pub use operations::opcode_constants::*;
pub use operations::{
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -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};

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@plafer plafer force-pushed the plafer-fix-operation-deserialize branch from fd38ded to 634b1b6 Compare July 10, 2024 21:28
@plafer plafer changed the base branch from plafer-mast-forest-serialization to next July 10, 2024 21:28
@plafer plafer changed the title Cleanup Operation deserialization Implement serialization/deserialization for Operation Jul 10, 2024
@plafer
Copy link
Contributor Author

plafer commented Jul 10, 2024

Rebased onto next; ready for another review!

@plafer plafer requested review from bobbinth and Fumuran July 10, 2024 21:55
Copy link
Contributor

@bobbinth bobbinth left a 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,
Copy link
Contributor

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::*;
}

@bobbinth bobbinth merged commit bbd3bb7 into next Jul 11, 2024
15 checks passed
@bobbinth bobbinth deleted the plafer-fix-operation-deserialize branch July 11, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants