Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/blockifier/src/bouncer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,11 @@ fn class_hash_migration_data_from_state(

if should_migrate {
expect![[r#"
111245775
111211275
"#]]
.assert_debug_eq(&migration_sierra_gas.0);
expect![[r#"
269417662
269383162
"#]]
.assert_debug_eq(&migration_proving_gas.0);
} else {
Expand Down
6 changes: 3 additions & 3 deletions crates/blockifier/src/execution/casm_hash_estimation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl CasmV2HashResourceEstimate {

// Base number of VM steps applied when the input to Blake hashing is empty.
// Determined empirically by running `encode_felt252_data_and_calc_blake_hash` on empty input.
pub const STEPS_EMPTY_INPUT: usize = 170;
pub const STEPS_EMPTY_INPUT: usize = 169;

// The constants used are empirical, based on running `encode_felt252_data_and_calc_blake_hash`
// on combinations of large and small felts.
Expand All @@ -259,9 +259,9 @@ impl CasmV2HashResourceEstimate {
// VM steps per small felt.
pub const STEPS_PER_SMALL_FELT: usize = 15;
// Base overhead when input exactly fills a 16-u32 Blake message.
pub const BASE_STEPS_FULL_MSG: usize = 217;
pub const BASE_STEPS_FULL_MSG: usize = 216;
// Base overhead when the input leaves a remainder (< 16 u32s) for a Blake message.
pub const BASE_STEPS_PARTIAL_MSG: usize = 195;
pub const BASE_STEPS_PARTIAL_MSG: usize = 194;
// Extra VM steps added per 2-u32 remainder in partial Blake messages.
pub const STEPS_PER_2_U32_REMINDER: usize = 3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ fn estimated_encode_and_blake_hash_execution_resources(data: &[Felt]) -> Executi
let estimated =
CasmV2HashResourceEstimate::estimated_resources_of_hash_function(&felt_size_groups);

let mut resources = estimated.vm_resources.clone();
resources.n_steps -= 1;

resources
estimated.vm_resources.clone()
}

/// Returns the result and the resources used.
Expand Down
Loading