Skip to content

Commit df19b62

Browse files
authored
Remove beta tag from gossipsub 1.2 (#6344)
* Remove the beta tag from gossipsub v1.2 * fix clippy * Merge branch 'unstable' into remove-beta-tag
1 parent 369807b commit df19b62

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

beacon_node/lighthouse_network/gossipsub/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## 0.5 Sigma Prime fork
2+
- Remove the beta tag from the v1.2 upgrade.
3+
See [PR 6344](https://github.com/sigp/lighthouse/pull/6344)
24

35
- Implement IDONTWANT messages as per [spec](https://github.com/libp2p/specs/pull/548).
46
See [PR 5422](https://github.com/sigp/lighthouse/pull/5422)

beacon_node/lighthouse_network/gossipsub/src/behaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,7 @@ where
27162716
};
27172717

27182718
// Only gossipsub 1.2 peers support IDONTWANT.
2719-
if peer.kind != PeerKind::Gossipsubv1_2_beta {
2719+
if peer.kind != PeerKind::Gossipsubv1_2 {
27202720
continue;
27212721
}
27222722

beacon_node/lighthouse_network/gossipsub/src/behaviour/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5259,7 +5259,7 @@ fn sends_idontwant() {
52595259
.to_subscribe(true)
52605260
.gs_config(Config::default())
52615261
.explicit(1)
5262-
.peer_kind(PeerKind::Gossipsubv1_2_beta)
5262+
.peer_kind(PeerKind::Gossipsubv1_2)
52635263
.create_network();
52645264

52655265
let local_id = PeerId::random();
@@ -5344,7 +5344,7 @@ fn doesnt_forward_idontwant() {
53445344
.to_subscribe(true)
53455345
.gs_config(Config::default())
53465346
.explicit(1)
5347-
.peer_kind(PeerKind::Gossipsubv1_2_beta)
5347+
.peer_kind(PeerKind::Gossipsubv1_2)
53485348
.create_network();
53495349

53505350
let local_id = PeerId::random();
@@ -5393,7 +5393,7 @@ fn parses_idontwant() {
53935393
.to_subscribe(true)
53945394
.gs_config(Config::default())
53955395
.explicit(1)
5396-
.peer_kind(PeerKind::Gossipsubv1_2_beta)
5396+
.peer_kind(PeerKind::Gossipsubv1_2)
53975397
.create_network();
53985398

53995399
let message_id = MessageId::new(&[0, 1, 2, 3]);
@@ -5425,7 +5425,7 @@ fn clear_stale_idontwant() {
54255425
.to_subscribe(true)
54265426
.gs_config(Config::default())
54275427
.explicit(1)
5428-
.peer_kind(PeerKind::Gossipsubv1_2_beta)
5428+
.peer_kind(PeerKind::Gossipsubv1_2)
54295429
.create_network();
54305430

54315431
let peer = gs.connected_peers.get_mut(&peers[2]).unwrap();

beacon_node/lighthouse_network/gossipsub/src/protocol.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ use void::Void;
4040

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

43-
pub(crate) const GOSSIPSUB_1_2_0_BETA_PROTOCOL: ProtocolId = ProtocolId {
43+
pub(crate) const GOSSIPSUB_1_2_0_PROTOCOL: ProtocolId = ProtocolId {
4444
protocol: StreamProtocol::new("/meshsub/1.2.0"),
45-
kind: PeerKind::Gossipsubv1_2_beta,
45+
kind: PeerKind::Gossipsubv1_2,
4646
};
4747
pub(crate) const GOSSIPSUB_1_1_0_PROTOCOL: ProtocolId = ProtocolId {
4848
protocol: StreamProtocol::new("/meshsub/1.1.0"),
@@ -74,7 +74,7 @@ impl Default for ProtocolConfig {
7474
max_transmit_size: 65536,
7575
validation_mode: ValidationMode::Strict,
7676
protocol_ids: vec![
77-
GOSSIPSUB_1_2_0_BETA_PROTOCOL,
77+
GOSSIPSUB_1_2_0_PROTOCOL,
7878
GOSSIPSUB_1_1_0_PROTOCOL,
7979
GOSSIPSUB_1_0_0_PROTOCOL,
8080
],

beacon_node/lighthouse_network/gossipsub/src/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub(crate) struct PeerConnections {
132132
#[allow(non_camel_case_types)]
133133
pub enum PeerKind {
134134
/// A gossipsub 1.2 peer.
135-
Gossipsubv1_2_beta,
135+
Gossipsubv1_2,
136136
/// A gossipsub 1.1 peer.
137137
Gossipsubv1_1,
138138
/// A gossipsub 1.0 peer.
@@ -148,7 +148,7 @@ impl PeerKind {
148148
pub(crate) fn is_gossipsub(&self) -> bool {
149149
matches!(
150150
self,
151-
Self::Gossipsubv1_2_beta | Self::Gossipsubv1_1 | Self::Gossipsub
151+
Self::Gossipsubv1_2 | Self::Gossipsubv1_1 | Self::Gossipsub
152152
)
153153
}
154154
}
@@ -623,7 +623,7 @@ impl PeerKind {
623623
Self::Floodsub => "Floodsub",
624624
Self::Gossipsub => "Gossipsub v1.0",
625625
Self::Gossipsubv1_1 => "Gossipsub v1.1",
626-
Self::Gossipsubv1_2_beta => "Gossipsub v1.2-beta",
626+
Self::Gossipsubv1_2 => "Gossipsub v1.2",
627627
}
628628
}
629629
}

0 commit comments

Comments
 (0)