feat(cast): Add --skip-preverification flag to run command to allow user to bypass nonce verification etc.#10794
Closed
ckoopmann wants to merge 1 commit intofoundry-rs:masterfrom
Closed
Conversation
…once verification etc.
Contributor
Author
|
Note: After rebasing on the latest foundry master I noticed that the "transact_preverified" method is not available anymore on the revm / revm-inspector interface, so I'll have to find an alternative workaround. |
Contributor
Author
|
Just found that there is a way to disable the nonce check specifically in revm so I will likely try to do that instead. |
Contributor
Author
|
Note that the core issue I was facing here was the incorrect |
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.
Motivation
When using cast run to debug a transaction on a local fork (usually hardhat) I regularily run into issues where the preverification of the transaction fails due to "nonce too high" or "insufficient balance for transaction fee" issues. Sometimes this is due to a corrupted cache (see #9968) however at other times resetting the cache does not fix the issue.
Often this happens when the local fork has been the target of test scripts that include
hardhat_setBalanceand related calls.In these cases I am usually not interested in verifying wether a transaction has been legally included on chain but just want to simulate the evm operations inside that transaction. In the current state I am unable to do that.
Solution
Add an optional
--skip-preverificationflag to thecast runcomamnd that skips all transaction preverification. (by runningevm.transact_preverifiedinstead ofevm.transact).PR Checklist