[Supanode](https://supanode.xyz/)[Learn](https://supanode.xyz/learn)Why estimated gas exceeds the final gas used

# Why estimated gas exceeds the final gas used

Separate a transaction gas limit, the charged gas and the network-specific fee calculation.

**On this page**[An estimate is a simulation result](https://supanode.xyz/learn/eth-estimategas-vs-gas-used#an-estimate-is-a-simulation-result)[Keep the request identical](https://supanode.xyz/learn/eth-estimategas-vs-gas-used#keep-the-request-identical)[Compare the right fields](https://supanode.xyz/learn/eth-estimategas-vs-gas-used#compare-the-right-fields)[Set a deliberate policy](https://supanode.xyz/learn/eth-estimategas-vs-gas-used#set-a-deliberate-policy)[Sources](https://supanode.xyz/learn/eth-estimategas-vs-gas-used#sources)

## An estimate is a simulation result

`eth_estimateGas` estimates the gas needed for a call against a particular state. A receipt reports what a later included transaction actually used. State changes, execution paths and call-gas forwarding can make those values differ. The estimate is not a promise about the final fee.

## Keep the request identical

```
{"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"SENDER","to":"CONTRACT","value":"0x0","data":"CALLDATA"}]}
```

Use the same sender, value and calldata as the transaction you intend to sign. A sender-dependent contract may take a different path when the sender is omitted. Save the request and returned estimate so a later receipt can be compared meaningfully.

## Compare the right fields

1.  Read the receipt status before interpreting gas use. A reverted transaction also consumes gas.
2.  Compare gasUsed with the gas limit, not with the account's total ETH balance change.
3.  Separate execution cost from other fee components and transferred value.
4.  For Robinhood Chain, follow its L2 fee model, which also accounts for data posted to Ethereum.

## Set a deliberate policy

Use a bounded safety margin appropriate to the application, then simulate again if state is likely to have changed. A larger gas limit does not repair invalid calldata, missing allowance or a contract revert. EIP-150's call forwarding rule can also mean a transaction needs available gas above the amount ultimately spent. Keep fee affordability and execution feasibility as separate checks.

## Sources

-   [Ethereum JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/)
-   [EIP-150](https://eips.ethereum.org/EIPS/eip-150)
-   [Robinhood fee model](https://docs.robinhood.com/chain/gas-and-fees/)

## Continue reading

[Robinhood RPC and WebSocket](https://supanode.xyz/blog/robinhood-chain-rpc-websocket)[Robinhood methods](https://supanode.xyz/docs/robinhood/rpc/whats-available)[Learn library](https://supanode.xyz/learn)

---
Source: https://supanode.xyz/learn/eth-estimategas-vs-gas-used
