Skip to content
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

(forge): Script fails to estimate gas without set --priority-gas-price #7635

Closed
1 of 2 tasks
Sabnock01 opened this issue Apr 11, 2024 · 3 comments · Fixed by #7638
Closed
1 of 2 tasks

(forge): Script fails to estimate gas without set --priority-gas-price #7635

Sabnock01 opened this issue Apr 11, 2024 · 3 comments · Fixed by #7638
Assignees
Labels
T-bug Type: bug

Comments

@Sabnock01
Copy link
Contributor

Sabnock01 commented Apr 11, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (440ec52 2024-04-11T00:18:58.806922049Z)

What command(s) is the bug in?

forge script

Operating System

Linux

Describe the bug

When running forge script against an anvil fork, I receive the following error:

Context:
- Error #0: Failed to estimate gas for tx
- Error #1: server returned an error response: error code -32602: Invalid input: `max_priority_fee_per_gas` greater than `max_fee_per_gas`

When printing debug information with RUST_LOG=debug, I find the following transaction object:

2024-04-11T09:59:25.940032Z DEBUG cheatcodes: broadcastable create tx=BroadcastableTransaction { rpc: Some("http://localhost:8545"), transaction: TransactionRequest { from: Some(...), to: None, gas_price: None, max_fee_per_gas: None, max_priority_fee_per_gas: None, max_fee_per_blob_gas: None, gas: None, value: Some(0x0_U256), input: TransactionInput { input: Some(..., data: None }, nonce: Some(25), chain_id: None, access_list: None, transaction_type: None, blob_versioned_hashes: None, sidecar: None } }

Note that most all of the fields, including gas related ones, are set to None. I have omitted some fields for length / privacy with ...

However, if I simply add --priority-gas-price with a value of 0 or some arbitrary value that is lower than whatever the max_fee_per_gas is set to, the script will succeed. I do not know of a way to see beforehand what this value is unless I use --with-gas-price to set it arbitrarily.

Notably, the transaction object in this case will be populated with specified values:

2024-04-11T10:04:36.544702Z DEBUG forge_script::broadcast: sending transaction: WithOtherFields { inner: TransactionRequest { from: Some(...), to: None, gas_price: None, max_fee_per_gas: Some(238), max_priority_fee_per_gas: Some(0), max_fee_per_blob_gas: None, gas: Some(3484655), value: Some(0x0_U256), input: TransactionInput { input: Some(...

Thus far, I have only tested this on Blast and Blast Sepolia.

@Sabnock01 Sabnock01 added the T-bug Type: bug label Apr 11, 2024
@mattsse
Copy link
Member

mattsse commented Apr 11, 2024

likely dup #7620

@Sabnock01
Copy link
Contributor Author

likely dup #7620

Ah, could be!

@Sabnock01
Copy link
Contributor Author

Can report that this has indeed been fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants