Skip to content

Commit c47330a

Browse files
apollo_node_config: make top level version_constant_overrides optional
1 parent ca29fcc commit c47330a

File tree

6 files changed

+41
-11
lines changed

6 files changed

+41
-11
lines changed

crates/apollo_batcher_config/src/config.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ use std::collections::BTreeMap;
22
use std::time::Duration;
33

44
use apollo_config::converters::deserialize_milliseconds_to_duration;
5-
use apollo_config::dumping::{prepend_sub_config_name, ser_param, SerializeConfig};
5+
use apollo_config::dumping::{
6+
prepend_sub_config_name,
7+
ser_optional_sub_config,
8+
ser_param,
9+
SerializeConfig,
10+
};
611
use apollo_config::secrets::Sensitive;
712
use apollo_config::{ParamPath, ParamPrivacyInput, SerializedParam};
813
use blockifier::blockifier::config::{ContractClassManagerConfig, WorkerPoolConfig};
@@ -37,9 +42,7 @@ impl Default for BlockBuilderConfig {
3742
n_concurrent_txs: 100,
3843
tx_polling_interval_millis: 10,
3944
proposer_idle_detection_delay_millis: Duration::from_millis(2000),
40-
// TODO(Itamar): Change to None once the versioned constants overrides are optional in
41-
// the config schema.
42-
versioned_constants_overrides: Some(VersionedConstantsOverrides::default()),
45+
versioned_constants_overrides: None,
4346
}
4447
}
4548
}
@@ -70,8 +73,8 @@ impl SerializeConfig for BlockBuilderConfig {
7073
being executed, the proposer will finish building the current block.",
7174
ParamPrivacyInput::Public,
7275
)]));
73-
dump.append(&mut prepend_sub_config_name(
74-
self.versioned_constants_overrides.clone().unwrap_or_default().dump(),
76+
dump.append(&mut ser_optional_sub_config(
77+
&self.versioned_constants_overrides,
7578
"versioned_constants_overrides",
7679
));
7780
dump

crates/apollo_deployments/resources/app_configs/replacer_versioned_constants_overrides_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"versioned_constants_overrides.#is_none": true,
23
"versioned_constants_overrides.invoke_tx_max_n_steps": 10000000,
34
"versioned_constants_overrides.max_n_events": 1000,
45
"versioned_constants_overrides.max_recursion_depth": 50,

crates/apollo_deployments/resources/app_configs/versioned_constants_overrides_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"versioned_constants_overrides.#is_none": true,
23
"versioned_constants_overrides.invoke_tx_max_n_steps": 10000000,
34
"versioned_constants_overrides.max_n_events": 1000,
45
"versioned_constants_overrides.max_recursion_depth": 50,

crates/apollo_gateway_config/src/config.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use apollo_config::converters::{
77
use apollo_config::dumping::{
88
prepend_sub_config_name,
99
ser_optional_param,
10+
ser_optional_sub_config,
1011
ser_param,
1112
SerializeConfig,
1213
};
@@ -244,9 +245,7 @@ impl Default for StatefulTransactionValidatorConfig {
244245
reject_future_declare_txs: true,
245246
max_nonce_for_validation_skip: Nonce(Felt::ONE),
246247
min_gas_price_percentage: 100,
247-
// TODO(Itamar): Change to None once the versioned constants overrides are optional in
248-
// the config schema.
249-
versioned_constants_overrides: Some(VersionedConstantsOverrides::default()),
248+
versioned_constants_overrides: None,
250249
}
251250
}
252251
}
@@ -286,8 +285,8 @@ impl SerializeConfig for StatefulTransactionValidatorConfig {
286285
ParamPrivacyInput::Public,
287286
),
288287
]);
289-
dump.append(&mut prepend_sub_config_name(
290-
self.versioned_constants_overrides.clone().unwrap_or_default().dump(),
288+
dump.append(&mut ser_optional_sub_config(
289+
&self.versioned_constants_overrides,
291290
"versioned_constants_overrides",
292291
));
293292
dump

crates/apollo_node/resources/config_schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@
154154
"privacy": "Public",
155155
"value": 10
156156
},
157+
"batcher_config.block_builder_config.versioned_constants_overrides.#is_none": {
158+
"description": "Flag for an optional field.",
159+
"pointer_target": "versioned_constants_overrides.#is_none",
160+
"privacy": "TemporaryValue"
161+
},
157162
"batcher_config.block_builder_config.versioned_constants_overrides.invoke_tx_max_n_steps": {
158163
"description": "Maximum number of steps the invoke function is allowed to run.",
159164
"pointer_target": "versioned_constants_overrides.invoke_tx_max_n_steps",
@@ -2054,6 +2059,11 @@
20542059
"pointer_target": "validate_resource_bounds",
20552060
"privacy": "Public"
20562061
},
2062+
"gateway_config.stateful_tx_validator_config.versioned_constants_overrides.#is_none": {
2063+
"description": "Flag for an optional field.",
2064+
"pointer_target": "versioned_constants_overrides.#is_none",
2065+
"privacy": "TemporaryValue"
2066+
},
20572067
"gateway_config.stateful_tx_validator_config.versioned_constants_overrides.invoke_tx_max_n_steps": {
20582068
"description": "Maximum number of steps the invoke function is allowed to run.",
20592069
"pointer_target": "versioned_constants_overrides.invoke_tx_max_n_steps",
@@ -2944,6 +2954,11 @@
29442954
"privacy": "TemporaryValue",
29452955
"value": "PointerTarget"
29462956
},
2957+
"versioned_constants_overrides.#is_none": {
2958+
"description": "Flag to disable versioned_constants_overrides for all components.",
2959+
"privacy": "TemporaryValue",
2960+
"value": true
2961+
},
29472962
"versioned_constants_overrides.invoke_tx_max_n_steps": {
29482963
"description": "Maximum number of steps the invoke function is allowed to run.",
29492964
"privacy": "TemporaryValue",

crates/apollo_node_config/src/node_config.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ pub static CONFIG_POINTERS: LazyLock<ConfigPointers> = LazyLock::new(|| {
151151
"mempool_config.static_config.validate_resource_bounds",
152152
]),
153153
),
154+
(
155+
ser_pointer_target_param(
156+
"versioned_constants_overrides.#is_none",
157+
&true,
158+
"Flag to disable versioned_constants_overrides for all components.",
159+
),
160+
set_pointing_param_paths(&[
161+
"batcher_config.block_builder_config.versioned_constants_overrides.#is_none",
162+
"gateway_config.stateful_tx_validator_config.versioned_constants_overrides.#is_none",
163+
]),
164+
),
154165
];
155166
let mut common_execution_config = generate_struct_pointer(
156167
"versioned_constants_overrides".to_owned(),

0 commit comments

Comments
 (0)