-
Notifications
You must be signed in to change notification settings - Fork 42
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 TransactionVerifier
#180
Conversation
754dde0
to
e42f42a
Compare
e42f42a
to
d7974bc
Compare
miden-tx/src/compiler/mod.rs
Outdated
@@ -322,6 +304,65 @@ impl TransactionComplier { | |||
NoteTarget::Procedures(procs) => Ok(procs), | |||
} | |||
} | |||
|
|||
// HELPERS |
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 already have HELPERS
section defined above.
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 great! Thank you! I left a few small comments inline. Once these are addressed, we can merge.
miden-tx/src/compiler/mod.rs
Outdated
/// Returns a [ProgramInfo] which contains the hash of the transaction program associated with | ||
/// the provided consumed notes hashes and transaction script hash and the kernel. | ||
pub fn build_program_info( | ||
&self, | ||
notes: Vec<Digest>, | ||
tx_script_hash: Option<Digest>, | ||
) -> ProgramInfo { |
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.
nit: both in the comment and in the parameter name we use notes
- but these are actually note script hashes, right? If so, should we call them note_script_hashes
?
miden-tx/src/compiler/mod.rs
Outdated
let mut note_hashes = Vec::new(); | ||
let mut note_roots = Vec::new(); |
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.
nit: should we rename these into note_script_hashes
and note_programs
?
miden-tx/src/compiler/mod.rs
Outdated
/// Returns a [CodeBlock] which represents the note program tree. | ||
fn build_note_program_tree(&self, note_hashes: Vec<Digest>) -> CodeBlock { |
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 nit as above: should these be called note_script_hashes
?
miden-tx/src/verifier/mod.rs
Outdated
pub struct TransactionVerifier { | ||
compiler: TransactionComplier, | ||
} |
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 wonder if we should add a field to mandate proof security level (e.g., proof_security_level: u32
). This way, instead of returning it from the verify()
method, we would reject the proofs which don't meet the required security level.
We'll probably make it a bit more sophisticated in the future, once this issue is addressed in Winterfell.
d7974bc
to
74af9ef
Compare
closes: #172