nimbus-eth1 icon indicating copy to clipboard operation
nimbus-eth1 copied to clipboard

Implement/Investigate double batched merkle accumulator

Open KonradStaniec opened this issue 2 years ago • 2 comments

To validate all chain history data in stateless manner the double batched merkle accumulator will be needed - https://github.com/ethereum/stateless-ethereum-specs/blob/master/portal-network.md#chain-history-headers-blocks-and-receipts.

The scheme is described in several doc like: https://ethresear.ch/t/double-batched-merkle-log-accumulator/571 https://notes.ethereum.org/KaMqlqxiQLCWyDoXCUCC4Q#Hueristics-for-Validation

It would be also good to have some data about proof sizes and general security of the scheme, so those issues should probably be investigated as a part of the task.

KonradStaniec avatar Jul 12 '21 08:07 KonradStaniec

It seems that this depends on having merkelization for ssz serialization which is currently not implemented in https://github.com/status-im/nim-eth/tree/master/eth/ssz, but on the other hand it is implemented in https://github.com/status-im/nimbus-eth2/blob/stable/beacon_chain/ssz/merkleization.nim, therefore prerequisite would be to move this piece of code to library level.

KonradStaniec avatar Jul 12 '21 15:07 KonradStaniec

I've done an effort to move most of that ssz code out to a new repo, nim-ssz-serialization: https://github.com/status-im/nimbus-eth2/pull/2646 & https://github.com/status-im/nim-ssz-serialization/pull/1. The latter PR requires some CI fixes still but foremost agreement that we want to split it off as is proposed there.

Else, for now, we can duplicate the code also in nim-eth, yes.

kdeme avatar Jul 12 '21 15:07 kdeme

In the mean while an accumulator has been added to the Portal history network and more recently Fluffy can also work with headers + proofs from this accumulator. The latter is added in PR https://github.com/status-im/nimbus-eth1/pull/1281.

kdeme avatar Nov 04 '22 08:11 kdeme