status-im / nimbus-eth1

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

Integration of Portal network / fluffy into Nimbus EL #2147

Open kdeme opened 5 months ago

kdeme commented 5 months ago

PoC of the Portal network as backend for retrieving history data (EL block headers, bodies and receipts) before a certain (configurable) threshold (e.g. everything before TheMerge).

Basically, instead of grabbing the data from it database on incoming requests, it should request it over the Portal network. Or, it could first look into its database, and if the data is not there, move to requests over the network. TBD.

This might require adapting Fluffy to provide a better API.

kdeme commented 4 months ago

Location where to request over portal-history network instead of grabbing from db: https://github.com/status-im/nimbus-eth1/blob/2891b9aa7dd0fec7b1aec7fe486959d4d04cfebe/nimbus/sync/handlers/eth.nim#L466

As PoC, can intially add Portal network to EthWireRef object and go from there.

Eventually should probably have diffferent (for the different backends, e.g. also Era1) objects that can be selected from an Abstraction layer above this.