Skip to content

docs: document flat per-transaction gas cost - #240

Draft
claude[bot] wants to merge 5 commits into
mainfrom
docs/gas-costs
Draft

docs: document flat per-transaction gas cost#240
claude[bot] wants to merge 5 commits into
mainfrom
docs/gas-costs

Conversation

@claude

@claude claude Bot commented Jul 13, 2026

Copy link
Copy Markdown

Requested by Shresth Agrawal · Slack thread

Before

The docs never state the gas price, and no precompile page says what its calls cost in gas.

After

  • Getting Started has a Gas section: the gas price is a fixed constant of 1 gwei (variable pricing may come later — links Gas Pricing Without Consensus), and transactions are charged a flat 21,000 gas. Clients don't need to hardcode the price: it is served by the usual base-fee RPCs (eth_gasPrice, baseFeePerGas in blocks and eth_feeHistory); eth_estimateGas works as-is; there is no priority fee or tip (eth_maxPriorityFeePerGas is always 0, and eth_feeHistory rewards are all zero).
  • Each precompile page states a flat 21,000 gas per call, in gas units only — pricing stays on the Getting Started page. The exceptions that genuinely apply are kept:
    • OrderbooksubmitBatch costs 21,000 gas × the number of orders in the batch (minimum 1), charged as if each inner order were submitted standalone; delegated calls are gas-exempt.
    • Bridge — no bridge call costs the user gas: withdraw is gas-exempt, and processDeposits is exempt for the relayer that submits it, so incoming deposits are credited by the network for free.
    • Recoveryrecover is flat 21,000 gas regardless of how long the transaction chain being finalized is; there is no per-account surcharge.
  • The Precompiles index notes that each precompile page lists its gas cost.

Rebased onto main. The optimistic-auctions precompile page was removed from main by #278, so this branch no longer touches it.

Rebased again onto main after #283 rewrote the bridge and orderbook pages: the gas sections are re-applied on top of that prose rather than over the text it replaced. Re-checking the numbers while doing so turned up three claims that no longer held — bridge withdraw is gas-exempt rather than flat-rated, recover has no per-account surcharge, and the Getting Started section no longer derives a wei total from the price — so those are corrected here instead of shipping stale.

Files touched

  • doc/api-reference/README.md
  • doc/api-reference/applications-precompiles/README.md
  • doc/api-reference/applications-precompiles/orderbook.md
  • doc/api-reference/applications-precompiles/bridge.md
  • doc/api-reference/applications-precompiles/recovery.md

🤖 Generated with Claude Code

https://claude.ai/code/session_01LFS56yZWWCu1wSa3jjzFjZ


Generated by Claude Code

@claude claude Bot changed the title docs: document fixed gas price and per-precompile gas costs docs: document fixed gas price and per-operation gas costs Jul 13, 2026
@claude
claude Bot force-pushed the docs/gas-costs branch from 4fff7b4 to 35182a4 Compare August 25, 2026 11:46
@claude claude Bot changed the title docs: document fixed gas price and per-operation gas costs docs: document flat per-transaction gas cost Aug 25, 2026
claude added 5 commits August 26, 2026 13:57
Precompile pages now state only gas costs in gas units; the fixed
1 gwei price and fee RPC details live solely in the Getting Started
Gas section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFS56yZWWCu1wSa3jjzFjZ
Gas is no longer documented as a flat 21,000 per transaction: simple
transfers stay at 21,000 gas, and each precompile page now lists its
per-operation costs (orderbook 40k/30k/25k, bridge withdraw 50k,
auction submitBid 25k, recovery recover 100k). Pricing (1 gwei, fee
RPCs) is unchanged and stays on the Getting Started page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFS56yZWWCu1wSa3jjzFjZ
Per-operation gas costs are not part of the network: transactions are
charged a flat 21,000 gas each. Roll the docs back to flat per-transaction
pricing and drop the per-operation cost tables from the precompile pages.

The still-true exceptions stay documented: orderbook `submitBatch` costs
21,000 gas per order in the batch (minimum 1), orderbook `delegated` calls
are gas-exempt, bridge deposits are credited by the network and cost the
user nothing, and a chained recovery pays an additional 21,000 gas per
intermediate account.

Pricing (fixed 1 gwei, the fee RPCs) is unchanged and stays on the Getting
Started page; the precompile pages state gas units only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFS56yZWWCu1wSa3jjzFjZ
Re-checked the gas numbers against the current node behaviour and three
claims had drifted:

- Bridge `withdraw` is gas-exempt, not charged a flat 21,000. The page
  already said so under Withdrawing, so the Gas section contradicted it
  two screens later. `processDeposits` is likewise exempt for the relayer
  that submits it, which makes the whole bridge precompile free to the
  user rather than flat-rated.
- A `recover` call is flat 21,000 regardless of the length of the
  transaction chain being finalized. There is no per-intermediate-account
  surcharge; the chain length affects which certificates are verified,
  not what is charged.
- Getting Started derived a wei figure ("so a typical transaction costs
  21,000 gwei") from the price and the gas. The metering and the
  advertised price are both accurate, but the derived total is not
  something the docs should assert, so the arithmetic is dropped and the
  wording says the transaction is metered at 21,000 gas.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFS56yZWWCu1wSa3jjzFjZ
@claude
claude Bot force-pushed the docs/gas-costs branch from 35182a4 to d6eeed3 Compare August 26, 2026 13:59
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