-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: Add note execution_hint
to store
#441
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.
LGTM! Left a couple minor comments. I also don't know if it's possible to easily test this (checking that storing/retrieval is correct) but it would be nice
crates/store/src/db/sql.rs
Outdated
@@ -589,9 +600,15 @@ pub fn select_notes_since_block_by_tag_and_sender( | |||
let merkle_path = MerklePath::read_from_bytes(merkle_path_data)?; | |||
let details_data = row.get_ref(9)?.as_blob_or_null()?; | |||
let details = details_data.map(<Vec<u8>>::read_from_bytes).transpose()?; | |||
let execution_hint = row.get_ref(10)?.as_i64()? as u64; |
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 think we can use column_value_as_u64()
here
crates/proto/src/domain/notes.rs
Outdated
@@ -26,8 +33,15 @@ impl From<NoteMetadata> for crate::generated::note::NoteMetadata { | |||
let sender = Some(val.sender().into()); | |||
let note_type = val.note_type() as u32; | |||
let tag = val.tag().into(); | |||
let execution_hint: u64 = Felt::from(val.execution_hint()).into(); |
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 think we can now replace this with
let execution_hint: u64 = val.execution_hint().into();
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
aux INTEGER NOT NULL, | ||
merkle_path BLOB NOT NULL, | ||
details BLOB, | ||
execution_hint INTEGER, |
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.
A couple of small comments:
- We should probably move
execution_hint
to be right afteraux
field since logically it is part of the note's metadata. - I think
execution_hint
should beNOT NULL
field as we always have an integer value for it.
crates/store/src/db/sql.rs
Outdated
details, | ||
execution_hint |
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.
Similar to the other comment, here, and in other places in this file, I'd probably move execution_hint
to be right after the aux
field.
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!
This fixes the faucet's and node build by doing the following:
execution_hint
field to Notes table.Closes #439 .
This PR is built on top of 0xPolygonMiden/miden-base#827 .
It is meant to be merged AFTER that PR.