Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

chore: update libp2p to 0.52.1 #14429

Merged
merged 53 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3102dbd
update libp2p to 0.52.0
melekes Jun 21, 2023
54778bd
proto name now must implement `AsRef<str>`
melekes Jun 21, 2023
839641b
update libp2p version everywhere
melekes Jun 21, 2023
45ff813
ToSwarm, FromBehaviour, ToBehaviour
melekes Jun 21, 2023
12ba133
new NetworkBehaviour invariants
melekes Jun 22, 2023
fe656e8
replace `Vec<u8>` with `StreamProtocol`
melekes Jun 22, 2023
37e7408
rename ConnectionHandlerEvent::Custom to NotifyBehaviour
melekes Jun 22, 2023
d5b8198
remove DialError & ListenError invariants
melekes Jun 23, 2023
81f5cd0
use connection_limits::Behaviour
melekes Jun 23, 2023
4d068dd
impl `void::Void` for `BehaviourOut`
melekes Jun 27, 2023
3e54dd1
KademliaHandler no longer public
melekes Jun 27, 2023
076635b
fix StreamProtocol construction
melekes Jun 27, 2023
d1fd05c
update libp2p-identify to 0.2.0
melekes Jun 27, 2023
f01de8b
remove non-existing methods from PollParameters
melekes Jun 28, 2023
bea250f
`P2p` now contains `PeerId`, not `Multihash`
melekes Jun 28, 2023
405ebcb
use multihash-codetable crate
melekes Jun 28, 2023
394eba1
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jun 28, 2023
ac5cfd3
update Cargo.lock
melekes Jun 28, 2023
3d04207
reformat text
melekes Jun 28, 2023
5f511cc
comment out tests for now
melekes Jun 29, 2023
f141f03
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jun 29, 2023
6970c11
remove `.into()` from P2p
melekes Jun 29, 2023
49e0ba7
confirm observed addr manually
melekes Jul 4, 2023
477ebc1
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 4, 2023
dd4a718
remove SwarmEvent::Banned
melekes Jul 4, 2023
c4f0a9c
fix imports
melekes Jul 4, 2023
350902c
replace `libp2p` with smaller deps in network-gossip
melekes Jul 4, 2023
b67be46
bring back tests
melekes Jul 4, 2023
3c179f0
finish rewriting tests
melekes Jul 4, 2023
720a068
uncomment handler tests
melekes Jul 5, 2023
7ffa62a
Revert "uncomment handler tests"
melekes Jul 6, 2023
07f2db8
add a fixme
melekes Jul 6, 2023
0370270
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 7, 2023
b25efe5
update Cargo.lock
melekes Jul 7, 2023
343a86e
remove extra From
melekes Jul 7, 2023
965cc2d
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 10, 2023
3b1c8f2
make void uninhabited
melekes Jul 17, 2023
a506670
fix discovery test
melekes Jul 17, 2023
6c78a74
use autonat protocols
melekes Jul 17, 2023
09f1ab6
fix SyncNotificationsClogged invariant
melekes Jul 17, 2023
e22dc73
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 17, 2023
2b1377c
only set server mode manually in tests
melekes Jul 17, 2023
6aa6c8d
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 17, 2023
8538215
Merge remote-tracking branch 'origin/master' into anton/libp2p-0.52.0
Jul 17, 2023
a6e2e25
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 18, 2023
c45b465
address @dmitry-markin comments
melekes Jul 18, 2023
d464408
remove autonat
melekes Jul 18, 2023
8b9309d
removed unused var
melekes Jul 18, 2023
73df4d5
fix EOL
melekes Jul 18, 2023
c34f538
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 19, 2023
d44efb5
update smallvec and sha2
melekes Jul 19, 2023
ff76e2a
bump k256
melekes Jul 19, 2023
925cad0
Merge branch 'master' into anton/libp2p-0.52.0
melekes Jul 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename ConnectionHandlerEvent::Custom to NotifyBehaviour
  • Loading branch information
