besu icon indicating copy to clipboard operation
besu copied to clipboard

EIP-2935: Serve historical block hashes from state

Open matkt opened this issue 1 year ago • 2 comments
trafficstars

Description

For verkle we need to implement the EIP 2935 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2935.md

in order to save historical block hashes in the state. There is already an implementation in the verkle branch

matkt avatar Feb 06 '24 10:02 matkt

@matkt do you want help extracting it from the Verkle branch into Besu?

Gabriel-Trintinalia avatar Apr 17 '24 18:04 Gabriel-Trintinalia

yes feel free to do it 👍

most important is here

  • Write historical block history https://github.com/hyperledger/besu/blob/verkle/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/HistoricalBlockHashProcessor.java
  • Allow to add exception in order to write empty account in the trie https://github.com/hyperledger/besu/blob/verkle/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ClearEmptyAccountStrategy.java
  • Define the clear empty account in the protocol schedule https://github.com/hyperledger/besu/blob/verkle/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java#L143 https://github.com/hyperledger/besu/blob/verkle/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java#L296
  • Add clear empty account with exception for the new fork https://github.com/hyperledger/besu/blob/verkle/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java#L743
  • Add historical block hash processor for the new fork https://github.com/hyperledger/besu/blob/verkle/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java#L769
  • Call it during block processor https://github.com/hyperledger/besu/blob/verkle/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/AbstractBlockProcessor.java#L115

etc..

matkt avatar Apr 18 '24 08:04 matkt