ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
632 stars 153 forks source link

fix(p2p): disconnect a peer if hello is not received in 30s #4455

Closed hanabi1224 closed 2 months ago

hanabi1224 commented 3 months ago

Summary of changes

This PR makes a few improvements to the p2p hello protocol handling logic

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

ruseinov commented 3 months ago

I wish we had some tests for some of this newly introduced logic. It looks good to me, but I can't help but wonder when all of this complexity is going to regress and blow up on us. And how are we going to notice that. What do you think? Perhaps some of the state-independent pieces of logic could be moved to helpers and tested? We could potentially test the bigger picture too, but I am unsure how mockable all of this currently is.

ruseinov commented 3 months ago

I'll approve this, let's create an issue to cover this with some tests as a follow-up.