Gas Accounting Guarantees
Sei v6.1.11
release notes patched multiple gaps in gas attribution. This page captures the definitive rules for gasUsed
, gasLimit
, and eth_estimateGas
, and provides validation steps to confirm your infrastructure is consuming the numbers correctly.
Updates in this guide reflect sei-chain@1efdec1eb
(“Fix block gas used”) and supporting RPC fixes merged in the same release train.
What Changed in v6.1.11
Block gas accounting | Block gasUsed now equals the sum of receipt gasUsed for every EVM transaction executed in the block. Synthetic envelopes no longer skew totals. |
Receipt accuracy | eth_getTransactionReceipt always returns the execution gas minus refunds. Legacy blocks keep their historical values, but no new block is emitted with 0 gas. |
Estimator parity | eth_estimateGas incorporates pointer lookup warmups and Solo migration flows, eliminating the underestimation observed in precompile-pointer and precompile-solo calls. |
Synthetic log flag | All Cosmos-originated events carry synthetic: true . Indexers can filter them without guessing based on module address. |
Gas Flow At a Glance
Ante handler
Cosmos layer validates signatures/fees. Synthetic envelopes conclude here without touching EVM gas.
EVM execution
go-ethereum accounting debits opcode gas, precompile calls, and Solo/SIP-3 migrations exactly as upstream.
Refund + storage
Apply EIP-3529 refund cap, persist
receipt.gasUsed = execution - refund
, then aggregate totals into the block header.Verifying Your Node or Indexer
Block sanity | seid query block <height> — ensure gas_used > 0 and matches RPC hash. |
Receipt reconciliation | eth_getBlockByNumber(..., true) — sum receipts client-side and confirm equality. |
Receipt non-zero check | eth_getTransactionReceipt — post-v6.1.11 EVM transactions never return gasUsed = 0x0 . |
Estimator parity | eth_estimateGas on pointer/Solo flows — succeeds without heavy manual padding. |
Configuration Touchpoints
Use the RPC config defaults from evmrpc/config.go
as a baseline:
max_log_no_block | 10000 logs when no block range is supplied. Keep ≥ 10k for reliable historical diffs. |
max_blocks_for_log | 2000 block span for log queries. Increase cautiously if you replay receipts frequently. |
max_concurrent_trace_calls | 10 concurrent debug_trace* calls. More traces increase gas accounting pressure; monitor latency. |
trace_timeout | 30s default per trace. Tighten if custom tracers risk panics (see Panic FAQ). |
Regression Checklist
Run this suite after upgrades or when deploying new indexer infra:
- Fetch 10 random receipts from the latest block and ensure
gasUsed
is non-zero and consistent with on-chain execution. - Confirm
eth_getBlockByNumber(..., true)
showsgasUsed
equal to the arithmetic sum of the receipts from the same call. - Estimate gas for:
- A pointer migration using
precompile-pointer:addNativePointer
. - A Solo claim (
precompile-solo:claim
). - A standard ERC-20 transfer. Expect each to execute with a margin < 2% from actual runtime gas.
- A pointer migration using
- Replay
eth_getLogs
acrossmax_blocks_for_log
and ensure nopanic
error surfaces (see Regression Coverage guide).
Troubleshooting
Error | Cause | Fix |
---|---|---|
gasUsed = 0x0 on fresh blocks | Node is still serving pre-v6.1.11 receipts or RPC cache is stale. | Restart RPC service after upgrading to v6.1.11 ; invalidate any CDN cache that fronts the RPC. |
eth_estimateGas fails on pointer calls | Pointer cache cold or Solo migration contract not yet deployed. | Call precompile-pointerview once before estimating, or ensure Solo migration contracts are deployed at the documented addresses. |
Block gasUsed > sum(receipts) | Legacy block prior to v6.1.11 or synthetic transaction included. | Accept mismatch for legacy heights; filter out synthetic: true logs when aggregating. |
Related Material
rpc-gas-reference
– Quick reference for configuration and formulae.rpc-regression-playbook
– Full QA checklist for RPC consumers.tracing-playbook
– Debugging tools for tracing anomalies.
Last updated on