← Academy library

Crypto / Evergreen

Storage changes can cost more than arithmetic

Ethereum assigns gas costs to operations, including storage access and modification, so two calls with similar user-visible outcomes can require different computational budgets.

THE IDEA TO KEEP

Gas measures protocol-priced operations, so state-dependent implementation details can change the cost of apparently similar actions.

The distinction that matters

Ethereum assigns gas costs to operations, including storage access and modification, so two calls with similar user-visible outcomes can require different computational budgets. Gas measures computational and storage-related work under Ethereum's execution rules. The gas limit bounds how much work a transaction may consume, while fee parameters determine the price offered for that work. These are different controls.

How the mechanism works

Writing a new storage value, updating an existing value, and reading data can have different costs under the applicable execution rules. A simple transfer and a complex contract interaction can require different amounts of gas even when their economic values are similar. Applications estimate execution before submission, but estimates depend on state and the exact call. The fee market includes a protocol base fee and transaction-specific parameters that influence payment and inclusion. Users may specify ceilings rather than the exact final charge, and unused execution allowance is not automatically spent merely because the limit was high.

A worked situation

Consider this hypothetical situation: A hypothetical application records a user's first interaction in storage, while later interactions update an already initialized record. The first call can cost more gas than later calls even if the interface presents both as the same kind of action.

Where interpretation can fail

A fee comparison that ignores initial state can incorrectly attribute the difference to congestion or to an unexplained service charge. Compare execution paths and relevant storage state before treating repeated calls as identical units of work. Gas measures protocol-priced operations, so state-dependent implementation details can change the cost of apparently similar actions.

The wider technical implication

Storage costs can differ when a slot is first accessed during a transaction versus accessed again, and when a value is created, updated, or cleared under the protocol's current rules. These distinctions make hand estimates fragile for complex contracts. A loop that touches many distinct accounts can be more expensive than one repeatedly using a small set, even if the number of visible iterations looks similar. The practical explanation should focus on the operations and state touched rather than memorizing one universal gas number for an application button whose execution path can vary.

A global perspective

Gas mechanisms differ across networks and layers. A provider may add service charges, and local accounting rules may classify network costs differently.

Sources & further reading

Ethereum.org — Gas and fees ↗Ethereum.org — Transactions ↗

Sources checked Oct 27, 2026. Educational examples. Historical observations are attributed to their sources. No affiliation with cited organizations.

Make the idea stick.

Mark complete when you are ready. Reaching the end alone does not mark a lesson complete.

What assumption in this guide would change the result in a different situation? Revisit the example and explain that change in your own words.

Explore crypto →

KEEP THE CONNECTION

Your next useful question.

Your saved guides →