-
Notifications
You must be signed in to change notification settings - Fork 446
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
Disable NonceGap check for internal transactions #4926
Conversation
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.
We have a bug in incrementing nonces. When receiving eth_sendTransaction
:
https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.cs#L325
we firstly reserve nonce:
https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.TxPool/TxPoolSender.cs#L24
https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.TxPool/TxNonceTxPoolReserveSealer.cs#L37
and then go to the filters (filters are in SubmitTx)
:
https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.TxPool/TxPoolSender.cs#L25
If tx is rejected in filters, nonce remains incremented and for next transactions send from this endpoint nonce will be incorrect. In this form (not rejecting nonce-gap transactions) we will accept this new tx with higher nonce, but it will never be processed, as lower nonce doesn't exist, so it will be some kind of invalid in a hidden way, without notice to the sender
# Conflicts: # src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs
Any update on this? @marcindsobczak @deffrian |
@gituser I'm working on it right now:) |
There is a conflict to be resolved @deffrian |
# Conflicts: # src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs
@marcindsobczak merged |
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.
There is a regression in POSDAO tests.
Post-merge POSDAO - I tried 2 times and have 2 fails:
https://github.com/NethermindEth/nethermind/actions/runs/3647856241/jobs/6160583037
https://github.com/NethermindEth/nethermind/actions/runs/3647926505/jobs/6160732425
From master we are passing it:
https://github.com/NethermindEth/nethermind/actions/runs/3647922863/jobs/6160723733
Pre-merge POSDAO - fails as well:
https://github.com/NethermindEth/nethermind/actions/runs/3647857359/jobs/6160585145
And pass from master:
https://github.com/NethermindEth/nethermind/actions/runs/3647923297/jobs/6160724754
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.
One more regression - in hive transition tests.
This branch fails:
https://github.com/NethermindEth/nethermind/actions/runs/3648552791/jobs/6162106175
Master pass:
https://github.com/NethermindEth/nethermind/actions/runs/3648553594/jobs/6162107696
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.
I think this design has its own problems as highlighted in the review. Do we need Set of nonces at all? Maybe we should follow what Geth is doing and always store local transactions in the pool?
Other than that it has bugs and missed things that could be improved.
src/Nethermind/Nethermind.Consensus.AuRa/InitializationSteps/InitializeBlockchainAuRa.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # src/Nethermind/Nethermind.Facade.Test/TxPoolBridgeTests.cs
# Conflicts: # src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs
Fixes | Closes | Resolves #
Changes:
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyTesting
Tested manually with sepolia node.
Hive tests: rpc, rpc-compat
Requires testing
In case you checked yes, did you write tests??