File tree 3 files changed +30
-1
lines changed
beacon_node/lighthouse_network
3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ prometheus-client = "0.21.0"
44
44
unused_port = { path = " ../../common/unused_port" }
45
45
delay_map = " 0.3.0"
46
46
void = " 1"
47
+ libp2p-mplex = " 0.40.0"
47
48
48
49
[dependencies .libp2p ]
49
50
version = " 0.52"
Original file line number Diff line number Diff line change @@ -50,13 +50,21 @@ pub fn build_transport(
50
50
transport. or_transport ( libp2p:: websocket:: WsConfig :: new ( trans_clone) )
51
51
} ;
52
52
53
+ // mplex config
54
+ let mut mplex_config = libp2p_mplex:: MplexConfig :: new ( ) ;
55
+ mplex_config. set_max_buffer_size ( 256 ) ;
56
+ mplex_config. set_max_buffer_behaviour ( libp2p_mplex:: MaxBufferBehaviour :: Block ) ;
57
+
53
58
// yamux config
54
59
let mut yamux_config = yamux:: Config :: default ( ) ;
55
60
yamux_config. set_window_update_mode ( yamux:: WindowUpdateMode :: on_read ( ) ) ;
56
61
let ( transport, bandwidth) = transport
57
62
. upgrade ( core:: upgrade:: Version :: V1 )
58
63
. authenticate ( generate_noise_config ( & local_private_key) )
59
- . multiplex ( yamux_config)
64
+ . multiplex ( core:: upgrade:: SelectUpgrade :: new (
65
+ yamux_config,
66
+ mplex_config,
67
+ ) )
60
68
. timeout ( Duration :: from_secs ( 10 ) )
61
69
. boxed ( )
62
70
. with_bandwidth_logging ( ) ;
You can’t perform that action at this time.
0 commit comments