melekes committed Jun 22, 2023
commit 37e74088882ce1740cac945add23cadacacf0a37
24 changes: 12 additions & 12 deletions client/network/src/protocol/notifications/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ impl ConnectionHandler for NotifsHandler {

match protocol_info.state {
State::Closed { pending_opening } => {
self.events_queue.push_back(ConnectionHandlerEvent::Custom(
self.events_queue.push_back(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::OpenDesiredByRemote { protocol_index },
));

Expand Down Expand Up @@ -536,7 +536,7 @@ impl ConnectionHandler for NotifsHandler {
in_substream: in_substream.take(),
};

self.events_queue.push_back(ConnectionHandlerEvent::Custom(
self.events_queue.push_back(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::OpenResultOk {
protocol_index,
negotiated_fallback: new_open.negotiated_fallback,
Expand Down Expand Up @@ -565,7 +565,7 @@ impl ConnectionHandler for NotifsHandler {
self.protocols[dial_upgrade_error.info].state =
State::Closed { pending_opening: false };

self.events_queue.push_back(ConnectionHandlerEvent::Custom(
self.events_queue.push_back(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::OpenResultErr { protocol_index: dial_upgrade_error.info },
));
},
Expand Down Expand Up @@ -651,7 +651,7 @@ impl ConnectionHandler for NotifsHandler {
self.protocols[protocol_index].state =
State::Closed { pending_opening: true };

self.events_queue.push_back(ConnectionHandlerEvent::Custom(
self.events_queue.push_back(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::OpenResultErr { protocol_index },
));
},
Expand All @@ -661,7 +661,7 @@ impl ConnectionHandler for NotifsHandler {
State::Closed { .. } => {},
}

self.events_queue.push_back(ConnectionHandlerEvent::Custom(
self.events_queue.push_back(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::CloseResult { protocol_index },
));
},
Expand Down Expand Up @@ -755,7 +755,7 @@ impl ConnectionHandler for NotifsHandler {
Poll::Ready(Err(_)) => {
*out_substream = None;
let event = NotifsHandlerOut::CloseDesired { protocol_index };
return Poll::Ready(ConnectionHandlerEvent::Custom(event))
return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event))
},
};
},
Expand All @@ -781,7 +781,7 @@ impl ConnectionHandler for NotifsHandler {
Poll::Pending => {},
Poll::Ready(Some(Ok(message))) => {
let event = NotifsHandlerOut::Notification { protocol_index, message };
return Poll::Ready(ConnectionHandlerEvent::Custom(event))
return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event))
},
Poll::Ready(None) | Poll::Ready(Some(Err(_))) => *in_substream = None,
},
Expand All @@ -793,7 +793,7 @@ impl ConnectionHandler for NotifsHandler {
Poll::Ready(Err(_)) => {
self.protocols[protocol_index].state =
State::Closed { pending_opening: *pending_opening };
return Poll::Ready(ConnectionHandlerEvent::Custom(
return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::CloseDesired { protocol_index },
))
},
Expand Down Expand Up @@ -1591,15 +1591,15 @@ pub mod tests {
futures::future::poll_fn(|cx| {
assert!(std::matches!(
handler.poll(cx),
Poll::Ready(ConnectionHandlerEvent::Custom(
Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::OpenDesiredByRemote { protocol_index: 0 },
))
));
assert!(std::matches!(
handler.poll(cx),
Poll::Ready(ConnectionHandlerEvent::Custom(NotifsHandlerOut::CloseDesired {
protocol_index: 0
},))
Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(
NotifsHandlerOut::CloseDesired { protocol_index: 0 },
))
));
Poll::Ready(())
})
Expand Down
4 changes: 2 additions & 2 deletions client/network/src/request_responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ impl RequestResponsesBehaviour {
};

let rq_rp = Behaviour::new(
iter::once(protocol.name.as_bytes().to_vec())
.chain(protocol.fallback_names.iter().map(|name| name.as_bytes().to_vec()))
iter::once(protocol.name)
.chain(protocol.fallback_names)
.zip(iter::repeat(protocol_support)),
cfg,
);
Expand Down