Skip to content

EOS EVM Node v1.0.0

Latest
Compare
Choose a tag to compare
@stephenpdeos stephenpdeos released this 22 Aug 17:06
· 64 commits to main since this release
2834842

Introduction

The latest release of EOS EVM introduces support for Shanghai and London Hard Fork and their comprised features, a new gas fee algorithm to more accurately price transactions for underlying resource costs involved, and configuration settings to adjust the base token of the network.

Read on for more details.

New features

London Fork Compatibility

EIP-1559: Transaction Fee Reform

PRs

  • (211) Remove minimum_gas_price from consensus_parameter_data_type
  • (214) Use base_fee_per_gas from when generating EVM blocks


A critical component of the London Hard Fork is EIP-1559, which introduces a new transaction fee mechanism. This update changes how gas fees are estimated on the EOS EVM network with new components including a base fee and priority fee combined to calculate the overall cost of a transaction based on units of gas used.

Base fee

The base fee, implemented as the base_fee_per_gas, is the minimum amount of gas required for a transaction to be included in a block. This fee is burned in the Ethereum implementation, but is instead credited to the contract for EOS EVM. The base_fee_per_gas is now part of the block header information and is returned in both eth_getBlockByNumber and eth_getBlockByHash API calls.

Priority fee

The priority fee, implemented as the inclusion_price, is a fee historically designed so that users can pay to miners to incentivize them to prioritize their transactions over others, but is not applicable to EOS EVM. For the EOS EVM, this instead evaluates the updated gas fee algorithm (explained further in later section) to properly manage a minimum inclusion price. This fee is not burned but goes directly to the miners.

The priority fee or inclusion_price can be calculated as min(max_priority_fee_per_gas, max_fee_per_gas - base_fee_per_gas).

Max fee

Users may now specify a maximum fee they are willing to pay for the sum of base and priority fees. If the max fee is higher than the sum of the base fee and the priority fee, the difference is refunded to the user. This ensures users don't overpay beyond what is necessary to get their transactions processed.

Overall transaction fee

The overall cost of a transaction fee utilizes a price per gas unit implemented as the effective_gas_price, which can be calculated as
inclusion_price + base_fee_per_gas. The overall cost of any given transaction is then calculated as the product ofeffective_gas_price * gas_used.

Fee distribution

The fees associated with transactions are now distributed to where the contract receives base_fee_per_gas*gas_used and the miner receives inclusion_price*gas_used.

Feature activation for wallet users

The flag for the EIP-1559 network support is cached, so users will have to refresh their network selection by changing the active network to another network and go back to eos-evm in order for many common wallets like Metamask to start sending EIP-1559 transactions.

Shanghai Fork Compatibility

PUSH0 Opcode Support

PRs

  • (216) Update silkworm to use Shanghai for version=1


Support has been added for the PUSH0 opcode as introduced in the Shanghai Hard Fork. This opcode pushes a zero onto the stack, optimizing certain types of smart contract code and potentially reducing gas costs for operations that frequently use zero values.

Gas Fee Algorithm Enhancements

PRs

  • (197) Fix runtime state related function
  • (190) Process configchange event and save the parameters in some data structure.
  • (245)Update silkworm 1.0.2
  • (264)[1.0] Update silkworm with kGasCap=100M


A new gas fee algorithm has been introduced to alleviate challenges with a prior one-size-fits-all gas fee structure. Because the previous method used to calculate gas fees did not account for the varying computational resources required by transactions, many transactions were priced higher than their resource costs for the safety of the network.

To accomplish this, five new parameters are now tracked including:

  • Additional gas consumed when creating a new non-contract account due to a message-call transaction that sends positive value to an empty account. This value defaults to 0 and is denoted asG_txnewaccount.
  • Additional gas consumed when creating a new non-contract account due to the CALL or SELFDESTRUCT opcodes. This value defaults to to 25000 and is denoted as G_newaccount.
  • Static gas consumed in the CREATE and CREATE2 opcodes and also acts as the additional gas consumed in a contract-creating transaction. This value defaults to 32000 and is denoted G_txcreate.
  • Factor that multiplies the deployed code size within CREATE and CREATE2 opcodes, as well as contract-creating transactions, to determine the code deposit cost. This value defaults to 200 and is denoted asG_codedeposit.
  • Gas consumed when an SSTORE opcode causes the storage value to go from zero to non-zero. This value defaults to 20000 and is denoted as G_sset.

These five new parameters can be calculated as follows:

  • G_txnewaccount = account_bytes * gas_per_byte
  • G_newaccount = account_bytes * gas_per_byte
  • G_txcreate = contract_fixed_bytes * gas_per_byte
  • G_codedeposit = gas_per_byte
  • G_sset = 2900 + storage_slot_bytes * gas_per_byte

