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

kernel: add support for delayed note inclusion checks #759

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

hackaugusto
Copy link
Contributor

@hackaugusto hackaugusto commented Jun 18, 2024

Implements the changes to the kernel's prologue, which are necessary to support delayed note inclusion. Along side some code and documentation improvements.

closes #353

Currently marked as a draft because this PR is lacking tests.

@hackaugusto hackaugusto requested a review from bobbinth June 18, 2024 13:47
@hackaugusto hackaugusto force-pushed the hacka-kernel-delayed-note-inclusion branch 3 times, most recently from 0362fd8 to 7d6f603 Compare June 20, 2024 10:34
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 some comments inline. Most of them are pretty minor. The main one is about the potential flaw in how input note commitment does not commit to metadata of notes with delayed inclusion proofs. I think we can tackle this problem in the next PR (and I'll write up some thoughts about how to do it in the issue itself).

So, let's address the smaller comments and merge.

miden-lib/asm/miden/kernels/tx/memory.masm Outdated Show resolved Hide resolved
miden-lib/asm/miden/kernels/tx/memory.masm Outdated Show resolved Hide resolved
miden-lib/asm/miden/kernels/tx/memory.masm Outdated Show resolved Hide resolved
miden-lib/asm/miden/kernels/tx/prologue.masm Show resolved Hide resolved
miden-lib/asm/miden/kernels/tx/prologue.masm Outdated Show resolved Hide resolved
miden-lib/asm/miden/kernels/tx/prologue.masm Outdated Show resolved Hide resolved
miden-lib/asm/miden/kernels/tx/prologue.masm Outdated Show resolved Hide resolved
Comment on lines +587 to +589
#! Note: The note's metadata is validated when the note is authenticated, since
#! the authentication is `hash(NOTE_ID || NOTE_METADATA)`. This is either done
#! by the procedure `authenticate_note` for or delayed to another kernel.
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing I just realized: input notes commitment does not commit to the metadata of notes with delayed inclusion proofs. I haven't thought this through entirely - but this may be a problem as whoever executes the transaction could set the metadata for such notes to arbitrary values.

If it is a problem, we'll need to include note metadata into the input notes commitment as well somehow.

@hackaugusto hackaugusto force-pushed the hacka-kernel-delayed-note-inclusion branch from 7d6f603 to 37fb5f1 Compare June 21, 2024 15:25
@bobbinth bobbinth marked this pull request as ready for review June 21, 2024 21:18
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 will merge this PR. We can add tests and make any potential refactorings in a follow-up PR.

@bobbinth bobbinth merged commit d3727db into next Jun 21, 2024
12 checks passed
@bobbinth bobbinth deleted the hacka-kernel-delayed-note-inclusion branch June 21, 2024 21:41
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.

2 participants