status-im / nimbus-eth1

Nimbus: an Ethereum Execution Client for Resource-Restricted Devices
https://status-im.github.io/nimbus-eth1/
Apache License 2.0
562 stars 106 forks source link

Block witness generation / verification and stateless execution #2327

Open web3-developer opened 3 weeks ago

web3-developer commented 3 weeks ago

Prior work in Nimbus implemented both generation and verification of block witnesses based on the specs here: https://github.com/ethereum/portal-network-specs/blob/01a49a8c9bf08121ecde1b9270a6f2f679cb2568/witness.md

A backup of the stateless code is in this branch for future reference: https://github.com/status-im/nimbus-eth1/tree/stateless-backup. At some point we may want to re-enable these features.

The AccountCache / AccountLedger holds a data structure called the WitnessCache which records every touched account and storage slot for each block. After executing a block of transactions the code supports getting the keys and building a block witness from these keys.

The idea is that these generated witnesses would be shared by block producers and used by stateless clients in order to verify blocks without having to store the state locally.

web3-developer commented 3 weeks ago

Here is the PR which removed this code for the time being: https://github.com/status-im/nimbus-eth1/pull/2295