besu
besu copied to clipboard
Increment private nonce even if transaction failed.
PR description
Fixed Issue(s)
Fixes #1942
Classes to follow:
BesuCommand PrivacyParameters ForestMutableWorldState PrivateState PrivacyPrecompiledContract
Currently private nonce update applies only to Forest State
- [ ] I thought about documentation and added the
doc-change-required
label to this PR if updates are required. - [ ] I thought about the changelog and included a changelog update if required.
- [ ] If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests
- [ ] I thought about running CI.
- [ ] If I did not run CI, I ran as much locally as possible before pushing.
@pinges could you give feedback on this approach?
This was raised and discussed in Besu Contributors call on April 16th, and some of the concerns were the following:
- Aligns with Ethereum standards.
- Security concerns if we submit a private nonce of a failing transaction.
- Breaking current functionality.
I did some researches and the current approach applies at Private Transaction Processor level and will directly save only the private nonce in the world state without affecting other things, further more this will be enabled only when required by genesis file or flag.
Concerns would be also if someone would like to query for tx using that nonce.
Please add any other remark here in comments. Thank you!
@pinges @macfarla please take a look again to my implementation.
Implementation is done and works for Forest state, if you agree with the approach I will do it also for Bonsai.