-
Notifications
You must be signed in to change notification settings - Fork 145
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
Handling and externalisation improvements for account nonce updates #844
Conversation
Signed-off-by: Stoyan Panayotov <[email protected]>
✅ Deploy Preview for hedera-hips ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Signed-off-by: Stoyan Panayotov <[email protected]>
Signed-off-by: Stoyan Panayotov <[email protected]>
Signed-off-by: Stoyan Panayotov <[email protected]>
…er nonce Signed-off-by: Stoyan Panayotov <[email protected]>
Signed-off-by: Stoyan Panayotov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, some suggestions.
|
||
When importing legacy transactions that don't have this field, the Mirror node should consider whether the transaction result is SUCCESS or CONTRACT_REVERT_EXECUTED and increment the signer nonce in these cases. Some statuses such as INSUFFICIENT_GAS can be returned both before and after entering the EVM, there is no way for the Mirror node to know whether the signer nonce should be updated. This was the root cause of multiple issues and the reason for the new protobuf field. | ||
|
||
The Mirror node will continue to serve outdated nonce information for some accounts and will provide accurate nonces for accounts that have signed valid EthereumTransactions post this HIP implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add a note to show users how to unblock themselves to submit a transaction when they have a wrong nonce.
HAPI account call or the error message from the relay on a submitted transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
|
||
### Services update | ||
|
||
1. Move the signer nonce update to be right before this code block that starts the transaction execution in the EVM: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of requiring a single line prior to this that could be refactored accidentally should we extract it to a single method that increments and initiates process e.g. nonceIncrementAndEvmProcess()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea. But actually, I haven't analysed the modularised codebase implementation of the transaction processor and can't provide exact steps for the implementation fix. Should we leave this for the design doc/work package definition?
|
||
## Motivation | ||
|
||
Unclear rules for when the nonce of an EthereumTransaction signer account should be updated result in discrepancies between the Consensus nodes' and Mirror nodes' states. This leads to users experiencing issues when reading the account nonce from the Mirror node and trying to use it in a transaction sent to the Consensus node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Should we consider listing the error case from the HAPI side and relay that are symptomatic of the problem.
In this way some users might link the issue back to the resolution from this HIP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the error in the Backward Compatibility section.
Signed-off-by: Stoyan Panayotov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ashgraph#844) Signed-off-by: Stoyan Panayotov <[email protected]> Co-authored-by: Michael Garber <[email protected]> Signed-off-by: Kim Rader <[email protected]>
Description:
Introduce rules for when to update an Ethereum transaction signer's nonce and a new field for externalising the nonce update in the record stream. This will help resolve issues where the Consensus nodes and the Mirror nodes are out of sync in regards to what the current value of an account's nonce is.
Related issue(s):
Fixes #
Notes for reviewer:
Checklist