chainbound / valtrack

An Ethereum validator crawler
MIT License
13 stars 3 forks source link

`PeerStore` implementation #8

Closed mempirate closed 4 months ago

mempirate commented 4 months ago

Context

We need a PeerStore for 2 things:

If we fail to get metadata from a peer, we put them in the peer_backoffs cache. We can then also iterate over the cache and see which backoffs have expired (i.e. now() - last_seen > backoff_timeout)

If we succeed getting metadata (either first try or later) we put them in the peer_metadata map and emit an event.