Skip to content

Commit

Permalink
chore: update resources for OS with revert log
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyalesokhin-starkware committed Sep 3, 2024
1 parent 05641d7 commit 17264b1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
34 changes: 17 additions & 17 deletions crates/blockifier/resources/versioned_constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"os_resources": {
"execute_syscalls": {
"CallContract": {
"n_steps": 827,
"n_steps": 860,
"builtin_instance_counter": {
"range_check_builtin": 15
},
Expand All @@ -215,7 +215,7 @@
"n_memory_holes": 0
},
"Deploy": {
"n_steps": 1099,
"n_steps": 1128,
"builtin_instance_counter": {
"pedersen_builtin": 7,
"range_check_builtin": 18
Expand Down Expand Up @@ -294,7 +294,7 @@
"n_memory_holes": 0
},
"LibraryCall": {
"n_steps": 818,
"n_steps": 836,
"builtin_instance_counter": {
"range_check_builtin": 15
},
Expand All @@ -308,7 +308,7 @@
"n_memory_holes": 0
},
"ReplaceClass": {
"n_steps": 98,
"n_steps": 104,
"builtin_instance_counter": {
"range_check_builtin": 1
},
Expand Down Expand Up @@ -400,14 +400,14 @@
"n_memory_holes": 0
},
"StorageRead": {
"n_steps": 87,
"n_steps": 89,
"builtin_instance_counter": {
"range_check_builtin": 1
},
"n_memory_holes": 0
},
"StorageWrite": {
"n_steps": 89,
"n_steps": 93,
"builtin_instance_counter": {
"range_check_builtin": 1
},
Expand All @@ -418,7 +418,7 @@
"Declare": {
"deprecated_resources": {
"constant": {
"n_steps": 3099,
"n_steps": 3161,
"builtin_instance_counter": {
"pedersen_builtin": 16,
"range_check_builtin": 56,
Expand All @@ -434,10 +434,10 @@
},
"resources": {
"constant": {
"n_steps": 3231,
"n_steps": 3254,
"builtin_instance_counter": {
"pedersen_builtin": 4,
"range_check_builtin": 64,
"range_check_builtin": 61,
"poseidon_builtin": 14
},
"n_memory_holes": 0
Expand All @@ -452,7 +452,7 @@
"DeployAccount": {
"deprecated_resources": {
"constant": {
"n_steps": 4020,
"n_steps": 4114,
"builtin_instance_counter": {
"pedersen_builtin": 23,
"range_check_builtin": 72
Expand All @@ -469,10 +469,10 @@
},
"resources": {
"constant": {
"n_steps": 4169,
"n_steps": 4224,
"builtin_instance_counter": {
"pedersen_builtin": 11,
"range_check_builtin": 80,
"range_check_builtin": 77,
"poseidon_builtin": 10
},
"n_memory_holes": 0
Expand All @@ -489,7 +489,7 @@
"InvokeFunction": {
"deprecated_resources": {
"constant": {
"n_steps": 3769,
"n_steps": 3854,
"builtin_instance_counter": {
"pedersen_builtin": 14,
"range_check_builtin": 69
Expand All @@ -506,10 +506,10 @@
},
"resources": {
"constant": {
"n_steps": 3942,
"n_steps": 3988,
"builtin_instance_counter": {
"pedersen_builtin": 4,
"range_check_builtin": 77,
"range_check_builtin": 74,
"poseidon_builtin": 11
},
"n_memory_holes": 0
Expand All @@ -526,7 +526,7 @@
"L1Handler": {
"deprecated_resources": {
"constant": {
"n_steps": 1234,
"n_steps": 1257,
"builtin_instance_counter": {
"pedersen_builtin": 11,
"range_check_builtin": 16
Expand Down Expand Up @@ -616,4 +616,4 @@
100
]
}
}
}
10 changes: 6 additions & 4 deletions crates/blockifier/src/transaction/account_transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn test_circuit(block_context: BlockContext, max_resource_bounds: DeprecatedReso
.unwrap();

assert!(tx_execution_info.revert_error.is_none());
assert_eq!(tx_execution_info.receipt.gas, GasVector::from_l1_gas(6688));
assert_eq!(tx_execution_info.receipt.gas, GasVector::from_l1_gas(6806));
}

#[rstest]
Expand Down Expand Up @@ -152,7 +152,7 @@ fn test_rc96_holes(
[&BuiltinName::range_check96],
24
);
assert_eq!(tx_execution_info.receipt.gas, GasVector::from_l1_gas(6604));
assert_eq!(tx_execution_info.receipt.gas, GasVector::from_l1_gas(6722));
}

#[rstest]
Expand Down Expand Up @@ -292,7 +292,7 @@ fn test_infinite_recursion(
max_resource_bounds: DeprecatedResourceBoundsMapping,
) {
// Limit the number of execution steps (so we quickly hit the limit).
block_context.versioned_constants.invoke_tx_max_n_steps = 4100;
block_context.versioned_constants.invoke_tx_max_n_steps = 4200;

let TestInitData { mut state, account_address, contract_address, mut nonce_manager } =
create_test_init_data(&block_context.chain_info, CairoVersion::Cairo0);
Expand Down Expand Up @@ -702,7 +702,7 @@ fn test_reverted_reach_steps_limit(
create_test_init_data(&block_context.chain_info, cairo_version);

// Limit the number of execution steps (so we quickly hit the limit).
block_context.versioned_constants.invoke_tx_max_n_steps = 5000;
block_context.versioned_constants.invoke_tx_max_n_steps = 6000;
let recursion_base_args = invoke_tx_args! {
max_fee,
resource_bounds: max_resource_bounds,
Expand Down Expand Up @@ -771,6 +771,8 @@ fn test_reverted_reach_steps_limit(

// Make sure that the failed transaction gets charged for the extra steps taken, compared with
// the smaller valid transaction.

// If this fail, try to increase the `invoke_tx_max_n_steps` above.
assert!(n_steps_fail > n_steps_1);
assert!(actual_fee_fail > actual_fee_1);

Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/src/transaction/transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ fn test_l1_handler(#[values(false, true)] use_kzg_da: bool) {
..Default::default()
},
resources: ExecutionResources {
n_steps: 154,
n_steps: 158,
n_memory_holes: 0,
builtin_instance_counter: HashMap::from([(BuiltinName::range_check, 6)]),
},
Expand Down Expand Up @@ -1893,7 +1893,7 @@ fn test_l1_handler(#[values(false, true)] use_kzg_da: bool) {
+ 6,
),
]),
n_steps: get_tx_resources(TransactionType::L1Handler).n_steps + 167,
n_steps: get_tx_resources(TransactionType::L1Handler).n_steps + 171,
n_memory_holes: 0,
};

Expand Down

0 comments on commit 17264b1

Please sign in to comment.