migalabs / armiarma

Armiarma is a Libp2p open-network crawler with a current focus on Ethereum's CL network
https://monitoreth.io
MIT License
37 stars 13 forks source link

Missing last disconnection for connected peers when crawler goes down accidentally #26

Closed cortze closed 2 years ago

cortze commented 2 years ago

We knew that this edgy case could happend, and it is time to check for the best solution to fix it.

Since we would have to iter through the entire database to see which peers had the connected flag enabled, I propose to register from all the peers in the peerstore which was the time of the last connection/disconnection event. This way, we would know when was the last moment when we are sure that the crawler was active, without adding/exporting extra info.

What do you think about it @alrevuelta @tarun96T ?

cortze commented 2 years ago

I think that we could iterate from the last NegativeConnectionAttempts of each of the peers to accourately guess when did the crawler disconnect/crashed.

cortze commented 2 years ago

Closing Issue, got solved in #36