breaks prunes data into chunks to fit into packets (#13613)

Validator logs show that prune messages are dropped because they exceed
packet data size:
https://github.com/solana-labs/solana/blob/f25c969ad/perf/src/packet.rs#L90-L92
This can exacerbate gossip traffic by redundantly increasing push
messages across network. The workaround is to break prunes into smaller
chunks and send over in multiple messages.
This commit is contained in:
behzad nouri
2020-11-19 16:38:01 +00:00
committed by GitHub
parent 83799356dd
commit 1ffab5de77
3 changed files with 91 additions and 22 deletions

View File

@ -88,6 +88,9 @@ pub fn to_packets_with_destination<T: Serialize>(
for (dest_and_data, o) in dests_and_data.iter().zip(out.packets.iter_mut()) {
if !dest_and_data.0.ip().is_unspecified() && dest_and_data.0.port() != 0 {
if let Err(e) = Packet::populate_packet(o, Some(&dest_and_data.0), &dest_and_data.1) {
// TODO: This should never happen. Instead the caller should
// break the payload into smaller messages, and here any errors
// should be propagated.
error!("Couldn't write to packet {:?}. Data skipped.", e);
}
} else {