celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
17 stars 16 forks source link

p2p: Exachange should have built-in single flight protection #154

Open Wondertan opened 4 months ago

Wondertan commented 4 months ago

Currently, if two clients request the same headers, the exchange will end up duplicating requests for headers. We should avoid this with single-flight protection on the Exchange level. We should also consider doing that on a higher Service level once we introduce the Service here