diff --git a/config/mempool/default_config.json b/config/mempool/default_config.json index e4ddda98390..7464be1a6dd 100644 --- a/config/mempool/default_config.json +++ b/config/mempool/default_config.json @@ -1,5 +1,5 @@ { - "compiler_config.post_compilation_config.max_raw_casm_class_size": { + "compiler_config.post_compilation_config.max_casm_contract_class_object_size": { "description": "Limitation of contract class object size.", "privacy": "Public", "value": 4089446 diff --git a/crates/gateway/src/compilation.rs b/crates/gateway/src/compilation.rs index 6ae3daa761a..fad18836279 100644 --- a/crates/gateway/src/compilation.rs +++ b/crates/gateway/src/compilation.rs @@ -75,10 +75,10 @@ impl GatewayCompiler { let contract_class_object_size = serde_json::to_string(&casm_contract_class) .expect("Unexpected error serializing Casm contract class.") .len(); - if contract_class_object_size > self.config.max_raw_casm_class_size { + if contract_class_object_size > self.config.max_casm_contract_class_object_size { return Err(GatewayError::CasmContractClassObjectSizeTooLarge { contract_class_object_size, - max_contract_class_object_size: self.config.max_raw_casm_class_size, + max_contract_class_object_size: self.config.max_casm_contract_class_object_size, }); } diff --git a/crates/gateway/src/compilation_test.rs b/crates/gateway/src/compilation_test.rs index 10eadec7952..91cc877a588 100644 --- a/crates/gateway/src/compilation_test.rs +++ b/crates/gateway/src/compilation_test.rs @@ -72,7 +72,7 @@ fn test_compile_contract_class_bytecode_size_validation(declare_tx_v3: RpcDeclar #[rstest] fn test_compile_contract_class_raw_class_size_validation(declare_tx_v3: RpcDeclareTransactionV3) { let gateway_compiler = GatewayCompiler::new_cairo_lang_compiler(GatewayCompilerConfig { - post_compilation_config: PostCompilationConfig { max_raw_casm_class_size: 1 }, + post_compilation_config: PostCompilationConfig { max_casm_contract_class_object_size: 1 }, ..Default::default() }); diff --git a/crates/gateway/src/config.rs b/crates/gateway/src/config.rs index 5c860e7644e..e87e67aa344 100644 --- a/crates/gateway/src/config.rs +++ b/crates/gateway/src/config.rs @@ -247,20 +247,20 @@ impl SerializeConfig for GatewayCompilerConfig { /// The configuration for the post compilation process in the gateway compiler. #[derive(Clone, Copy, Debug, Serialize, Deserialize, Validate, PartialEq)] pub struct PostCompilationConfig { - pub max_raw_casm_class_size: usize, + pub max_casm_contract_class_object_size: usize, } impl Default for PostCompilationConfig { fn default() -> Self { - PostCompilationConfig { max_raw_casm_class_size: 4089446 } + PostCompilationConfig { max_casm_contract_class_object_size: 4089446 } } } impl SerializeConfig for PostCompilationConfig { fn dump(&self) -> BTreeMap { BTreeMap::from_iter([ser_param( - "max_raw_casm_class_size", - &self.max_raw_casm_class_size, + "max_casm_contract_class_object_size", + &self.max_casm_contract_class_object_size, "Limitation of contract class object size.", ParamPrivacyInput::Public, )])