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

Nonce does not increment during the pre_dispatch but rather increments once the execution is complete #1405

Open
vedhavyas opened this issue Apr 25, 2024 · 0 comments
Labels

Comments

@vedhavyas
Copy link
Contributor

Question
We recently noticed a nonce increment issue on pre_disptach. It seems like nonce does not increment during pre_dispatch but rather increments after nonce. This is bit of deviation from Substrate where nonce increments during the pre_dispatch.
I think I understand that EVM does this automatically but will there be an issue if the nonce increment is moved to pre_dispatch instead ?

In Subspace, we have an EVM chain as an enshrined rollup. We do pre_dispatch before including the transactions into the Subspace chain block and once the block is imported, we derive the eth block from the Subspace block.
To ensure only valid transactions are included, we do pre_dispatch. Unfortunately, if there are any transactions with future nonces, all those fail at pre_dispatch.

Are there any concerns or potential solutions to make the pre_dispatch behave like Substrate instead ? This would not be breaking any existing chains since the pre_dispatch and execution are done at the same time.

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

No branches or pull requests

1 participant