Skip to content

Commit f95065c

Browse files
Merge pull request #34 from sei-protocol/docs/reconcile-sstore-gas
docs: reconcile SSTORE gas to 72,000 (same on both networks, Prop #109)
2 parents 072429f + 9cace4a commit f95065c

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

ai/sei-skill/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AI assistants are trained on broad Ethereum knowledge, not Sei's specifics. With
1717
|---|---|
1818
| `maxFeePerGas` in transactions | Legacy `gasPrice` (Sei doesn't use EIP-1559 basefee) |
1919
| "Finality takes ~12 confirmations" | Instant finality — 1 confirmation is final |
20-
| SSTORE costs 20,000 gas | SSTORE varies: 72,000 on testnet, 20,000 on mainnet (governance-adjustable) |
20+
| SSTORE costs 20,000 gas | SSTORE costs 72,000 gas — the same on mainnet and testnet (governance-adjustable on-chain parameter; [reference](/evm/differences-with-ethereum#sstore-gas-cost)) |
2121
| `PREVRANDAO` for randomness | PREVRANDAO is not random on Sei — use Pyth VRF or Chainlink VRF |
2222
| Generic ERC-20 patterns | Sei precompiles, pointer contracts, dual-address UX |
2323
| `@sei-js/evm` imports | `@sei-js/precompiles` (the current package name) |

ai/sei-skill/prompts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Deploy a Solidity contract to Sei mainnet and verify it on Seiscan
1919
How do I call the Staking precompile from Solidity to delegate SEI?
2020
```
2121
```
22-
Why is SSTORE so expensive on Sei testnet compared to mainnet?
22+
Why does SSTORE cost more on Sei than on Ethereum, and how should I budget gas for storage writes?
2323
```
2424
```
2525
How do I use the Bank precompile to query a native denom balance?

evm/differences-with-ethereum.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ On Sei, the `SSTORE` opcode gas cost is configurable as an on-chain parameter, m
181181

182182
This provides flexibility to tune storage costs based on EVM state size and network conditions.
183183

184-
Currently, the `SSTORE` gas cost is set to the non-standard value of **72,000 gas**.
184+
Currently, the `SSTORE` gas cost is set to the non-standard value of **72,000 gas**, and this is the same on both mainnet (`pacific-1`) and testnet (`atlantic-2`) — it does not vary by network. It was set by governance [Proposal #109](https://www.mintscan.io/sei/proposals/109) ("Update EVM SSTORE set gas to 72000"), which changed the `evm` module parameter `KeySeiSstoreSetGasEIP2200` to `72000`.
185+
186+
To confirm the real cost yourself, use a live `eth_estimateGas` call against a Sei RPC. Note that a Foundry `forge test --gas-report --fork-url <sei rpc>` report forks chain *state* but applies revm's standard EVM gas schedule, so it reports the Ethereum cost (~22,100) rather than Sei's — it is useful for relative profiling of your own logic, not for the absolute storage-write cost.
185187

186188
<Info>Since `SSTORE` is a governance-controlled parameter, this value may change in the future through a governance proposal.</Info>
187189

evm/evm-parity/gas-and-fees.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const feeData = await provider.getFeeData();
5555

5656
## SSTORE Cost
5757

58-
The gas cost of `SSTORE` (writing to contract storage) is governance-adjustable on Sei. Do not hard-code storage write estimates in your application.
58+
The gas cost of `SSTORE` (writing to contract storage) is governance-adjustable on Sei. It is currently **72,000 gas** — the same on mainnet and testnet (see [Divergence from Ethereum](/evm/differences-with-ethereum#sstore-gas-cost)) — but treat that as the current value, not a constant: do not hard-code storage write estimates in your application.
5959

6060
Always use `eth_estimateGas` for any transaction that writes to storage:
6161

@@ -82,6 +82,8 @@ const gas = await provider.estimateGas({
8282

8383
</CodeGroup>
8484

85+
<Warning>A Foundry `forge test --gas-report --fork-url <sei rpc>` report forks chain *state* but runs revm's standard EVM gas schedule, so it shows `SSTORE` at the Ethereum cost (~22,100) rather than Sei's ~72,000. Use it for relative profiling of your own logic; estimate the absolute storage-write cost with a live `eth_estimateGas` against a Sei RPC.</Warning>
86+
8587
## Summary
8688

8789
| Behavior | Ethereum | Sei |

skill.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ npx skills add sei-ecosystem # apps / integrations only
3838
## Critical facts — apply to every answer
3939

4040
1. **400ms block time, instant finality** — use `tx.wait(1)`, never `tx.wait(12)`
41-
2. **SSTORE gas is 72,000 on Sei** — both mainnet (pacific-1) and testnet (atlantic-2): 72,000 gas per cold write (governance proposal #240; governance-adjustable)
41+
2. **SSTORE gas is 72,000 on Sei**the same on both mainnet (pacific-1) and testnet (atlantic-2); it does not vary by network. Set via governance (mainnet Proposal #109, "Update EVM SSTORE set gas to 72000", which set the `evm` param `KeySeiSstoreSetGasEIP2200` to `72000`), so it is adjustable and can change — confirm the live value at https://docs.sei.io/evm/differences-with-ethereum#sstore-gas-cost
4242
3. **Use legacy `gasPrice`** — Sei has no base fee burn; prefer `gasPrice` over EIP-1559 `maxFeePerGas` / `maxPriorityFeePerGas`
4343
4. **Minimum gas price: 50 gwei**
4444
5. **Block gas limit: 12.5M per block**

0 commit comments

Comments
 (0)