Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Add a State::set_nonce_at method #1772

Open
tdelabro opened this issue Apr 8, 2024 · 0 comments
Open

Add a State::set_nonce_at method #1772

tdelabro opened this issue Apr 8, 2024 · 0 comments

Comments

@tdelabro
Copy link
Contributor

tdelabro commented Apr 8, 2024

When using a transactional state you end up with state changes that include an address nonce going from value n to value n + x, where x can be a number between n and a lot.

The State trait only exposes the increment_nonce method to interact with this specific storage. This means that if I want to apply my state changes to my actual storage I will have to keep calling increment_nonce inside a loop until it reaches the correct value. This is a very bad API. A set_nonce_at method should be exposed in order to set the new value in a single write.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant