besu
besu copied to clipboard
EIP-2935: Serve historical block hashes from state
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 do you want help extracting it from the Verkle branch into Besu?
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..