File tree Expand file tree Collapse file tree 3 files changed +14
-17
lines changed
apollo_config_manager/src Expand file tree Collapse file tree 3 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -48,19 +48,7 @@ impl ConfigManagerRunner {
48
48
& self ,
49
49
) -> Result < NodeDynamicConfig , Box < dyn std:: error:: Error + Send + Sync > > {
50
50
let config = load_and_validate_config ( self . cli_args . clone ( ) ) ?;
51
-
52
- // Extract consensus dynamic config from the loaded config
53
- let consensus_manager_config = config
54
- . consensus_manager_config
55
- . as_ref ( )
56
- . expect ( "consensus_manager_config must be present" ) ;
57
-
58
- let node_dynamic_config = NodeDynamicConfig {
59
- consensus_dynamic_config : Some (
60
- consensus_manager_config. consensus_manager_config . dynamic_config . clone ( ) ,
61
- ) ,
62
- } ;
63
-
51
+ let node_dynamic_config = NodeDynamicConfig :: from ( & config) ;
64
52
info ! ( "Extracted NodeDynamicConfig: {:?}" , node_dynamic_config) ;
65
53
66
54
// TODO(Nadin/Tsabary): Store the last loaded config, compare for changes and only send the
Original file line number Diff line number Diff line change @@ -11,8 +11,10 @@ async fn test_config_manager_update_config() {
11
11
let config = ConfigManagerConfig :: default ( ) ;
12
12
13
13
let consensus_dynamic_config = ConsensusDynamicConfig :: default ( ) ;
14
- let node_dynamic_config =
15
- NodeDynamicConfig { consensus_dynamic_config : Some ( consensus_dynamic_config) } ;
14
+ let node_dynamic_config = NodeDynamicConfig {
15
+ consensus_dynamic_config : Some ( consensus_dynamic_config) ,
16
+ ..Default :: default ( )
17
+ } ;
16
18
let mut config_manager = ConfigManager :: new ( config, node_dynamic_config. clone ( ) ) ;
17
19
18
20
// Get the consensus dynamic config and assert it is the expected one.
@@ -38,6 +40,7 @@ async fn test_config_manager_update_config() {
38
40
config_manager
39
41
. set_node_dynamic_config ( NodeDynamicConfig {
40
42
consensus_dynamic_config : Some ( new_consensus_dynamic_config. clone ( ) ) ,
43
+ ..Default :: default ( )
41
44
} )
42
45
. expect ( "Failed to set node dynamic config" ) ;
43
46
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ use apollo_l1_gas_price_provider_config::config::{
31
31
} ;
32
32
use apollo_l1_provider_config:: config:: L1ProviderConfig ;
33
33
use apollo_l1_scraper_config:: config:: L1ScraperConfig ;
34
- use apollo_mempool_config:: config:: MempoolConfig ;
34
+ use apollo_mempool_config:: config:: { MempoolConfig , MempoolDynamicConfig } ;
35
35
use apollo_mempool_p2p_config:: config:: MempoolP2pConfig ;
36
36
use apollo_monitoring_endpoint_config:: config:: MonitoringEndpointConfig ;
37
37
use apollo_reverts:: RevertConfig ;
@@ -290,6 +290,8 @@ impl Default for SequencerNodeConfig {
290
290
pub struct NodeDynamicConfig {
291
291
#[ validate]
292
292
pub consensus_dynamic_config : Option < ConsensusDynamicConfig > ,
293
+ #[ validate]
294
+ pub mempool_dynamic_config : Option < MempoolDynamicConfig > ,
293
295
}
294
296
295
297
impl From < & SequencerNodeConfig > for NodeDynamicConfig {
@@ -300,7 +302,11 @@ impl From<&SequencerNodeConfig> for NodeDynamicConfig {
300
302
consensus_manager_config. consensus_manager_config . dynamic_config . clone ( )
301
303
} ,
302
304
) ;
303
- Self { consensus_dynamic_config }
305
+ let mempool_dynamic_config = sequencer_node_config
306
+ . mempool_config
307
+ . as_ref ( )
308
+ . map ( |mempool_config| mempool_config. dynamic_config . clone ( ) ) ;
309
+ Self { consensus_dynamic_config, mempool_dynamic_config }
304
310
}
305
311
}
306
312
You can’t perform that action at this time.
0 commit comments