Skip to content

Commit

Permalink
chore: align default config with python gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Jul 9, 2024
1 parent 3c861c1 commit 5605a69
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
26 changes: 13 additions & 13 deletions config/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,49 +50,49 @@
"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.",
"description": "Limitation of contract bytecode size.",
"privacy": "Public",
"value": 0
"value": 81920
},
"gateway_config.stateless_tx_validator_config.max_calldata_length": {
"description": "Validates that a transaction has calldata length less than or equal to this value.",
"description": "Limitation of calldata length.",
"privacy": "Public",
"value": 0
"value": 4000
},
"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.",
"description": "Limitation of contract class object size.",
"privacy": "Public",
"value": 0
"value": 4089446
},
"gateway_config.stateless_tx_validator_config.max_sierra_version.major": {
"description": "The major version of the configuration.",
"privacy": "Public",
"value": 18446744073709551615
"value": 1
},
"gateway_config.stateless_tx_validator_config.max_sierra_version.minor": {
"description": "The minor version of the configuration.",
"privacy": "Public",
"value": 18446744073709551615
"value": 5
},
"gateway_config.stateless_tx_validator_config.max_sierra_version.patch": {
"description": "The patch version of the configuration.",
"privacy": "Public",
"value": 18446744073709551615
},
"gateway_config.stateless_tx_validator_config.max_signature_length": {
"description": "Validates that a transaction has signature length less than or equal to this value.",
"description": "Limitation of signature length.",
"privacy": "Public",
"value": 0
"value": 4000
},
"gateway_config.stateless_tx_validator_config.min_sierra_version.major": {
"description": "The major version of the configuration.",
"privacy": "Public",
"value": 0
"value": 1
},
"gateway_config.stateless_tx_validator_config.min_sierra_version.minor": {
"description": "The minor version of the configuration.",
"privacy": "Public",
"value": 0
"value": 1
},
"gateway_config.stateless_tx_validator_config.min_sierra_version.patch": {
"description": "The patch version of the configuration.",
Expand All @@ -102,7 +102,7 @@
"gateway_config.stateless_tx_validator_config.validate_non_zero_l1_gas_fee": {
"description": "If true, validates that a transaction has non-zero L1 resource bounds.",
"privacy": "Public",
"value": false
"value": true
},
"gateway_config.stateless_tx_validator_config.validate_non_zero_l2_gas_fee": {
"description": "If true, validates that a transaction has non-zero L2 resource bounds.",
Expand Down
24 changes: 11 additions & 13 deletions crates/gateway/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ pub struct StatelessTransactionValidatorConfig {
impl Default for StatelessTransactionValidatorConfig {
fn default() -> Self {
StatelessTransactionValidatorConfig {
validate_non_zero_l1_gas_fee: false,
validate_non_zero_l1_gas_fee: true,
validate_non_zero_l2_gas_fee: false,
max_calldata_length: 0,
max_signature_length: 0,
max_bytecode_size: 0,
max_raw_class_size: 0,
min_sierra_version: VersionId::MIN,
max_sierra_version: VersionId::MAX,
max_calldata_length: 4000,
max_signature_length: 4000,
max_bytecode_size: 81920,
max_raw_class_size: 4089446,
min_sierra_version: VersionId { major: 1, minor: 1, patch: 0 },
max_sierra_version: VersionId { major: 1, minor: 5, patch: usize::MAX },
}
}
}
Expand All @@ -111,27 +111,25 @@ impl SerializeConfig for StatelessTransactionValidatorConfig {
ser_param(
"max_signature_length",
&self.max_signature_length,
"Validates that a transaction has signature length less than or equal to this \
value.",
"Limitation of signature length.",
ParamPrivacyInput::Public,
),
ser_param(
"max_calldata_length",
&self.max_calldata_length,
"Validates that a transaction has calldata length less than or equal to this \
value.",
"Limitation of calldata length.",
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.",
"Limitation of contract bytecode size.",
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.",
"Limitation of contract class object size.",
ParamPrivacyInput::Public,
),
]);
Expand Down

0 comments on commit 5605a69

Please sign in to comment.