From 309e5a29e985f2bcfa6ceaf73ff2fdcbd236cd90 Mon Sep 17 00:00:00 2001 From: gusto Date: Thu, 5 Oct 2023 15:16:40 +0300 Subject: [PATCH] Nomos node config (#423) * Use tree overlay in nomos node * Use tree overlay in tests module * Handle unexpected consensus vote stream end in tally * Add defaults for retry and delay in mixnet client * Add missing entries in config.yaml * Spawn the next leader first (#425) --------- Co-authored-by: Youngjoon Lee Co-authored-by: Al Liu --- mixnet/client/src/config.rs | 14 +++++++++++++- nodes/nomos-node/config.yaml | 15 ++++++++++++++- testnet/config.yaml | 31 +++++++++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/mixnet/client/src/config.rs b/mixnet/client/src/config.rs index 16ca684d..9cde7189 100644 --- a/mixnet/client/src/config.rs +++ b/mixnet/client/src/config.rs @@ -1,4 +1,4 @@ -use std::net::SocketAddr; +use std::{net::SocketAddr, time::Duration}; use futures::{stream, StreamExt}; use mixnet_topology::MixnetTopology; @@ -11,7 +11,9 @@ pub struct MixnetClientConfig { pub mode: MixnetClientMode, pub topology: MixnetTopology, pub connection_pool_size: usize, + #[serde(default = "MixnetClientConfig::default_max_retries")] pub max_retries: usize, + #[serde(default = "MixnetClientConfig::default_retry_delay")] pub retry_delay: std::time::Duration, } @@ -44,3 +46,13 @@ impl MixnetClientMode { } } } + +impl MixnetClientConfig { + const fn default_max_retries() -> usize { + 3 + } + + const fn default_retry_delay() -> Duration { + Duration::from_secs(5) + } +} diff --git a/nodes/nomos-node/config.yaml b/nodes/nomos-node/config.yaml index 88a0a787..5e31a282 100644 --- a/nodes/nomos-node/config.yaml +++ b/nodes/nomos-node/config.yaml @@ -7,9 +7,13 @@ consensus: fountain_settings: null overlay_settings: nodes: [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] - leader_super_majority_threshold: 1 + number_of_committees: 1 + current_leader: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] leader: cur: 0 + committee_membership: !Sad + entropy: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + network: backend: host: 0.0.0.0 @@ -49,3 +53,12 @@ http: backend: address: 0.0.0.0:8080 cors_origins: [] + +da: + da_protocol: + num_attestations: 1 + backend: + max_capacity: 10 + evicting_period: + secs: 3600 + nanos: 0 diff --git a/testnet/config.yaml b/testnet/config.yaml index d60e6c86..5e31a282 100644 --- a/testnet/config.yaml +++ b/testnet/config.yaml @@ -7,9 +7,13 @@ consensus: fountain_settings: null overlay_settings: nodes: [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] - leader_super_majority_threshold: 1 + number_of_committees: 1 + current_leader: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] leader: cur: 0 + committee_membership: !Sad + entropy: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + network: backend: host: 0.0.0.0 @@ -19,14 +23,28 @@ network: discV5BootstrapNodes: [] initial_peers: [] relayTopics: [] + # Mixclient configuration to communicate with mixnodes. + # The libp2p network backend always requires this mixclient configuration + # (cannot be disabled for now). mixnet_client: + # A mixclient mode. For details, see the documentation of the "mixnet" crate. + # - Sender + # - !SenderReceiver [mixnode_client_listen_address] mode: Sender + # A mixnet topology, which contains the information of all mixnodes in the mixnet. + # (The topology is static for now.) topology: + # Each mixnet layer consists of a list of mixnodes. layers: - nodes: - - address: 127.0.0.1:7777 + - address: 127.0.0.1:7777 # A listen address of the mixnode + # A ed25519 public key for encrypting Sphinx packets for the mixnode public_key: "0000000000000000000000000000000000000000000000000000000000000000" + # A max number of connections that will stay connected to mixnodes in the first mixnet layer. connection_pool_size: 255 + # A range of total delay that will be set to each Sphinx packets + # sent to the mixnet for timing obfuscation. + # Panics if start > end. mixnet_delay: start: "0ms" end: "0ms" @@ -35,3 +53,12 @@ http: backend: address: 0.0.0.0:8080 cors_origins: [] + +da: + da_protocol: + num_attestations: 1 + backend: + max_capacity: 10 + evicting_period: + secs: 3600 + nanos: 0