Skip to content

docs: live SSTORE gas widget backed by a verified on-chain probe#35

Merged
alexander-sei merged 2 commits into
mainfrom
docs/sstore-gas-live-probe
Jun 26, 2026
Merged

docs: live SSTORE gas widget backed by a verified on-chain probe#35
alexander-sei merged 2 commits into
mainfrom
docs/sstore-gas-live-probe

Conversation

@alexander-sei

@alexander-sei alexander-sei commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a live widget to the SSTORE Gas Cost section of evm/differences-with-ethereum that reads the storage-write gas cost directly from the chain, so it can never drift from reality the way a hardcoded number can. This is the self-maintaining answer to the staleness problem behind #34.

How it works

snippets/sstore-gas-live.jsx calls SstoreGasProbe via eth_call (read-only — state is discarded, no gas spent). The contract measures a throwaway SSTORE with the GAS opcode, so it returns whatever the governance parameter KeySeiSstoreSetGasEIP2200 is set to right now.

It surfaces two numbers, with a mainnet/testnet toggle:

  • SSTORE_SET parameter ≈ 72,000 (the governance value, Prop #109)
  • Cold first write ≈ 74,100 (= param + EIP-2929 cold access)

Verified on-chain contract

The contract source lives on-chain via Sourcify, not in this repo. Both deployments are exact_match (creation + runtime) and visible on Seiscan:

Network Address
Mainnet (pacific-1 / 1329) 0xeeB428bcf499D0A1c401f123F64BFf754a5de57A
Testnet (atlantic-2 / 1328) 0xE5A35b2457E1C3cfF2F6527fAA32DE0B2a8e28E0

Devs can also call it directly: cast call <addr> "coldWriteCost()(uint256)" --rpc-url <sei rpc>.

Verification done

Scope

🤖 Generated with Claude Code

@cursor

cursor Bot commented Jun 26, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation-only change with optional public RPC calls from the browser; no chain, auth, or backend logic is modified.

Overview
The SSTORE Gas Cost section in evm/differences-with-ethereum.mdx now embeds a live on-chain widget instead of relying only on static copy, so governance-tuned SSTORE costs stay accurate when parameters change.

New snippet SstoreGasLive (snippets/sstore-gas-live.jsx) queries verified SstoreGasProbe contracts on mainnet and testnet with read-only eth_call, shows SSTORE_SET parameter and cold first write gas, and lets readers switch networks. The doc imports the component and adds a short lead-in that values are read live from Sei EVM.

Reviewed by Cursor Bugbot for commit 928352d. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 175d012. Configure here.


useEffect(() => {
load(net);
}, [net]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale RPC responses race

Medium Severity

Switching Mainnet/Testnet starts a new load without invalidating earlier eth_call requests. If an older fetch finishes after a newer one, setData and setLoading still run, so the widget can show one network’s gas values while the other tab and footer labels are selected.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 175d012. Configure here.

Base automatically changed from docs/reconcile-sstore-gas to main June 26, 2026 13:56
Adds SstoreGasLive (snippets/sstore-gas-live.jsx), embedded in the SSTORE Gas
Cost section of differences-with-ethereum. It reads the cost live via eth_call
from SstoreGasProbe — a tiny Sourcify-verified contract whose functions measure
a throwaway SSTORE with the GAS opcode (state discarded, no gas spent), so the
displayed number always reflects the current governance parameter
(KeySeiSstoreSetGasEIP2200) and can never go stale.

Verified deployments (exact_match on Sourcify, visible on Seiscan):
- mainnet (pacific-1 / 1329): 0xeeB428bcf499D0A1c401f123F64BFf754a5de57A
- testnet (atlantic-2 / 1328): 0xE5A35b2457E1C3cfF2F6527fAA32DE0B2a8e28E0

Shows the SSTORE_SET parameter (~72,000) and the cold first-write cost
(~74,100 = param + EIP-2929 cold access), with a mainnet/testnet toggle and a
link to the verified contract. The contract source lives on-chain via Sourcify,
not in this repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alexander-sei alexander-sei force-pushed the docs/sstore-gas-live-probe branch from 175d012 to bfe078d Compare June 26, 2026 13:57
@mintlify

mintlify Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
sei-docs 🟢 Ready View Preview Jun 26, 2026, 2:02 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Clarify that the SSTORE opcode gas cost is an on-chain, configurable parameter and note the current non-standard value of 72,000 gas set by governance Proposal #109 (https://www.mintscan.io/sei/proposals/109). Remove duplicated wording in the docs and update the live SSTORE gas snippet to display the governance values (subtracting the execution-frame gas: param - 8, cold - 7) so the shown stats reflect the on-chain parameter rather than frame-inclusive values.
@alexander-sei alexander-sei merged commit 057a7c8 into main Jun 26, 2026
10 checks passed
@alexander-sei alexander-sei deleted the docs/sstore-gas-live-probe branch June 26, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant