-
Notifications
You must be signed in to change notification settings - Fork 419
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
Fix BSC transaction submission errors: "transaction underpriced: tip needed 3000000000, tip permitted 1000000000" #3396
Labels
Comments
This was referenced Mar 21, 2024
tkporter
added a commit
that referenced
this issue
Mar 21, 2024
…on-1559 (#3462) ### Description - Fixes #3396 - See v2 backport here #3463 So turns out this is because: - BSC nodes tend to enforce a minimum gas price of 3 gwei when you submit a tx - it's possible for validators to include privileged txs at a lower gas price, so in practice (probably some mev stuff ?) there are a bunch of txs in blocks with transactions lower than 3 gwei - BSC's 1559 situation is they have a base fee of zero, so it's basically like they just use legacy txs - when we try to figure out what to pay in prio fees, we are suggested a 1 gwei priority fee: ``` $ cast rpc eth_feeHistory 10 latest "[5.0]" --rpc-url https://rpc.ankr.com/bsc {"oldestBlock":"0x23706f7","reward":[["0x3b9aca00"]],"baseFeePerGas":["0x0","0x0"],"gasUsedRatio":[0.1149265]} $ cast td 0x3b9aca00 1000000000 ``` So options are: 1. tx overrides for bsc, set it to 3 gwei 2. use a different eip 1559 estimator and set the percentile used in eth_feeHistory to something higher. Atm the percentile is 5%, if you change this to 50% we seem to get 3 gwei. This would have consequences for other chains tho 3. another heuristic, to fall back to legacy txs (where we can trust the eth_gasPrice to give us an accurate price) whenever the base fee is 0 I'm a tx override hater and we don't have this in the agents so far so I'm gonna go with 3. It's the least intrusive change
tkporter
added a commit
that referenced
this issue
Mar 21, 2024
yorhodes
pushed a commit
that referenced
this issue
Mar 22, 2024
…on-1559 (#3462) ### Description - Fixes #3396 - See v2 backport here #3463 So turns out this is because: - BSC nodes tend to enforce a minimum gas price of 3 gwei when you submit a tx - it's possible for validators to include privileged txs at a lower gas price, so in practice (probably some mev stuff ?) there are a bunch of txs in blocks with transactions lower than 3 gwei - BSC's 1559 situation is they have a base fee of zero, so it's basically like they just use legacy txs - when we try to figure out what to pay in prio fees, we are suggested a 1 gwei priority fee: ``` $ cast rpc eth_feeHistory 10 latest "[5.0]" --rpc-url https://rpc.ankr.com/bsc {"oldestBlock":"0x23706f7","reward":[["0x3b9aca00"]],"baseFeePerGas":["0x0","0x0"],"gasUsedRatio":[0.1149265]} $ cast td 0x3b9aca00 1000000000 ``` So options are: 1. tx overrides for bsc, set it to 3 gwei 2. use a different eip 1559 estimator and set the percentile used in eth_feeHistory to something higher. Atm the percentile is 5%, if you change this to 50% we seem to get 3 gwei. This would have consequences for other chains tho 3. another heuristic, to fall back to legacy txs (where we can trust the eth_gasPrice to give us an accurate price) whenever the base fee is 0 I'm a tx override hater and we don't have this in the agents so far so I'm gonna go with 3. It's the least intrusive change
daniel-savu
pushed a commit
that referenced
this issue
Jun 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
On BSC, we see an incredible amount of "transaction underpriced" errors when trying to submit a transaction. See https://cloudlogging.app.goo.gl/8WiUHMzj74sohor4A, e.g.
"transaction underpriced: tip needed 3000000000, tip permitted 1000000000"
Initially, it seemed this was related to pending txs in the mempool a la #2959
However it seems like this specific error message where it says "tip needed 3000000000, tip permitted xxxxx", what's really happening is the BSC network requires a minimum gas price of 3 gwei, but we're trying to submit a transaction with a gas price of 1 gwei.
Proof:
ContractError(MiddlewareError(MiddlewareError(MiddlewareError(MiddlewareError(JsonRpcClientError(JsonRpcError(JsonRpcError { code: -32000, message: "transaction underpriced: tip needed 3000000000, tip permitted 1000000000", data: None })))))))
: https://cloudlogging.app.goo.gl/JJfvkQAMuGCw5X7t5Legacy(TransactionRequest { ... gas_price: Some(1000000000)
: https://cloudlogging.app.goo.gl/wT5A25sExtfwrBtu7Solution
The text was updated successfully, but these errors were encountered: