a16z / helios

A fast, secure, and portable light client for Ethereum
MIT License
1.76k stars 269 forks source link

fetch beaconchain data from p2p network #59

Open ncitron opened 1 year ago

ncitron commented 1 year ago

This one might be a stretch, but if we can fetch all beaconchain data (updates and beacon blocks) from the p2p network, we could entirely remove the need for an eth2 rpc. Nimbus nodes already gossip all the light client data we need.

ameya-deshmukh commented 1 year ago

Hey @ncitron would love to pick this up and give it a go. Let me know if there's anyone else looking to work on this. Will update with a rough plan over the weekend.

ncitron commented 1 year ago

Thats great! You two may want to coordinate to see if there is room for collaboration. I imagine there may be since its a somewhat hefty project.

I've also been thinking about how we should integrate p2p. To start, I think it is ok if we just allow p2p optionally with a flag. However, I think eventually I nice default would be to implement a hybrid approach, where we begin syncing using the rpc to start, and begin peering with p2p simultaneously. Once we have suitable peers we can switch to p2p mode. In cases where the centralized rpc is available, this allows us to sync incredibly quickly from a cold start, but when it is not, we can still sync fully from p2p. Seems like a nice tradeoff, but curious to hear what others think about this strategy.

ameya-deshmukh commented 1 year ago

Would love to collaborate. Adding you.

ameya-deshmukh commented 1 year ago

Hey sorry. Was busy the last few days. Pinging you right now.