-
Notifications
You must be signed in to change notification settings - Fork 897
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
Address bonsai self-destruct stale code present #4906
Address bonsai self-destruct stale code present #4906
Conversation
de3b3c3
to
640751f
Compare
Testing with a database that exhibited this error on block 16369752. A self-destruct for contract this occurred during the initial sync/heal phase of besu, and was subsequently recreated on the problem block which exhibited the "unable to copy layered worldstate" error: https://etherscan.io/address/0x0000000000a1c1accd070e0003838859fe4f7046#internaltx testing with main yields the error state with this database (empty optional returned for the worldstate)
|
640751f
to
db79e3e
Compare
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 if the tests prove that this can unblock the nodes without adding another bug
Signed-off-by: garyschulte <garyschulte@gmail.com>
2671443
to
9cf72b3
Compare
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
PR description
During an initial worldstate sync, a self-destruct that occurs between the initial pivot block and final heal pivot block will leave stale code in bonsai code storage. If subsequently the code is redeployed via create2 to the same contract address, the bonsai db will fail to roll code changes to the block where the redeployment occurs. This presents in a handful of ways such as 'worldstate not present' or 'unable to copy layered worldstate'.
Discussing with @matkt, since the repivot and heal process does not presently have an opportunity to 'heal' the code storage, and we should be able to trust the trielogs, this PR changes the rollCodeForward behavior to overwrite stale code if/when it is found. This should resolve #4784 and give the besu team an opportunity to revisit this in flat database heal work that is ongoing.
Fixed Issue(s)
addresses #4784
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog