What will Ethereum Shanghai upgrade an upcoming EIP bring?

Regarding the Ethereum Shanghai upgrade, let’s briefly sort out what benefits they can bring.

Refer to the latest public news of Ethereum: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md#eips-considered-for-inclusion, and the relevant EIPs of the Shanghai upgrade are as follows:

  • Determine which EIPs are included: EIP-3651, EIP-3855, EIP-3860, EIP-4895
  • Possible EIPs: EIP-3540, EIP-3670
  • EIP-4488 and EIP-4844 related to L2 expansion are not within the scope of this upgrade

EIP-3651: WARM COINBASE

Speaking of EIP-3651, I have to introduce a change to EIP-2929:

When the destination is not in the accessed_addresses, charge COLD_ACCOUNT_ACCESS_COST (cold account access cost) gas and add the address to the accessed_addresses. Otherwise, WARM_STORAGE_READ_COST (warm storage read cost) gas is charged, and warm read gas consumption is relatively low.

COINBASE DIRECT PAYMENTS ARE BECOMING MORE AND MORE POPULAR THESE DAYS, BUT THE PRICE OF ACCESSING COINBASE IS CURRENTLY HIGHER; THIS IS DUE TO THE FACT THAT UNDER THE ACCESS LIST FRAMEWORK INTRODUCED IN EIP -2929, COINBASE CALCULATES GAS AT THE COST OF COLD ACCOUNT ACCESS, AND AFTER EIP-3651, THE accessed_addresses WILL INCLUDE ADDRESSES RETURNED BY COINBASE (0x41).

Advantage:

AFTER THE MODIFICATION, COINBASE WILL REDUCE GAS CONSUMPTION WHEN PAYING ERC20 TOKENS.

EIP – 3855: PUSH0 instruction

EIP-3855, introducing a new instruction (0x5f), pressing the constant value 0 into the stack, the Yellow Book instruction set on PUSH, currently only PUSH1-PUSH32, the function is to push 1 byte into the stack, to 32 bytes into the stack

Existing instruction implementations need to push 0 values onto the stack by executing PUSH1 0, which consumes 3 gas in the runtime and an additional 200 gas (2 bytes of storage cost)

 

What will Ethereum Shanghai upgrade an upcoming EIP bring?

With the PUSH0 instruction, there is no need to consume this extra 200 gas.

Advantage:

Currently, about 11% of PUSH operations are just pushed into 0, so this EIP can save a certain amount of gas after execution, and can also slightly improve Ethereum’s existing TPS.

EIP-3860: Limit and compute initialization code

The current maximum initcode is MAX_CODE_SIZE: 24576 (EIP-170), and the new initcode has a maximum (MAX_INITCODE_SIZE = 2 * MAX_CODE_SIZE = 49152), which means that the contract size can be doubled and contract developers can deploy richer functionality. (The contract code is too large will cause the deployment to be unsuccessful, PS:L2 project has also been partially modified to support a higher contract size limit)

Also introduce 2 gas charges for every 32 bytes of initcode chunk to represent the cost of jumpdest-analysis. Because during contract creation, the client must perform jumpdest analysis on initcode before execution. The execution work is linearly related to the size of the initcode.

This means that the cost of initcode per byte will be 0.0625 gas, and the cost of contract deployment gas will increase slightly.

Advantage:

The contract deployment gas fee is slightly increased, but the contract size can be doubled, and contract developers write richer functional code.

EIP-4895: Beacon Chain Withdrawals

The main content is to determine the main process of Beacon Chain withdrawal to EVM, and after the deployment is completed, the Ethereum Beacon Chain staking withdrawal function will be activated.

Advantage:

Activate the Ethereum Beacon Chain staking withdrawal feature.

EIP-3540: EVM Object Format (EOF) v1

This EIP involves significant changes and is not necessarily included in the Shanghai upgrade.

The format described in this EIP introduces a simple and extensible format and introduces validation. Realize the separation of contract code and data.

The new EVM object formats are: magic, version, (section_kind, section_size)+, 0,

 

Advantage:

Versioning facilitates the introduction or deprecation of new features (e.g., account abstraction) in the future;

The separation of contract code and data is beneficial to L2 authentication (OP) and reduces the gas cost of L2 validators;

The separation of contract code and data also makes it easier for on-chain data analysis tools to work.

EIP-3670: EOF—Code Verification

This EIP is not necessarily included in the Shanghai upgrade and incorporates code validation when EIP-3540 contract creation. Reject contracts that do not have defined instructions.

Advantage:

Code validation can be introduced when a contract is created

Posted by:CoinYuppie,Reprinted with attribution to:https://coinyuppie.com/what-will-ethereum-shanghai-upgrade-an-upcoming-eip-bring/
Coinyuppie is an open information publishing platform, all information provided is not related to the views and positions of coinyuppie, and does not constitute any investment and financial advice. Users are expected to carefully screen and prevent risks.

Like (0)
Donate Buy me a coffee Buy me a coffee
Previous 2022-11-08 09:06
Next 2022-11-08 09:09

Related articles