mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
IDONTWANT message optimisation to cutoff for smaller messages (#6456)
* idontwant message opitmising * requested changes and linter appeasing * added the config cli flag * Merge branch 'unstable' into fix/idontwant-optimise * cli docs generated * const declaration * Hide extra technical cli flag * passing ci * Merge branch 'unstable' into fix/idontwant-optimise
This commit is contained in:
@@ -1812,9 +1812,6 @@ where
|
||||
// Calculate the message id on the transformed data.
|
||||
let msg_id = self.config.message_id(&message);
|
||||
|
||||
// Broadcast IDONTWANT messages.
|
||||
self.send_idontwant(&raw_message, &msg_id, propagation_source);
|
||||
|
||||
// Check the validity of the message
|
||||
// Peers get penalized if this message is invalid. We don't add it to the duplicate cache
|
||||
// and instead continually penalize peers that repeatedly send this message.
|
||||
@@ -1830,6 +1827,12 @@ where
|
||||
self.mcache.observe_duplicate(&msg_id, propagation_source);
|
||||
return;
|
||||
}
|
||||
|
||||
// Broadcast IDONTWANT messages
|
||||
if raw_message.raw_protobuf_len() > self.config.idontwant_message_size_threshold() {
|
||||
self.send_idontwant(&raw_message, &msg_id, propagation_source);
|
||||
}
|
||||
|
||||
tracing::debug!(
|
||||
message=%msg_id,
|
||||
"Put message in duplicate_cache and resolve promises"
|
||||
|
||||
Reference in New Issue
Block a user