Each of these five parameters are accounted for an stored when establishing an updated gas cost.

Change max gas refund in ExecutionProcessor to 100% with a limit in the minimum gas used of 21k

PRs

  • (245)Update silkworm 1.0.2


The max refund setting of 20% as part of the standard protocol has been updated to 100% to improve overall user experience as the next generation of the gas fee algorithm is developed.

Increase kGasCap in EstimateGasOracle to 100M

PRs

  • (264)[1.0] Update silkworm with kGasCap=100M


The new gas fee parameters result in gas consumption estimates larger than the previous 25M limit set in the gas fee oracle. This cap has been increased to 100M in order to support these new value ranges.

General Hard Fork Solution

PRs

  • (172) Add evmtx actions processing


EOS EVM now officially supports multiple versions and the ability to perform a hard forks when required for future versions such as London Hard Fork detailed above.

This release implements a linear versioning system for EOS EVM hard forks, mapping each EOSEVM version to a corresponding EVMC revision:

EOSEVM Version EVMC Revision
0 ISTANBUL
1 SHANGHAI

Note: for this release, EOS EVM is moving directly from Instanbul to Shanghai, including all support for London Hard Fork within that version.

Bug fixes

MDBX configuration creating mapsize issue

PRs

  • (207) Fix mdbx related issues


The shared and exculsive flags set for MDBX were leading to an MDBX_MAP_FULL error.

Error building with ARM

PRs

  • (191) Support arm


There was an issue where the ARM version of protobuf was not being fetched properly and causing CMAKE to fail.

Building, compatibility, and upgrading

Building

The README in the eos-evm-node repository contains instructions on how to build EOS EVM Node and EOS EVM RPC.

Compatibility and upgrading

EOS EVM Node and EOS EVM RPC can be upgraded from the prior 0.7.x version by replacing the binaries. If upgrading from v1.0.0-rc1 or v1.0.0-rc2 replay is needed.

Further details on changes since last release

Contributors

Special thanks to the contributors that submitted patches for this release:

Full list of changes since last release

PRs

  • (144) bump abieos submodule
  • (157) [0.7 -> main] blockchain-plugin: Shutdown node on error during block processing
  • (162) [0.7 -> main] Merge nginx config change for long connection
  • (164) [0.7 -> main] Update silkworm with fixes in fork switching
  • (165) [0.7->main] Merge in nginx docker file fix for WS_ENDPOINT
  • (168) [0.7 -> main] Bump 0.7.0-rc2 version
  • (174) Update README.md
  • (170) Support sync start from certain evm height
  • (176) [0.7->main] Disable deprecated ship-start-from options
  • (178) [0.7 -> main] Update README
  • (180) [0.7 -> main] Bump 0.7.0 version
  • (172) Add evmtx actions processing
  • (185) Allow start from lib
  • (193) Try update cicd to use leap 5
  • (191) Support arm
  • (195) [0.7] make release/0.7 test cases with leap 5
  • (198) remove etherbase setting
  • (190) Process configchange event and save the parameters in some data structure.
  • (197) Fix runtime state related function
  • (199) remove engin-port config
  • (201) [0.7 -> main] fix timestamp to blocknum for main
  • (202) gas parameter integration test
  • (207) Fix mdbx related issues
  • (208) integration test of gas param fork handling
  • (211) Remove minimum_gas_price from consensus_parameter_data_type
  • (214) Use base_fee_per_gas from when generating EVM blocks
  • (213) Fix issues when LIB recorded from previous shutdown is at the edge of a gap
  • (216) Update silkworm to use Shanghai for version=1
  • (217)[1.0] Bump 1.0.0-rc1 version
  • (220) [1.0] Use updated silkworm with the new block-extra-data storage
  • (222) Bump 1.0.0-rc2 version
  • (221) [1.0->main] add integration test for differen test token
  • (225) [1.0 -> main] Bump 1.0.0-rc1 version
  • (226) [1.0 -> main] Use updated silkworm with the new block-extra-data storage
  • (227) [1.0 -> main] Bump 1.0.0-rc2 version
  • (231) [1.0] add get transaction & get transaction receipt from rpc test
  • (232) [1.0] Update silkworm 1.0.1
  • (233) [1.0] Bump 1.0.0-rc3 version
  • (244)fix estimate gas
  • (245)Update silkworm 1.0.2
  • (250)add estimate_gas test
  • (253)Bump 1.0.0-rc4
  • (264)[1.0] Update silkworm with kGasCap=100M
  • (273)[1.0] Bump 1.0.0 version
  • (280)[1.0] Fix eth_call when evm_version>0


Full Changelog: v0.7.0...v1.0.0