From ef4b84521f2ed14d279c1d1d4d6ffc963103c244 Mon Sep 17 00:00:00 2001 From: Arni Hod Date: Sun, 7 Jul 2024 13:27:49 +0300 Subject: [PATCH] feat: add max_bytecode_size to config --- config/default_config.json | 10 ++++++++++ crates/gateway/src/config.rs | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/config/default_config.json b/config/default_config.json index 22889fb1..0db86ead 100644 --- a/config/default_config.json +++ b/config/default_config.json @@ -49,11 +49,21 @@ "privacy": "Public", "value": 0 }, + "gateway_config.stateless_tx_validator_config.max_bytecode_size": { + "description": "Validates that a transaction has bytecode size less than or equal to this value.", + "privacy": "Public", + "value": 0 + }, "gateway_config.stateless_tx_validator_config.max_calldata_length": { "description": "Validates that a transaction has calldata length less than or equal to this value.", "privacy": "Public", "value": 0 }, + "gateway_config.stateless_tx_validator_config.max_raw_class_size": { + "description": "Validates that a transaction has raw class size less than or equal to this value.", + "privacy": "Public", + "value": 0 + }, "gateway_config.stateless_tx_validator_config.max_sierra_version.major": { "description": "The major version of the configuration.", "privacy": "Public", diff --git a/crates/gateway/src/config.rs b/crates/gateway/src/config.rs index 9add4d86..5d659a7f 100644 --- a/crates/gateway/src/config.rs +++ b/crates/gateway/src/config.rs @@ -122,6 +122,18 @@ impl SerializeConfig for StatelessTransactionValidatorConfig { value.", ParamPrivacyInput::Public, ), + ser_param( + "max_bytecode_size", + &self.max_bytecode_size, + "Validates that a transaction has bytecode size less than or equal to this value.", + ParamPrivacyInput::Public, + ), + ser_param( + "max_raw_class_size", + &self.max_raw_class_size, + "Validates that a transaction has raw class size less than or equal to this value.", + ParamPrivacyInput::Public, + ), ]); vec![ members,