Skip to content

Commit

Permalink
fix: centralized service broadcast; feat: rm sleeps from tests (#4517)
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx authored Feb 17, 2025
1 parent 94d7498 commit 1a7896b
Show file tree
Hide file tree
Showing 4 changed files with 283 additions and 310 deletions.
11 changes: 7 additions & 4 deletions ethexe/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ const MAX_ESTABLISHED_INCOMING_CONNECTIONS: u32 = 100;

#[derive(Clone, Debug, Eq, PartialEq)]
pub enum NetworkEvent {
DbResponse(Result<db_sync::Response, db_sync::RequestFailure>),
ExternalValidation(db_sync::ValidatingResponse),
Message {
source: Option<PeerId>,
data: Vec<u8>,
source: Option<PeerId>,
},
DbResponse(Result<db_sync::Response, db_sync::RequestFailure>),
PeerBlocked(PeerId),
ExternalValidation(db_sync::ValidatingResponse),
PeerConnected(PeerId),
}

#[derive(Default, Debug, Clone)]
Expand Down Expand Up @@ -267,9 +268,11 @@ impl NetworkService {
fn handle_swarm_event(&mut self, event: SwarmEvent<BehaviourEvent>) -> Option<NetworkEvent> {
log::trace!("new swarm event: {event:?}");

#[allow(clippy::single_match)]
match event {
SwarmEvent::Behaviour(e) => self.handle_behaviour_event(e),
SwarmEvent::ConnectionEstablished { peer_id, .. } => {
Some(NetworkEvent::PeerConnected(peer_id))
}
_ => None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion ethexe/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,5 @@ impl FusedStream for RpcReceiver {
}
}

#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone)]
pub enum RpcEvent {}
Loading

0 comments on commit 1a7896b

Please sign in to comment.