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

Transaction underpriced #1703

Closed
bitcoinmeetups opened this issue May 23, 2022 · 10 comments
Closed

Transaction underpriced #1703

bitcoinmeetups opened this issue May 23, 2022 · 10 comments
Labels
L-ignore Log: ignore PR in changelog

Comments

@bitcoinmeetups
Copy link

bitcoinmeetups commented May 23, 2022

forge create --rpc-url https://polygon-mainnet.g.alchemy.com/v2/NDF-tLzxxxxxxxxxxxx --constructor-args "bushman" "BSH" --private-key af180013952262434794a2cd8xxxxxxb src/NFT.sol:NFT results in "transaction underpriced" error.

Is that a generic term for "insufficient funds in the wallet"? Or is it referring to something else? I was assuming that Polygon would be rather cheap to deploy to.

Is there a way to estimate the deployment cost before creating, if that is the issue?

@mattsse
Copy link
Member

mattsse commented May 23, 2022

Is that a generic term for "insufficient funds in the wallet"

that's rather an issue with gasprice ref ethers-io/ethers.js#2828

perhaps that's an issue with the rpc so an insufficient gasprice was set.

deploying on Mumbai works?

@mattsse mattsse added the L-ignore Log: ignore PR in changelog label May 23, 2022
@robertu7
Copy link

Same issue with Polygon Mainnet (mumbai is OK), guess it's related issue with ethers-io/ethers.js#2828 (comment).

I am using forge create xxx --legacy for temp workaround.

@ZeroEkkusu
Copy link
Contributor

@mattsse I haven't found a more recent issue on this. The problem may be the minimum 30 gwei priority fee on Polygon Mainnet (as described in ethers-io/ethers.js#3370). Is this something that can be patched in Foundry?

@mattsse
Copy link
Member

mattsse commented Sep 26, 2022

interesting,

definitely, we can enforce this. since this is mandatory. I think we should set it by default if not provided

@robriks
Copy link
Contributor

robriks commented Oct 28, 2022

running into the same issue, can confirm that adding --legacy tack, ie:

forge create <stuff> --legacy

is an acceptable current workaround for anyone also encountering this issue

@ZeroEkkusu
Copy link
Contributor

@robriks, is it happening again? Have you updated Foundry?

@robriks
Copy link
Contributor

robriks commented Jan 9, 2023

updating foundry fixed this. thanks for checking in!

@mattsse
Copy link
Member

mattsse commented Jan 27, 2023

this has since been fixed with dedicated polygon gas station

@mattsse mattsse closed this as completed Jan 27, 2023
@Anmol-Dhiman
Copy link

image
getting the same error with polygon mumbai testnet

@smarsx
Copy link

smarsx commented Aug 14, 2023

Using Mumbai, I'm still intermittently having issues with gas estimation. I can usually get transactions posted using --legacy or --skip-simulation and --gas-estimate-multiplier

tkporter added a commit to hyperlane-xyz/hyperlane-monorepo that referenced this issue Nov 23, 2023
### Description

After investigating #2959, I found the following

this is a known problem with Polygon, explanation here
ethers-io/ethers.js#2828 (comment)

Fun fact Asa looked into this once
#771

Here's a discussion it in Foundry, which I found hoping that ethers-rs
folks had ran into this before
foundry-rs/foundry#1703

Foundry fixed this by using the Polygon gas station oracle which seems
to be recommended path
https://github.com/foundry-rs/foundry/pull/3368/files#diff-c89a4bbf7a90da118dcf00c5fe70eba78f8e5d95662bb5f039a353113e95042bR205

There's actually a polygon ethers middleware for this
https://docs.rs/ethers/latest/ethers/middleware/gas_oracle/polygon/struct.Polygon.html

So I (originally) borrowed this code from Foundry
https://github.com/foundry-rs/foundry/blob/master/crates/common/src/provider.rs#L254-L290

Changed to use Middlewares

This also means we can remove our existing janky Polygon logic

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
nambrot pushed a commit to hyperlane-xyz/hyperlane-monorepo that referenced this issue Nov 24, 2023
After investigating #2959, I found the following

this is a known problem with Polygon, explanation here
ethers-io/ethers.js#2828 (comment)

Fun fact Asa looked into this once
#771

Here's a discussion it in Foundry, which I found hoping that ethers-rs
folks had ran into this before
foundry-rs/foundry#1703

Foundry fixed this by using the Polygon gas station oracle which seems
to be recommended path
https://github.com/foundry-rs/foundry/pull/3368/files#diff-c89a4bbf7a90da118dcf00c5fe70eba78f8e5d95662bb5f039a353113e95042bR205

There's actually a polygon ethers middleware for this
https://docs.rs/ethers/latest/ethers/middleware/gas_oracle/polygon/struct.Polygon.html

So I (originally) borrowed this code from Foundry
https://github.com/foundry-rs/foundry/blob/master/crates/common/src/provider.rs#L254-L290

Changed to use Middlewares

This also means we can remove our existing janky Polygon logic

<!--
Are there any minor or drive-by changes also included?
-->

<!--
- Fixes #[issue number here]
-->

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
nambrot pushed a commit to hyperlane-xyz/hyperlane-monorepo that referenced this issue Dec 1, 2023
After investigating #2959, I found the following

this is a known problem with Polygon, explanation here
ethers-io/ethers.js#2828 (comment)

Fun fact Asa looked into this once
#771

Here's a discussion it in Foundry, which I found hoping that ethers-rs
folks had ran into this before
foundry-rs/foundry#1703

Foundry fixed this by using the Polygon gas station oracle which seems
to be recommended path
https://github.com/foundry-rs/foundry/pull/3368/files#diff-c89a4bbf7a90da118dcf00c5fe70eba78f8e5d95662bb5f039a353113e95042bR205

There's actually a polygon ethers middleware for this
https://docs.rs/ethers/latest/ethers/middleware/gas_oracle/polygon/struct.Polygon.html

So I (originally) borrowed this code from Foundry
https://github.com/foundry-rs/foundry/blob/master/crates/common/src/provider.rs#L254-L290

Changed to use Middlewares

This also means we can remove our existing janky Polygon logic

<!--
Are there any minor or drive-by changes also included?
-->

<!--
- Fixes #[issue number here]
-->

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-ignore Log: ignore PR in changelog
Projects
Archived in project
Development

No branches or pull requests

7 participants