Skip to content

Implement account_get_native_id and account_get_native_nonce kernel procedures#1844

Merged
bobbinth merged 8 commits intonextfrom
andrew-impl-native-id-and-nonce-getters
Sep 6, 2025
Merged

Implement account_get_native_id and account_get_native_nonce kernel procedures#1844
bobbinth merged 8 commits intonextfrom
andrew-impl-native-id-and-nonce-getters

Conversation

@Fumuran
Copy link
Contributor

@Fumuran Fumuran commented Sep 2, 2025

This PR implements two new kernel procedures:

  • account_get_native_id returns the ID of the native account
  • account_get_native_nonce returns the nonce of the native account

TODO:

  • Update the protocol library file.

Closes: #1836

@Fumuran Fumuran marked this pull request as ready for review September 3, 2025 17:56
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 mostly reviewed non-test code and left some small comments inline.

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter 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 to me!

Only comments regarding AccountBuilder and some test nits. I only left nits for the ID tests, but they basically also apply to the nonce test. Very nice tests, though 🎉!

end

#! Returns the id of the native account.
#! Returns the account nonce.
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter Sep 4, 2025

Choose a reason for hiding this comment

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

Suggested change
#! Returns the account nonce.
#! Returns the current account's nonce.

Nit

Edit: Or better match it to how we write it for the native account.

@Fumuran
Copy link
Contributor Author

Fumuran commented Sep 5, 2025

@bobbinth one question about value names in our api file, kernel and miden libraries: sometimes we use the "full form" for them (like native_account_nonce or account nonce) instead of the short version (just nonce). I think it would be better to unify their naming, so wanted to ask which form do you prefer. Judging by your "nit: I think just [nonce] is fine." comment you prefer the short version, but I just wanted to make sure, because sometimes we remove just "current_"/"native_" prefix (like in native_account_id), and sometimes we remove the entire "current_account_"/"native_account_" prefix (like in native_account_nonce).

@bobbinth
Copy link
Contributor

bobbinth commented Sep 5, 2025

@bobbinth one question about value names in our api file, kernel and miden libraries: sometimes we use the "full form" for them (like native_account_nonce or account nonce) instead of the short version (just nonce). I think it would be better to unify their naming, so wanted to ask which form do you prefer. Judging by your "nit: I think just [nonce] is fine." comment you prefer the short version, but I just wanted to make sure, because sometimes we remove just "current_"/"native_" prefix (like in ~native_~account_id), and sometimes we remove the entire "current_account_"/"native_account_" prefix (like in ~native_account_~nonce).

Not a strong preference, but if the context is easy to infer from the surrounding code/comments, I'd go for a shorter version. For example, if the procedure name is get_native_account_nonce, when we describe the return value of the procedure, using just nonce is fine.

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.

All looks good! Thank you!

@bobbinth bobbinth merged commit e491266 into next Sep 6, 2025
18 checks passed
@bobbinth bobbinth deleted the andrew-impl-native-id-and-nonce-getters branch September 6, 2025 04:36
@bobbinth bobbinth mentioned this pull request Sep 6, 2025
6 tasks
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.

Add account_get_native_id and account_get_native_nonce kernel procedures

3 participants