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 <taxihighway@gmail.com> Co-authored-by: Al Liu <scygliu1@gmail.com>
This commit is contained in:
parent
99d77f7e1c
commit
309e5a29e9
|
@ -1,4 +1,4 @@
|
||||||
use std::net::SocketAddr;
|
use std::{net::SocketAddr, time::Duration};
|
||||||
|
|
||||||
use futures::{stream, StreamExt};
|
use futures::{stream, StreamExt};
|
||||||
use mixnet_topology::MixnetTopology;
|
use mixnet_topology::MixnetTopology;
|
||||||
|
@ -11,7 +11,9 @@ pub struct MixnetClientConfig {
|
||||||
pub mode: MixnetClientMode,
|
pub mode: MixnetClientMode,
|
||||||
pub topology: MixnetTopology,
|
pub topology: MixnetTopology,
|
||||||
pub connection_pool_size: usize,
|
pub connection_pool_size: usize,
|
||||||
|
#[serde(default = "MixnetClientConfig::default_max_retries")]
|
||||||
pub max_retries: usize,
|
pub max_retries: usize,
|
||||||
|
#[serde(default = "MixnetClientConfig::default_retry_delay")]
|
||||||
pub retry_delay: std::time::Duration,
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -7,9 +7,13 @@ consensus:
|
||||||
fountain_settings: null
|
fountain_settings: null
|
||||||
overlay_settings:
|
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]]
|
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:
|
leader:
|
||||||
cur: 0
|
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:
|
network:
|
||||||
backend:
|
backend:
|
||||||
host: 0.0.0.0
|
host: 0.0.0.0
|
||||||
|
@ -49,3 +53,12 @@ http:
|
||||||
backend:
|
backend:
|
||||||
address: 0.0.0.0:8080
|
address: 0.0.0.0:8080
|
||||||
cors_origins: []
|
cors_origins: []
|
||||||
|
|
||||||
|
da:
|
||||||
|
da_protocol:
|
||||||
|
num_attestations: 1
|
||||||
|
backend:
|
||||||
|
max_capacity: 10
|
||||||
|
evicting_period:
|
||||||
|
secs: 3600
|
||||||
|
nanos: 0
|
||||||
|
|
|
@ -7,9 +7,13 @@ consensus:
|
||||||
fountain_settings: null
|
fountain_settings: null
|
||||||
overlay_settings:
|
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]]
|
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:
|
leader:
|
||||||
cur: 0
|
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:
|
network:
|
||||||
backend:
|
backend:
|
||||||
host: 0.0.0.0
|
host: 0.0.0.0
|
||||||
|
@ -19,14 +23,28 @@ network:
|
||||||
discV5BootstrapNodes: []
|
discV5BootstrapNodes: []
|
||||||
initial_peers: []
|
initial_peers: []
|
||||||
relayTopics: []
|
relayTopics: []
|
||||||
|
# Mixclient configuration to communicate with mixnodes.
|
||||||
|
# The libp2p network backend always requires this mixclient configuration
|
||||||
|
# (cannot be disabled for now).
|
||||||
mixnet_client:
|
mixnet_client:
|
||||||
|
# A mixclient mode. For details, see the documentation of the "mixnet" crate.
|
||||||
|
# - Sender
|
||||||
|
# - !SenderReceiver [mixnode_client_listen_address]
|
||||||
mode: Sender
|
mode: Sender
|
||||||
|
# A mixnet topology, which contains the information of all mixnodes in the mixnet.
|
||||||
|
# (The topology is static for now.)
|
||||||
topology:
|
topology:
|
||||||
|
# Each mixnet layer consists of a list of mixnodes.
|
||||||
layers:
|
layers:
|
||||||
- nodes:
|
- 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"
|
public_key: "0000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
# A max number of connections that will stay connected to mixnodes in the first mixnet layer.
|
||||||
connection_pool_size: 255
|
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:
|
mixnet_delay:
|
||||||
start: "0ms"
|
start: "0ms"
|
||||||
end: "0ms"
|
end: "0ms"
|
||||||
|
@ -35,3 +53,12 @@ http:
|
||||||
backend:
|
backend:
|
||||||
address: 0.0.0.0:8080
|
address: 0.0.0.0:8080
|
||||||
cors_origins: []
|
cors_origins: []
|
||||||
|
|
||||||
|
da:
|
||||||
|
da_protocol:
|
||||||
|
num_attestations: 1
|
||||||
|
backend:
|
||||||
|
max_capacity: 10
|
||||||
|
evicting_period:
|
||||||
|
secs: 3600
|
||||||
|
nanos: 0
|
||||||
|
|
Loading…
Reference in New Issue