Finalize state after each call in callMany#6381
Merged
Merged
Conversation
AskAlexSharov
requested changes
Dec 20, 2022
| return nil, err | ||
| } | ||
|
|
||
| _ = st.FinalizeTx(rules, state.NewNoopWriter()) |
Collaborator
There was a problem hiding this comment.
can you please check, if SoftFinalise also fixing your problem?
Contributor
Author
There was a problem hiding this comment.
Seems like it doesn't
Contributor
Author
There was a problem hiding this comment.
Let me know if any more changes or checks are required :)
AskAlexSharov
approved these changes
Dec 21, 2022
Collaborator
|
thank you. will be great if you can add some unit-test |
AlexeyAkhunov
pushed a commit
that referenced
this pull request
Jan 12, 2023
Continuing the work of #6381 . We encountered a problem in blocks with type 2 transactions, specifically blocks with two transactions with the same `tx.from`. When the first tx is replayed, a high `gasPrice` is being calculate in `txn.AsMessage` causing the second replayed tx to fail with the following error: ``` insufficient funds for gas * price + value: address ... ``` This happens in both `eth_callMany` and `debug_traceCallMany`. This pull request follows the `debug_traceTransaction` usage of `tx.AsMessage` in `ComputeTxEnv`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
debug_traceCallManyandeth_callManytheIntraBlockStateis not being finalized after each replayed transaction and after each call. This can cause several problems:SSTOREdynamic gas calculation being affected by "warm" and "cold" storage slots, and by "original" value comparison.SELFDESTRUCTed in the replayed transactions or during previous calls, as the self-destruction has not been finalized.see #6373 as an example.
This pull request adds a call to
FinalizeTxafter eachApplyMessageandTraceTx