123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2023 Nomadic Labs, <contact@nomadic-labs.com> *)(* Copyright (c) 2023 Functori, <contact@functori.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(* TODO: https://gitlab.com/tezos/tezos/-/issues/5565
Document these values (taken from octez-node), and chage them if needed.
*)moduleP2p_limits=structletconnection_timeout=Time.System.Span.of_seconds_exn10.letauthentication_timeout=Time.System.Span.of_seconds_exn5.letgreylist_timeout=Time.System.Span.of_seconds_exn86400.(* one day *)(* [maintenance_idle_time] is set to [None] to disable the internal maintenance
mechanism of Octez-p2p. *)letmaintenance_idle_time=Noneletmin_connections=10letexpected_connections=50letmax_connections=100letbacklog=20letmax_incoming_connections=20letmax_download_speed=Noneletmax_upload_speed=Noneletread_buffer_size=1lsl14letread_queue_size=Noneletwrite_queue_size=Noneletincoming_app_message_queue_size=Noneletincoming_message_queue_size=Noneletoutgoing_message_queue_size=Noneletmax_known_points=Some(400,300)letmax_known_peer_ids=Some(400,300)letpeer_greylist_size=1023(* historical value *)letip_greylist_size_in_kilobytes=2*1024(* two megabytes has shown good properties in simulation *)letip_greylist_cleanup_delay=Time.System.Span.of_seconds_exn86400.(* one day *)letbinary_chunks_size=None(** Contraty to octez-node, [swap_linger] is disabled for Gossipsub. *)letswap_linger=NoneendmoduleP2p_reconnection_config=structletfactor=1.05letinitial_delay=Ptime.Span.of_int_s1letdisconnection_delay=Ptime.Span.of_int_s5letincrease_cap=Ptime.Span.of_int_s60endmoduleP2p_config=structletexpected_pow=26.letlistening_port=11732letlistening_addr=P2p_addr.of_string_exn"127.0.0.1"letdiscovery_port=Noneletdiscovery_addr=Noneletadvertised_port=Somelistening_portlettrusted_points=[]letprivate_mode=falseletproof_of_work_target=Crypto_box.make_pow_targetexpected_powlettrust_discovered_peers=falseletdisable_peer_discovery=trueend