Hyperledger Besu EVM

The EthereumJ virtual machine was replaced with the Hyperledger Besu virtual machine in the Hedera Services release 0.19 as a result of HIP-26. This migration enables Hedera to maintain parity with Ethereum Mainnet evolutions such as the EVM container formats, new opcodes, and precompiled contracts.

The Besu integration is configured to use the “Shanghai” hard fork of Ethereum Mainnet as of the 0.38.6 June 2023 Hedera Mainnet release.

London Hard Fork

The smart contract platform is upgraded to support the EVM visible changes for the “London” hard fork. This includes changes introduced in the “Istanbul” and “Berlin” hard forks. Changes relating to block production, data serialization, and the fee market will not be implemented because they are not relevant to Hedera’s architecture.

Starting in the Hedera Services 0.22 release, the __ intrinsic gas cost and input data will be charged. The intrinsic gas cost is a constant that is charged before any code is executed. The intrinsic gas cost is 21,000 gas. The input data is 16 gas per non-zero byte and 4 gas per zero byte. The input data is the data provided to the external contract function parameters when calling a contract. To learn more about gas fees check out this page.

Gas Schedule

The Hedera Smart Contract Service will use the Gas Schedule from the "London" hard fork. Notable changes include warm/cold account access and refund reductions.

Warm and Cold Account and Slot Access

The "Berlin" hard fork introduced the notion of warm and cold accounts and storage slots. The first access to an account or storage slot in a transaction will need to pay the "cold" costs and all subsequent calls will pay the lower "warm" access costs. EIP-2929 contains the full details of the new cost scheduling.

Hedera does not at this time allow for "pre-warming" addresses and storage slots as part of the transaction as seen in EIP-2930. Future HIPs may support this scheme.

Gas Refund Reductions and Eliminations

In the London gas schedule, the amount of gas that can be returned from storage access usage patterns has been significantly reduced. Account refunds from SELFDESTRUCT have been completely removed.

Table of Gas Cost Changes

The current opcode gas fees are reflective of the 0.22 Hedera Service release.

Operation
London Cost (Gas)
Current Hedera (Gas)

Code deposit

200 * bytes

Max of London or Hedera

BALANCE (cold account)

2600

2600

BALANCE (warm account)

100

100

EXP

10 + 50/byte

10 + 50/byte

EXTCODECOPY (cold account)

2600 + Mem

2600 + Mem

EXTCODECOPY (warm account)

100 + Mem

100 + Mem

EXTCODEHASH (cold account)

2600

2600

EXTCODEHASH (warm account)

100

100

EXTCODESIZE (cold account)

2600

2600

EXTCODESIZE (warm account)

100

100

LOG0, LOG1, LOG2, LOG3, LOG4

375 + 375*topics + data Mem

Max of London or Hedera

SLOAD (cold slot)

2100

2100

SLOAD (warm slot)

100

100

SSTORE (new slot)

22,100

Max of London or Hedera

SSTORE (existing slot, cold access)

2,900

2,900

SSTORE (existing slot, warm access)

100

100

SSTORE refund

Only transient storage slots

Only transient storage slots

CALL et al. (cold recipient)

2,600

2,600

CALL et al. (warm recipient)

100

100

CALL et al. Hbar/Eth Transfer Surcharge

9,000

9,000

CALL et al. New Account Surcharge

25,000

revert

SELFDESTRUCT (cold beneficiary)

2600

2600

SELFDESTRUCT (warm beneficiary)

0

0

The terms 'warm' and 'cold' in the above table correspond with whether the account or storage slot has been read or written to within the current smart contract transaction, even if within a child call frame.

'CALL et al.' includes with limitation CALL, CALLCODE, DELEGATECALL, and STATICCALL

Reference HIP-206

Last updated