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

No need to pass nonce to execute #3

Closed
martriay opened this issue Oct 13, 2021 · 3 comments
Closed

No need to pass nonce to execute #3

martriay opened this issue Oct 13, 2021 · 3 comments

Comments

@martriay
Copy link

Jus as there is no need to pass this, nonce can also be omitted from execute arguments, since the contract already knows what's the only valid nonce. Maybe this changes in the future if Cairo implements revert messages, then we could do something like:

assert nonce = current_nonce, "Invalid nonce"

until that, there is no reason to have a nonce parameter.

@juniset
Copy link
Member

juniset commented Nov 2, 2021

I think that makes sense if there is only one valid nonce such as the currently implemented incremental nonce. But there are other possible nonce patterns so I think that if we want to be general with the execute method and make it part of a standard interface for accounts then we should not make any assumption about the nonce.

So I agree that there is no need to pass it now but I think we should keep it to anticipate future possible uses.

@frangio
Copy link

frangio commented Nov 2, 2021

@juniset Do you have examples of possible nonce patterns that would need it to be included?

@juniset
Copy link
Member

juniset commented Nov 3, 2021

@frangio you can have a nonce where the only requirement is that the nonce of a transaction must be greater than the previous one but not necessarily by 1. Or you can have a nonce whose requirement is that the transaction parameters, as computed by the message_hash, are unique and each executed message_hash is stored in a mapping.

We use these 2 different nonce strategies in the Argent wallet contract on L1.

@juniset juniset closed this as completed Nov 8, 2021
sgc-code pushed a commit that referenced this issue Aug 18, 2023
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

No branches or pull requests

3 participants