celestia-node
celestia-node copied to clipboard
service/header: Implement throttling on how many `ExtendedHeader`s can be requested/sent at once.
We need to figure out the max packet size we are willing to send across the network for any given message, not just ExtendedHeader
- related packets. If we are to send batched headers eventually, then we need to measure the packet size so that it does not increase whatever max packet size limit we send.
We could do this either on the request side (so only able to request max 100, for example, headers at a time), or we can just break up the []*ExtendedHeader
packet so that it sends maximum 50 headers in a packet at a time.
These are obviously arbitrary numbers and will require testing to see what kind of max packet size is most efficient for our network, but we need to define these metrics post Devnet.
@renaynay, Currently, we request 128 headers, but the responding side doesn't have a check for max headers, so that's DOS vector. Luckily it is just a one if to fix
We can just implement a maxMessageSize on the wire.
Meh we can just implement the same 128 headers max per message on the serving side.
@renaynay, Currently, we request 128 headers, but the responding side doesn't have a check for max headers, so that's DOS vector. Luckily it is just a one if to fix
*512 https://github.com/celestiaorg/celestia-node/blob/main/header/sync/sync.go#L319
Yep, we changed it after that comment