ChainSafe / forest

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

fix(p2p): validate chain exchange responses for block headers #4454

Closed hanabi1224 closed 2 months ago

hanabi1224 commented 3 months ago

Summary of changes

Part of #4441 investigation

Confirmed that ChainExchange failures should be in the console output or log. Theoretically, there is a chance that a remote peer always returns a successful empty response and leads the downloading code to a dead loop with no errors.

This PR tries to mitigate the issue by adding validation logic to the chain exchange response

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

hanabi1224 commented 3 months ago

I'm still waiting for a unit test but manage my expectations. No bonusly to incentivize one. :(

@LesnyRumcajs unit tests added!