tempo_commonware_node/config.rs
1//! The non-reth/non-chainspec part of the node configuration.
2//!
3//! This is a verbatim copy of the alto config for now.
4//!
5//! It feels more apt to call this "config" rather than "genesis" as both
6//! summit and the tempo node are doing: the validator set is
7//! not coming to consensus over the information contained in this type,
8//! and neither does this information feed into the genesis block generated
9//! by the execution client/reth. This genesis block is entirely the domain
10//! of the chainspec, which is separate from the config.
11
12use std::num::NonZeroU32;
13
14use governor::Quota;
15
16// Hardcoded values to configure commonware's alto toy chain. These could be made into
17// configuration variables at some point.
18pub(crate) const PENDING_CHANNEL_IDENT: commonware_p2p::Channel = 0;
19pub(crate) const RECOVERED_CHANNEL_IDENT: commonware_p2p::Channel = 1;
20pub(crate) const RESOLVER_CHANNEL_IDENT: commonware_p2p::Channel = 2;
21pub(crate) const BROADCASTER_CHANNEL_IDENT: commonware_p2p::Channel = 3;
22pub(crate) const MARSHAL_CHANNEL_IDENT: commonware_p2p::Channel = 4;
23pub(crate) const DKG_CHANNEL_IDENT: commonware_p2p::Channel = 5;
24pub(crate) const BOUNDARY_CERT_CHANNEL_IDENT: commonware_p2p::Channel = 6;
25pub(crate) const SUBBLOCKS_CHANNEL_IDENT: commonware_p2p::Channel = 7;
26
27pub(crate) const NUMBER_CONCURRENT_FETCHES: usize = 4;
28
29pub(crate) const BLOCKS_FREEZER_TABLE_INITIAL_SIZE_BYTES: u32 = 2u32.pow(21); // 100MB
30
31pub(crate) const BROADCASTER_LIMIT: Quota =
32 Quota::per_second(NonZeroU32::new(8).expect("value is not zero"));
33pub(crate) const BOUNDARY_CERT_LIMIT: Quota =
34 Quota::per_second(NonZeroU32::new(1).expect("value is not zero"));
35pub(crate) const DKG_LIMIT: Quota =
36 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
37pub(crate) const MARSHAL_LIMIT: Quota =
38 Quota::per_second(NonZeroU32::new(8).expect("value is not zero"));
39pub(crate) const PENDING_LIMIT: Quota =
40 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
41pub(crate) const RECOVERED_LIMIT: Quota =
42 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
43pub(crate) const RESOLVER_LIMIT: Quota =
44 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
45pub(crate) const SUBBLOCKS_LIMIT: Quota =
46 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
47
48pub(crate) const NAMESPACE: &[u8] = b"TEMPO";
49
50/// The number of peer sets that will be active in the lookup p2p network.
51pub(crate) const PEERSETS_TO_TRACK: usize = 3;