Skip to main content

tempo_consensus/
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 commonware_utils::NZUsize;
15use governor::Quota;
16
17// Hardcoded values to configure commonware's alto toy chain. These could be made into
18// configuration variables at some point.
19pub const VOTES_CHANNEL_IDENT: commonware_p2p::Channel = 0;
20pub const CERTIFICATES_CHANNEL_IDENT: commonware_p2p::Channel = 1;
21pub const RESOLVER_CHANNEL_IDENT: commonware_p2p::Channel = 2;
22pub const BROADCASTER_CHANNEL_IDENT: commonware_p2p::Channel = 3;
23pub const MARSHAL_CHANNEL_IDENT: commonware_p2p::Channel = 4;
24pub const DKG_CHANNEL_IDENT: commonware_p2p::Channel = 5;
25pub const SUBBLOCKS_CHANNEL_IDENT: commonware_p2p::Channel = 6;
26
27pub(crate) const NUMBER_CONCURRENT_FETCHES: usize = 4;
28
29pub(crate) const PEERSETS_TO_TRACK: std::num::NonZeroUsize = NZUsize!(3);
30
31pub(crate) const BLOCKS_FREEZER_TABLE_INITIAL_SIZE_BYTES: u32 = 2u32.pow(21); // 100MB
32
33pub const BROADCASTER_LIMIT: Quota =
34    Quota::per_second(NonZeroU32::new(8).expect("value is not zero"));
35pub const DKG_LIMIT: Quota = Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
36pub const MARSHAL_LIMIT: Quota = Quota::per_second(NonZeroU32::new(8).expect("value is not zero"));
37pub const VOTES_LIMIT: Quota = Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
38pub const CERTIFICATES_LIMIT: Quota =
39    Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
40pub const RESOLVER_LIMIT: Quota =
41    Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
42pub const SUBBLOCKS_LIMIT: Quota =
43    Quota::per_second(NonZeroU32::new(128).expect("value is not zero"));
44
45pub const NAMESPACE: &[u8] = b"TEMPO";