File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11//! Request-Response [`Behaviour`] and [`NetworkBehaviour`] for the P2P protocol.
22
3- use std:: collections:: HashSet ;
3+ use std:: { collections:: HashSet , time :: Duration } ;
44
55use libp2p:: {
66 allow_block_list:: { AllowedPeers , Behaviour as AllowListBehaviour } ,
@@ -67,6 +67,16 @@ impl Behaviour {
6767 . validation_mode ( gossipsub:: ValidationMode :: Permissive )
6868 . validate_messages ( )
6969 . max_transmit_size ( MAX_TRANSMIT_SIZE )
70+ // Avoids spamming the network and nodes with messages
71+ . duplicate_cache_time ( Duration :: from_secs ( 60 * 5 ) ) // default is 1 min
72+ . published_message_ids_cache_time ( Duration :: from_secs ( 60 ) ) // default is 10
73+ . max_ihave_messages ( 100 ) // default is 10
74+ . gossip_retransimission ( 1 ) // default is 3
75+ . iwant_followup_time ( Duration :: from_secs ( 2 ) ) // default is 3
76+ . gossip_lazy ( 2 ) // default is 6
77+ . gossip_factor ( 0.1 ) // default is 0.25
78+ . history_gossip ( 1 ) // default is 3
79+ . history_length ( 3 ) // default is 5
7080 . build ( )
7181 . expect ( "gossipsub config at this stage must be valid" ) ,
7282 None ,
You can’t perform that action at this time.
0 commit comments