Skip to content

Commit

Permalink
feat(blockifier): version bound accounts: rename v1_bound_accounts to…
Browse files Browse the repository at this point in the history
… v1_bound_accounts_cairo0

commit-id:41c980aa
  • Loading branch information
liorgold2 committed Jan 26, 2025
1 parent 257b80b commit 71a51dd
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"syscall_base_gas_cost": 0
}
},
"v1_bound_accounts": []
"v1_bound_accounts_cairo0": []
},
"os_resources": {
"execute_syscalls": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"syscall_base_gas_cost": 0
}
},
"v1_bound_accounts": []
"v1_bound_accounts_cairo0": []
},
"os_resources": {
"execute_syscalls": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"syscall_base_gas_cost": 0
}
},
"v1_bound_accounts": []
"v1_bound_accounts_cairo0": []
},
"os_resources": {
"execute_syscalls": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
"syscall_base_gas_cost": 0
}
},
"v1_bound_accounts": []
"v1_bound_accounts_cairo0": []
},
"os_resources": {
"execute_syscalls": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
"syscall_base_gas_cost": 0
}
},
"v1_bound_accounts": []
"v1_bound_accounts_cairo0": []
},
"os_resources": {
"execute_syscalls": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
"syscall_base_gas_cost": 0
}
},
"v1_bound_accounts": []
"v1_bound_accounts_cairo0": []
},
"os_resources": {
"execute_syscalls": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"validate_timestamp_rounding": 3600
},
"validated": "VALID",
"v1_bound_accounts": []
"v1_bound_accounts_cairo0": []
},
"os_resources": {
"execute_syscalls": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"validate_timestamp_rounding": 3600
},
"validated": "VALID",
"v1_bound_accounts": [
"v1_bound_accounts_cairo0": [
"0x01a7820094feaf82d53f53f214b81292d717e7bb9a92bb2488092cd306f3993f"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ fn test_tx_info(
let mut test_contract_data: FeatureContractData = test_contract.into();
if v1_bound_account {
let optional_class_hash =
VersionedConstants::latest_constants().os_constants.v1_bound_accounts.first();
VersionedConstants::latest_constants().os_constants.v1_bound_accounts_cairo0.first();
test_contract_data.class_hash =
*optional_class_hash.expect("No v1 bound accounts found in versioned constants.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl<'a> DeprecatedSyscallHintProcessor<'a> {
let version = tx_context.tx_info.version();
let versioned_constants = &tx_context.block_context.versioned_constants;
// The set of v1-bound-accounts.
let v1_bound_accounts = &versioned_constants.os_constants.v1_bound_accounts;
let v1_bound_accounts = &versioned_constants.os_constants.v1_bound_accounts_cairo0;

// If the transaction version is 3 and the account is in the v1-bound-accounts set,
// the syscall should return transaction version 1 instead.
Expand Down
8 changes: 4 additions & 4 deletions crates/blockifier/src/versioned_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ pub struct OsConstants {
pub os_contract_addresses: OsContractAddresses,
pub validate_max_sierra_gas: GasAmount,
pub execute_max_sierra_gas: GasAmount,
pub v1_bound_accounts: Vec<ClassHash>,
pub v1_bound_accounts_cairo0: Vec<ClassHash>,
}

impl OsConstants {
Expand Down Expand Up @@ -861,14 +861,14 @@ impl TryFrom<OsConstantsRawJson> for OsConstants {
.ok_or_else(|| OsConstantsSerdeError::KeyNotFoundInFile(key.to_string()))?
.clone(),
)?);
let v1_bound_accounts = raw_json_data.v1_bound_accounts;
let v1_bound_accounts_cairo0 = raw_json_data.v1_bound_accounts_cairo0;
let os_constants = OsConstants {
gas_costs,
validate_rounding_consts,
os_contract_addresses,
validate_max_sierra_gas,
execute_max_sierra_gas,
v1_bound_accounts,
v1_bound_accounts_cairo0,
};
Ok(os_constants)
}
Expand Down Expand Up @@ -909,7 +909,7 @@ struct OsConstantsRawJson {
#[serde(default)]
validate_rounding_consts: ValidateRoundingConsts,
os_contract_addresses: OsContractAddresses,
v1_bound_accounts: Vec<ClassHash>,
v1_bound_accounts_cairo0: Vec<ClassHash>,
}

impl OsConstantsRawJson {
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/versioned_constants_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn check_constants_serde_error(json_data: &str, expected_error_message: &str) {
"os_contract_addresses".to_string(),
serde_json::to_value(OsContractAddresses::default()).unwrap(),
);
json_data_raw.insert("v1_bound_accounts".to_string(), serde_json::Value::Array(vec![]));
json_data_raw.insert("v1_bound_accounts_cairo0".to_string(), serde_json::Value::Array(vec![]));

let json_data = &serde_json::to_string(&json_data_raw).unwrap();

Expand Down

0 comments on commit 71a51dd

Please sign in to comment.