-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Accounts stuck in weird state after debug_setHead
#26154
Comments
Well, I think the problem here is that
It was never intended to be used as a snapshotting-tool to jump back in time. What it sounds like, is that the txpool state tracker does not function ideally, like you've already seen with the comment here:#22247 . Anyway, what I kind of mean is that yes, we'll fix this and/or accept a PR to get this fixed, but it's not a high-prio usecase for us, because it's borderline abusing the feature. Depending on what you want to achieve, there are probably other ways of doing it. |
I am really interested in this! Do you have any advice for how to implement a snapshotting system using only Geth? |
First of all is to run it (Because if your usecase is to actually go back in time , then is really a blockchain the right abstraction?) |
I am trying to do the same as |
I never use ganache/hardhat, so 🤷 , have no idea how that works in practice. IMO you could just run whatever you want to on state X, without actually rolling back to it. |
I think they want to do as below:
So I guess |
I use Hardhat and Foundry as well. I am a tooling developer; Geth is one of options for local providers for our users with the caveat that there is no snapshotting. I really like Geth because it has the |
We probably need to clear/reset the txpool nonce tracking mecanism when setHead happens. |
System information
Geth version:
1.10.26-stable
CL client & version: e.g. lighthouse/nimbus/prysm@v1.0.0 ?
OS & Version: macOS Ventura 13.0
Commit hash : (if
develop
)Expected behaviour
Note: I am using a private PoA chain for testing purposes.
I am trying to have isolation in my tests via
debug_setHead
and using block numbers as the snapshot IDs.Actual behaviour
No nonce is good enough for accounts after
debug_setHead
. If I use the value from theeth_transactionCount
, it says that thenonce is too low
. If I try bumping it manually, the transaction won't get picked up.Steps to reproduce the behaviour
Here is what my genesis looks like:
Geth command:
Backtrace
The text was updated successfully, but these errors were encountered: