diff --git a/.env.example b/.env.example index 67293227..4f0955f2 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,7 @@ # Environment variables for compose.yml file config. DOCKER_COMPOSE_LIBP2P_REPLICAS=1 DOCKER_COMPOSE_LIBP2P_NODE_KEY_MASK=2000000000000000000000000000000000000000000000000000000000000000 +DOCKER_COMPOSE_SUPER_MAJORITY_THRESHOLD=1 DOCKER_COMPOSE_ETCDCTL_ENDPOINTS=etcd:2379 DOCKER_COMPOSE_ETCDCTL_API=3 DOCKER_COMPOSE_BOOSTRAP_NET_NODE_KEY=1000000000000000000000000000000000000000000000000000000000000000 diff --git a/compose.yml b/compose.yml index f12cd5de..b3348898 100644 --- a/compose.yml +++ b/compose.yml @@ -10,6 +10,7 @@ services: volumes: - ./testnet:/etc/nomos environment: + - OVERLAY_SUPER_MAJORITY_THRESHOLD=${DOCKER_COMPOSE_SUPER_MAJORITY_THRESHOLD:-1} - NET_NODE_KEY=${DOCKER_COMPOSE_BOOSTRAP_NET_NODE_KEY:-1000000000000000000000000000000000000000000000000000000000000000} command: /etc/nomos/bootstrap_config.yaml @@ -28,6 +29,7 @@ services: - mix-node-1 - mix-node-2 environment: + - OVERLAY_SUPER_MAJORITY_THRESHOLD=${DOCKER_COMPOSE_SUPER_MAJORITY_THRESHOLD:-1} - LIBP2P_REPLICAS=${DOCKER_COMPOSE_LIBP2P_REPLICAS:-1} - ETCDCTL_ENDPOINTS=${DOCKER_COMPOSE_ETCDCTL_ENDPOINTS:-etcd:2379} - ETCDCTL_API=${DOCKER_COMPOSE_ETCDCTL_API:-3} diff --git a/nodes/nomos-node/config.yaml b/nodes/nomos-node/config.yaml index 5e31a282..149d0ace 100644 --- a/nodes/nomos-node/config.yaml +++ b/nodes/nomos-node/config.yaml @@ -13,6 +13,7 @@ consensus: 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] + super_majority_threshold: 1 network: backend: diff --git a/nodes/nomos-node/src/config.rs b/nodes/nomos-node/src/config.rs index 53b3abf0..acd622e6 100644 --- a/nodes/nomos-node/src/config.rs +++ b/nodes/nomos-node/src/config.rs @@ -96,10 +96,16 @@ pub struct OverlayArgs { pub overlay_leader: Option, #[clap( - long = "overlay-leader-super-majority-threshold", + long = "overlay-number-of-committees", env = "OVERLAY_NUMBER_OF_COMMITTEES" )] pub overlay_number_of_committees: Option, + + #[clap( + long = "overlay-super-majority-threshold", + env = "OVERLAY_SUPER_MAJORITY_THRESHOLD" + )] + pub overlay_super_majority_threshold: Option, } #[derive(Deserialize, Debug, Clone, Serialize)] @@ -228,6 +234,7 @@ impl Config { overlay_nodes, overlay_leader, overlay_number_of_committees, + overlay_super_majority_threshold, } = overlay_args; if let Some(nodes) = overlay_nodes { @@ -250,6 +257,11 @@ impl Config { self.consensus.overlay_settings.number_of_committees = committees; } + if let Some(super_majority_threshold) = overlay_super_majority_threshold { + self.consensus.overlay_settings.super_majority_threshold = + Some(super_majority_threshold.into()); + } + Ok(self) } }