Skip to content

Commit 0cd2a74

Browse files
committed
Fixed cost of local_into_box cost.
SIERRA_UPDATE_PATCH_CHANGE_TAG=Not yet released libfunc.
1 parent 3fd8d15 commit 0cd2a74

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

crates/cairo-lang-sierra-gas/src/core_libfunc_cost_base.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,7 @@ pub fn core_libfunc_cost(
370370
std::cmp::max(1, info_provider.type_size(&libfunc.ty).try_into().unwrap());
371371
vec![ConstCost::steps(n_steps).into()]
372372
}
373-
BoxConcreteLibfunc::LocalInto(_) => {
374-
vec![ConstCost::steps(3).into()]
375-
}
373+
BoxConcreteLibfunc::LocalInto(_) => vec![ConstCost::steps(2).into()],
376374
BoxConcreteLibfunc::Unbox(_) | BoxConcreteLibfunc::ForwardSnapshot(_) => {
377375
vec![ConstCost::default().into()]
378376
}

tests/e2e_test_data/libfuncs/box

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ call rel 5;
746746
ret;
747747

748748
//! > function_costs
749-
test::foo: SmallOrderedMap({Const: 400})
749+
test::foo: SmallOrderedMap({Const: 300})
750750

751751
//! > sierra_code
752752
type felt252 = felt252 [storable: true, drop: true, dup: true, zero_sized: false];
@@ -781,7 +781,7 @@ call rel 4;
781781
ret;
782782

783783
//! > function_costs
784-
test::foo: SmallOrderedMap({Const: 400})
784+
test::foo: SmallOrderedMap({Const: 300})
785785

786786
//! > sierra_code
787787
type Unit = Struct<ut@Tuple> [storable: true, drop: true, dup: true, zero_sized: true];
@@ -833,7 +833,7 @@ return([1]);
833833
test::foo@F0() -> (Box<Unit>);
834834

835835
//! > function_costs
836-
test::foo: SmallOrderedMap({Const: 400})
836+
test::foo: SmallOrderedMap({Const: 300})
837837

838838
//! > ==========================================================================
839839

@@ -854,7 +854,7 @@ call rel 5;
854854
ret;
855855

856856
//! > function_costs
857-
test::foo: SmallOrderedMap({Const: 400})
857+
test::foo: SmallOrderedMap({Const: 300})
858858

859859
//! > sierra_code
860860
type felt252 = felt252 [storable: true, drop: true, dup: true, zero_sized: false];
@@ -904,7 +904,7 @@ ret;
904904

905905
//! > function_costs
906906
test::bar: SmallOrderedMap({Const: 100})
907-
test::foo: SmallOrderedMap({Const: 900})
907+
test::foo: SmallOrderedMap({Const: 800})
908908

909909
//! > sierra_code
910910
type felt252 = felt252 [storable: true, drop: true, dup: true, zero_sized: false];
@@ -966,7 +966,7 @@ call rel 5;
966966
ret;
967967

968968
//! > function_costs
969-
test::foo: SmallOrderedMap({Const: 400})
969+
test::foo: SmallOrderedMap({Const: 300})
970970

971971
//! > sierra_code
972972
type felt252 = felt252 [storable: true, drop: true, dup: true, zero_sized: false];

0 commit comments

Comments
 (0)