-
Notifications
You must be signed in to change notification settings - Fork 473
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
Gas estimations on Gnosis Chain too low #5637
Comments
I'm able to reproduce the issue using the following JS script that leverages const ethers = require("ethers");
(async () => {
[
{ client: "Localhost", url: "http://127.0.0.1:8545/" },
{ client: "Official", url: "https://rpc.gnosischain.com/" },
{ client: "Gateway", url: "https://rpc.gnosis.gateway.fm" },
{ client: "BlockPi", url: "https://gnosis.blockpi.network/v1/rpc/public" },
{ client: "Blast", url: "https://gnosis-mainnet.public.blastapi.io" },
{ client: "Pokt", url: "https://gnosischain-rpc.gateway.pokt.network" },
{ client: "Ankr", url: "https://rpc.ankr.com/gnosis" }
].forEach(async ({ client, url }) => await estimateGas(client, url));
})();
async function estimateGas(client, url) {
let body = {
"from": "0xbbeedb6d8e56e23f5812e59d1b6602f15957271f",
"to": "0x828cf988de33bf93527533852e95e2da449ec171",
"data": "0x6a761202000000000000000000000000828cf988de33bf93527533852e95e2da449ec171000000000000000000000000000000000000000000000000000000e8d4a51000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014bb80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041e0a9f565f27a4fd5743e5b7ad92f4217467bc5a7a419c7e159a5950de845ad9b0e88bf1c5549d5335ca087c010a7560a5caf991ba88850d10cb1e2d6196b4a151b00000000000000000000000000000000000000000000000000000000000000"
}
let response = await ethers.utils.fetchJson(url, `{ "id": 42, "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [${JSON.stringify(body)} ] }`);
let estimation = parseInt(response.result, 16);
console.log(`Client '${client}' estimated '${estimation}'`);
} The interesting part is that all RPC providers return
In this case, both clients return Update: RPC providers are all using Nethermind:
|
After verifying with a simulator, the actual gas used to execute this transaction is If we run the transaction again with the estimation provided by the RPCs + the value of How should then Nethermind deal with this kind of transactions that can perform arbitrary checks on the gas? For this specific kind of "safe" transactions, a possibility would for Nethermind to have a special condition (a plugin?) to add the value of |
I will close the ticket with a For users of "safe transaction", our suggestion is to add this value to the gas estimation provided by the node you're using. |
Description
eth_estimateGas
estimations on Gnosis Chain are too low (specifically for Safe transactions requiringsafeTxGas
).Steps to Reproduce
Make
eth_estimateGas
calls to either of the official Gnosis Chain RPCs:https://rpc.gnosischain.com
/https://rpc.gnosis.gateway.fm
and observe the low gas which inevitably reverts (simulation):Actual behavior
Estimation is too low and transaction reverts.
Expected behavior
Estimation returns sufficient gas for the transaction to succeed, ~30-60% higher than what it currently is.
The text was updated successfully, but these errors were encountered: