Skip to content

Commit 23c9984

Browse files
apollo_gateway: insert optional versioned constant overrides to gateway
1 parent bc65161 commit 23c9984

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/apollo_gateway/src/stateful_transaction_validator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ impl StatefulTransactionValidatorFactoryTrait for StatefulTransactionValidatorFa
7272
let latest_block_info = get_latest_block_info(&state_reader)?;
7373

7474
let state = CachedState::new(state_reader);
75-
let mut versioned_constants = VersionedConstants::get_versioned_constants(Some(
75+
let mut versioned_constants = VersionedConstants::get_versioned_constants(
7676
self.config.versioned_constants_overrides.clone(),
77-
));
77+
);
7878
// The validation of a transaction is not affected by the casm hash migration.
7979
versioned_constants.enable_casm_hash_migration = false;
8080

crates/apollo_gateway_config/src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub struct StatefulTransactionValidatorConfig {
209209
pub max_allowed_nonce_gap: u32,
210210
pub reject_future_declare_txs: bool,
211211
pub max_nonce_for_validation_skip: Nonce,
212-
pub versioned_constants_overrides: VersionedConstantsOverrides,
212+
pub versioned_constants_overrides: Option<VersionedConstantsOverrides>,
213213
// Minimum gas price as percentage of threshold to accept transactions.
214214
pub min_gas_price_percentage: u8, // E.g., 80 to require 80% of threshold.
215215
}
@@ -222,7 +222,7 @@ impl Default for StatefulTransactionValidatorConfig {
222222
reject_future_declare_txs: true,
223223
max_nonce_for_validation_skip: Nonce(Felt::ONE),
224224
min_gas_price_percentage: 100,
225-
versioned_constants_overrides: VersionedConstantsOverrides::default(),
225+
versioned_constants_overrides: Some(VersionedConstantsOverrides::default()),
226226
}
227227
}
228228
}
@@ -263,7 +263,7 @@ impl SerializeConfig for StatefulTransactionValidatorConfig {
263263
),
264264
]);
265265
dump.append(&mut prepend_sub_config_name(
266-
self.versioned_constants_overrides.dump(),
266+
self.versioned_constants_overrides.clone().unwrap_or_default().dump(),
267267
"versioned_constants_overrides",
268268
));
269269
dump

0 commit comments

Comments
 (0)