DFIELDSOLUTIONS

Blockchain

GlossaryGas

The unit of computational cost on Ethereum-style chains: every operation has a price, and the caller pays it.

Gas exists so that a public network cannot be shut down by an infinite loop: execution is metered, and when the budget runs out the transaction stops and reverts. Since every user pays for the work their call performs, efficiency stops being a craft preference and becomes something the user feels directly.

It reshapes design in ways that surprise people. Storing data on-chain is expensive enough that most applications store a reference and keep the payload elsewhere; loops over unbounded arrays are a denial-of-service waiting to happen; and a function that is pleasant to read can cost several times one that is not. This is why gas reporting belongs in the test suite rather than in a review at the end.

Related terms

The bench this belongs to

Blockchain

Solidity on Ethereum, Polygon, Base and Arbitrum. Anchor programs on Solana. Written with tests first, because a redeploy is not a hotfix once value is on the line.

All termsStart a conversationMarkdown version

DField Bt. · Dunakeszi · dezso@dfieldsolutions.com
5.0
“From LinkedIn DM to live site. Two tiny tweaks, then shipped.”Michael J Ringer · Vilya ProtectionFounder · Spain