besu icon indicating copy to clipboard operation
besu copied to clipboard

Increment private nonce even if transaction failed.

Open gtebrean opened this issue 1 year ago • 4 comments

PR description

Fixed Issue(s)

Fixes #1942

Classes to follow:

BesuCommand PrivacyParameters ForestMutableWorldState PrivateState PrivacyPrecompiledContract

Currently private nonce update applies only to Forest State

gtebrean avatar Feb 19 '24 11:02 gtebrean

  • [ ] 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.

github-actions[bot] avatar Feb 19 '24 11:02 github-actions[bot]

@pinges could you give feedback on this approach?

macfarla avatar Apr 23 '24 06:04 macfarla

This was raised and discussed in Besu Contributors call on April 16th, and some of the concerns were the following:

  1. Aligns with Ethereum standards.
  2. Security concerns if we submit a private nonce of a failing transaction.
  3. 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!

gtebrean avatar Apr 23 '24 11:04 gtebrean

@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.

gtebrean avatar May 24 '24 06:05 gtebrean