Skip to content

Commit

Permalink
Remove beta tag from gossipsub 1.2 (#6344)
Browse files Browse the repository at this point in the history
* Remove the beta tag from gossipsub v1.2

* fix clippy

* Merge branch 'unstable' into remove-beta-tag
  • Loading branch information
AgeManning authored Sep 5, 2024
1 parent 369807b commit df19b62
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions beacon_node/lighthouse_network/gossipsub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 0.5 Sigma Prime fork
- Remove the beta tag from the v1.2 upgrade.
See [PR 6344](https://github.com/sigp/lighthouse/pull/6344)

- Implement IDONTWANT messages as per [spec](https://github.com/libp2p/specs/pull/548).
See [PR 5422](https://github.com/sigp/lighthouse/pull/5422)
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/gossipsub/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2716,7 +2716,7 @@ where
};

// Only gossipsub 1.2 peers support IDONTWANT.
if peer.kind != PeerKind::Gossipsubv1_2_beta {
if peer.kind != PeerKind::Gossipsubv1_2 {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5259,7 +5259,7 @@ fn sends_idontwant() {
.to_subscribe(true)
.gs_config(Config::default())
.explicit(1)
.peer_kind(PeerKind::Gossipsubv1_2_beta)
.peer_kind(PeerKind::Gossipsubv1_2)
.create_network();

let local_id = PeerId::random();
Expand Down Expand Up @@ -5344,7 +5344,7 @@ fn doesnt_forward_idontwant() {
.to_subscribe(true)
.gs_config(Config::default())
.explicit(1)
.peer_kind(PeerKind::Gossipsubv1_2_beta)
.peer_kind(PeerKind::Gossipsubv1_2)
.create_network();

let local_id = PeerId::random();
Expand Down Expand Up @@ -5393,7 +5393,7 @@ fn parses_idontwant() {
.to_subscribe(true)
.gs_config(Config::default())
.explicit(1)
.peer_kind(PeerKind::Gossipsubv1_2_beta)
.peer_kind(PeerKind::Gossipsubv1_2)
.create_network();

let message_id = MessageId::new(&[0, 1, 2, 3]);
Expand Down Expand Up @@ -5425,7 +5425,7 @@ fn clear_stale_idontwant() {
.to_subscribe(true)
.gs_config(Config::default())
.explicit(1)
.peer_kind(PeerKind::Gossipsubv1_2_beta)
.peer_kind(PeerKind::Gossipsubv1_2)
.create_network();

let peer = gs.connected_peers.get_mut(&peers[2]).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/lighthouse_network/gossipsub/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ use void::Void;

pub(crate) const SIGNING_PREFIX: &[u8] = b"libp2p-pubsub:";

pub(crate) const GOSSIPSUB_1_2_0_BETA_PROTOCOL: ProtocolId = ProtocolId {
pub(crate) const GOSSIPSUB_1_2_0_PROTOCOL: ProtocolId = ProtocolId {
protocol: StreamProtocol::new("/meshsub/1.2.0"),
kind: PeerKind::Gossipsubv1_2_beta,
kind: PeerKind::Gossipsubv1_2,
};
pub(crate) const GOSSIPSUB_1_1_0_PROTOCOL: ProtocolId = ProtocolId {
protocol: StreamProtocol::new("/meshsub/1.1.0"),
Expand Down Expand Up @@ -74,7 +74,7 @@ impl Default for ProtocolConfig {
max_transmit_size: 65536,
validation_mode: ValidationMode::Strict,
protocol_ids: vec![
GOSSIPSUB_1_2_0_BETA_PROTOCOL,
GOSSIPSUB_1_2_0_PROTOCOL,
GOSSIPSUB_1_1_0_PROTOCOL,
GOSSIPSUB_1_0_0_PROTOCOL,
],
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/lighthouse_network/gossipsub/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub(crate) struct PeerConnections {
#[allow(non_camel_case_types)]
pub enum PeerKind {
/// A gossipsub 1.2 peer.
Gossipsubv1_2_beta,
Gossipsubv1_2,
/// A gossipsub 1.1 peer.
Gossipsubv1_1,
/// A gossipsub 1.0 peer.
Expand All @@ -148,7 +148,7 @@ impl PeerKind {
pub(crate) fn is_gossipsub(&self) -> bool {
matches!(
self,
Self::Gossipsubv1_2_beta | Self::Gossipsubv1_1 | Self::Gossipsub
Self::Gossipsubv1_2 | Self::Gossipsubv1_1 | Self::Gossipsub
)
}
}
Expand Down Expand Up @@ -623,7 +623,7 @@ impl PeerKind {
Self::Floodsub => "Floodsub",
Self::Gossipsub => "Gossipsub v1.0",
Self::Gossipsubv1_1 => "Gossipsub v1.1",
Self::Gossipsubv1_2_beta => "Gossipsub v1.2-beta",
Self::Gossipsubv1_2 => "Gossipsub v1.2",
}
}
}
Expand Down

0 comments on commit df19b62

Please sign in to comment.