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 const VOTES_CHANNEL_IDENT: commonware_p2p::Channel = 0;
19pub const CERTIFICATES_CHANNEL_IDENT: commonware_p2p::Channel = 1;
20pub const RESOLVER_CHANNEL_IDENT: commonware_p2p::Channel = 2;
21pub const BROADCASTER_CHANNEL_IDENT: commonware_p2p::Channel = 3;
22pub const MARSHAL_CHANNEL_IDENT: commonware_p2p::Channel = 4;
23pub const DKG_CHANNEL_IDENT: commonware_p2p::Channel = 5;
24pub const SUBBLOCKS_CHANNEL_IDENT: commonware_p2p::Channel = 6;
25
26pub(crate) const NUMBER_CONCURRENT_FETCHES: usize = 4;
27
28pub(crate) const PEERSETS_TO_TRACK: usize = 3;
29
30pub(crate) const BLOCKS_FREEZER_TABLE_INITIAL_SIZE_BYTES: u32 = 2u32.pow(21); // 100MB
31
32pub const BROADCASTER_LIMIT: Quota =
33 Quota::per_second(NonZeroU32::new(8).expect("value is not zero"));
34pub const DKG_LIMIT: Quota = Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
35pub const MARSHAL_LIMIT: Quota = Quota::per_second(NonZeroU32::new(8).expect("value is not zero"));
36pub const VOTES_LIMIT: Quota = Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
37pub const CERTIFICATES_LIMIT: Quota =
38 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
39pub const RESOLVER_LIMIT: Quota =
40 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
41pub const SUBBLOCKS_LIMIT: Quota =
42 Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
43
44pub const NAMESPACE: &[u8] = b"TEMPO";