optimism gas estimation problems
Component
Forge
Have you ensured that all of these are up to date?
- [x] Foundry
- [x] Foundryup
What version of Foundry are you on?
9dc83c98223df59d102dde47405f0650c97b256a
What version of Foundryup are you on?
No response
What command(s) is the bug in?
forge script
Operating System
None
Describe the bug
On latest nightly (i think is not related to nightly but fukasa gas price drops), when i try to submit a txn on optimism, txns error with:
Sequence #1 on optimism | retrying transaction Err(server returned an error response: error code -32000: insufficient gas for floor data gas cost: gas 719122, minimum needed 741890) and similar
On gnosis chain, seems like foundry also can no longer submit txns.
## Setting up 1 EVM.
==========================
Chain 100
Estimated gas price: 0.000000101 gwei
Seems to dramatically underestimate gas cost: https://gnosisscan.io/gastracker
Sorry will just dump here issues i face while i face them as i need to deploy sth on various chains 😅
On Plasma, verification failed initially because I think etherscan is not fast enough.
Response: `NOTOK`
Details: `Error: contract does not exist 9745 0x<sth>
Manual verification works, but probably would be good if foundry retried when contract does not exist (and it knows it exists, given it just deployed).
Sorry will just dump here issues i face while i face them as i need to deploy sth on various chains 😅
On Plasama, verification failed initially because I think etherscan is not fast enough.
Response: `NOTOK` Details: `Error: contract does not exist 9745 0x<sth>Manual verification works, but probably would be good if foundry retried when contract does not exist (and it knows it exists, given it just deployed).
@sakulstra for this you could tweak the params
--retries <RETRIES>
Number of attempts for retrying verification
[default: 5]
--delay <DELAY>
Optional delay to apply in between verification attempts, in seconds
[default: 5]
@grandizzy Will try next time, but honestly feels like this should be the default. At least with this error it's quite obvious that the explorer lags behind.
Also on polygon, without any custom settings it does:
Submitting verification for [src/UpgradePayload.sol:UpgradePayload] 0x<sth>.
Warning: Could not detect deployment: Unable to locate ContractCode at <sth>; waiting 5 seconds before trying again (4 tries remaining)
Submitting verification for [src/UpgradePayload.sol:UpgradePayload] <sth>.
Warning: Could not detect deployment: Unable to locate ContractCode at <sth>; waiting 5 seconds before trying again (3 tries remaining)
Submitting verification for [src/UpgradePayload.sol:UpgradePayload] <sth>.
Warning: Could not detect deployment: Unable to locate ContractCode at <sth>; waiting 5 seconds before trying again (2 tries remaining)
Submitting verification for [src/UpgradePayload.sol:UpgradePayload] <sth>.
Warning: Could not detect deployment: Unable to locate ContractCode at <sth>; waiting 5 seconds before trying again (1 tries remaining)
Submitting verification for [src/UpgradePayload.sol:UpgradePayload] <sth>.
Warning: Could not detect deployment: Unable to locate ContractCode at <sth>; waiting 5 seconds before trying again (0 tries remaining)
So it seems to kinda handle it, but inconsistently.
I see will bump both defaults to 10 then
On latest nightly (i think is not related to nightly but fukasa gas price drops), when i try to submit a txn on optimism, txns error with:
Sequence #1 on optimism | retrying transaction Err(server returned an error response: error code -32000: insufficient gas for floor data gas cost: gas 719122, minimum needed 741890)and similar
I think here its not foundry to estimate the gas? Maybe some RPC side issue? cc @grandizzy
I think here its not foundry to estimate the gas? Maybe some RPC side issue?
Was using alchemy and today it seems to work. Perhaps it's them not properly handling the floor price.
@sakulstra if all good now we could keep this to bump the retries as in linked PR, pls comment
@sakulstra can you pls rerun with RUST_LOG=trace and send the response that is logged as Received verification response need that to properly handle the plasma API response. Or if you could provide verifier url details to repro locally, thank you
Will trace on next deployment and post here, did not put any custom config. So it's just forge default(routescan api).
I know there's probably not so much that can be fixed on foundry side, but using alchemy these errors i was reporting are appearing quite frequently now also on other chains. E.g. today on arbitrum was not able to deploy most of the time due to:
Sequence #5 on arbitrum | retrying transaction Err(server returned an error response: error code -32000: max fee per gas less than block base fee: address <redacted>, maxFeePerGas: 71868000 baseFee: 73564000) (attempt 3)