mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Gossipsub update (#1400)
## Issue Addressed N/A ## Proposed Changes This provides a number of corrections and improvements to gossipsub. Specifically - Enables options for greater privacy around the message author - Provides greater flexibility on message validation - Prevents unvalidated messages from being gossiped - Shifts the duplicate cache to a time-based cache inside gossipsub - Updates the message-id to handle bytes - Bug fixes related to mesh maintenance and topic subscription. This should improve our attestation inclusion rate.
This commit is contained in:
@@ -54,9 +54,11 @@ pub enum NetworkMessage<T: EthSpec> {
|
||||
},
|
||||
/// Publish a list of messages to the gossipsub protocol.
|
||||
Publish { messages: Vec<PubsubMessage<T>> },
|
||||
/// Propagate a received gossipsub message.
|
||||
Propagate {
|
||||
/// Validates a received gossipsub message. This will propagate the message on the network.
|
||||
Validate {
|
||||
/// The peer that sent us the message. We don't send back to this peer.
|
||||
propagation_source: PeerId,
|
||||
/// The id of the message we are validating and propagating.
|
||||
message_id: MessageId,
|
||||
},
|
||||
/// Reports a peer to the peer manager for performing an action.
|
||||
@@ -213,7 +215,7 @@ fn spawn_service<T: BeaconChainTypes>(
|
||||
NetworkMessage::SendError{ peer_id, error, id, reason } => {
|
||||
service.libp2p.respond_with_error(peer_id, id, error, reason);
|
||||
}
|
||||
NetworkMessage::Propagate {
|
||||
NetworkMessage::Validate {
|
||||
propagation_source,
|
||||
message_id,
|
||||
} => {
|
||||
@@ -224,7 +226,7 @@ fn spawn_service<T: BeaconChainTypes>(
|
||||
service
|
||||
.libp2p
|
||||
.swarm
|
||||
.propagate_message(&propagation_source, message_id);
|
||||
.validate_message(&propagation_source, message_id);
|
||||
}
|
||||
NetworkMessage::Publish { messages } => {
|
||||
let mut topic_kinds = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user