Skip to content

Commit

Permalink
refactor(gateway): remove reduncdent config level on gateway compiler (
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware authored Aug 12, 2024
1 parent 5eeff6e commit 6a16afc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config/mempool/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"privacy": "Public",
"value": 3
},
"gateway_config.compiler_config.sierra_to_casm_compiler_config.max_bytecode_size": {
"gateway_config.compiler_config.max_bytecode_size": {
"description": "Limitation of contract bytecode size.",
"privacy": "Public",
"value": 81920
Expand Down
16 changes: 1 addition & 15 deletions crates/gateway/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct GatewayConfig {
pub network_config: GatewayNetworkConfig,
pub stateless_tx_validator_config: StatelessTransactionValidatorConfig,
pub stateful_tx_validator_config: StatefulTransactionValidatorConfig,
pub compiler_config: GatewayCompilerConfig,
pub compiler_config: SierraToCasmCompilationConfig,
}

impl SerializeConfig for GatewayConfig {
Expand Down Expand Up @@ -224,17 +224,3 @@ impl StatefulTransactionValidatorConfig {
}
}
}

#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, Validate, PartialEq)]
pub struct GatewayCompilerConfig {
pub sierra_to_casm_compiler_config: SierraToCasmCompilationConfig,
}

impl SerializeConfig for GatewayCompilerConfig {
fn dump(&self) -> BTreeMap<ParamPath, SerializedParam> {
append_sub_config_name(
self.sierra_to_casm_compiler_config.dump(),
"sierra_to_casm_compiler_config",
)
}
}
4 changes: 1 addition & 3 deletions crates/gateway/src/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ pub fn create_gateway(
mempool_client: SharedMempoolClient,
) -> Gateway {
let state_reader_factory = Arc::new(RpcStateReaderFactory { config: rpc_state_reader_config });
let gateway_compiler = GatewayCompiler::new_cairo_lang_compiler(
config.compiler_config.sierra_to_casm_compiler_config,
);
let gateway_compiler = GatewayCompiler::new_cairo_lang_compiler(config.compiler_config);

Gateway::new(config, state_reader_factory, gateway_compiler, mempool_client)
}
Expand Down

0 comments on commit 6a16afc

Please sign in to comment.