Skip to content

Commit 8c4d5ff

Browse files
Update router config when receiving UpdateFullNodes command
We use `MultiRouter.rc_config` to reconstruct secondary state when node's role is updated. We need to apply config reloads on MultiRouter's copy of the config
1 parent 7fd1dfa commit 8c4d5ff

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

monad-router-multi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ monad-crypto = { workspace = true }
88
monad-dataplane = { workspace = true }
99
monad-executor = { workspace = true }
1010
monad-executor-glue = { workspace = true }
11+
monad-node-config = { workspace = true }
1112
monad-peer-discovery = { workspace = true }
1213
monad-raptorcast = { workspace = true }
1314
monad-types = { workspace = true }

monad-router-multi/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use monad_crypto::certificate_signature::{
3030
use monad_dataplane::{DataplaneBuilder, DataplaneWriter};
3131
use monad_executor::{Executor, ExecutorMetricsChain};
3232
use monad_executor_glue::{Message, RouterCommand};
33+
use monad_node_config::{FullNodeConfig, FullNodeIdentityConfig};
3334
use monad_peer_discovery::{
3435
driver::PeerDiscoveryDriver, PeerDiscoveryAlgo, PeerDiscoveryAlgoBuilder,
3536
};
@@ -327,6 +328,16 @@ where
327328
ref dedicated_full_nodes,
328329
ref prioritized_full_nodes,
329330
} => {
331+
self.rc_config.primary_instance.fullnode_dedicated =
332+
dedicated_full_nodes.clone();
333+
self.rc_config.secondary_instance.full_nodes_prioritized = FullNodeConfig {
334+
identities: prioritized_full_nodes
335+
.iter()
336+
.map(|id| FullNodeIdentityConfig {
337+
secp256k1_pubkey: id.pubkey(),
338+
})
339+
.collect(),
340+
};
330341
let cmd_cpy = RouterCommand::UpdateFullNodes {
331342
dedicated_full_nodes: dedicated_full_nodes.clone(),
332343
prioritized_full_nodes: prioritized_full_nodes.clone(),

0 commit comments

Comments
 (0)