Skip to content

Commit

Permalink
chore: small changes to the gossip
Browse files Browse the repository at this point in the history
  • Loading branch information
shekohex committed Nov 8, 2024
1 parent c9e89a3 commit 29372c7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions blueprint-test-utils/src/test_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,12 @@ pub async fn new_test_ext_blueprint_manager<
pub fn find_open_tcp_bind_port() -> u16 {
let listener = std::net::TcpListener::bind(format!("{LOCAL_BIND_ADDR}:0"))
.expect("Should bind to localhost");
listener
let port = listener
.local_addr()
.expect("Should have a local address")
.port()
.port();
drop(listener);
port
}

pub struct LocalhostTestExt {
Expand Down
Submodule forge-std updated 1 files
+1 −1 package.json
2 changes: 1 addition & 1 deletion blueprints/incredible-squaring/contracts/lib/forge-std
Submodule forge-std updated 1 files
+1 −1 package.json
4 changes: 2 additions & 2 deletions sdk/src/network/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::error::Error;
use async_trait::async_trait;
use auto_impl::auto_impl;
use core::fmt::Display;
use dashmap::DashMap;
use futures::{Stream, StreamExt};
Expand Down Expand Up @@ -87,7 +86,7 @@ impl Display for ProtocolMessage {
}

#[async_trait]
#[auto_impl(&, Arc)]
#[auto_impl::auto_impl(&, Box, Arc)]
pub trait Network: Send + Sync + 'static {
async fn next_message(&self) -> Option<ProtocolMessage>;
async fn send_message(&self, message: ProtocolMessage) -> Result<(), Error>;
Expand Down Expand Up @@ -753,6 +752,7 @@ mod tests {

let received_msg = subnetwork0.recv().await.unwrap();
assert_eq!(received_msg.payload, msg.payload);
tracing::info!("Done nested depth = {cur_depth}/{max_depth}");

Box::pin(nested_multiplex(
cur_depth + 1,
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/network/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,8 @@ pub fn multiplexed_libp2p_network(config: NetworkConfig) -> NetworkResult {
}

let ips_to_bind_to = vec![
IpAddr::from_str("127.0.0.1").unwrap(),
IpAddr::from_str("0.0.0.0").unwrap(),
IpAddr::from_str("::1").unwrap(),
IpAddr::from_str("::").unwrap(),
];

for addr in ips_to_bind_to {
Expand Down

0 comments on commit 29372c7

Please sign in to comment.