Skip to content

Commit 85c0935

Browse files
committed
Made execution info v3 the default.
Additionally added it to audited list and to coverage. SIERRA_UPDATE_MINOR_CHANGE_TAG=Added libfunc to allowlist, and using it.
1 parent 3818da1 commit 85c0935

File tree

33 files changed

+20170
-19895
lines changed

33 files changed

+20170
-19895
lines changed

corelib/src/starknet.cairo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ use class_hash::{
8888

8989
// Not `pub` on purpose, only used for direct reexport by the next line.
9090
mod info;
91-
pub use info::v2::{ExecutionInfo, ResourceBounds as ResourcesBounds, TxInfo};
91+
pub use info::v3::{ExecutionInfo, ResourceBounds as ResourcesBounds, TxInfo};
9292
pub use info::{
9393
BlockInfo, get_block_info, get_block_number, get_block_timestamp, get_caller_address,
9494
get_contract_address, get_execution_info, get_tx_info,
@@ -125,7 +125,7 @@ pub trait SyscallResultTrait<T> {
125125
/// # Examples
126126
///
127127
/// ```
128-
/// let result = starknet::syscalls::get_execution_info_v2_syscall();
128+
/// let result = starknet::syscalls::get_execution_info_v3_syscall();
129129
/// let info = result.unwrap_syscall();
130130
/// ```
131131
fn unwrap_syscall(self: SyscallResult<T>) -> T;

corelib/src/starknet/info.cairo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ pub struct TxInfo {
9292
/// let contract = execution_info.contract_address;
9393
/// let selector = execution_info.entry_point_selector;
9494
/// ```
95-
pub fn get_execution_info() -> Box<v2::ExecutionInfo> {
96-
starknet::syscalls::get_execution_info_v2_syscall().unwrap_syscall()
95+
pub fn get_execution_info() -> Box<v3::ExecutionInfo> {
96+
starknet::syscalls::get_execution_info_v3_syscall().unwrap_syscall()
9797
}
9898

9999
/// Returns the address of the caller contract.
@@ -163,7 +163,7 @@ pub fn get_block_info() -> Box<BlockInfo> {
163163
/// let signature = tx_info.signature;
164164
/// let version = tx_info.version;
165165
/// ```
166-
pub fn get_tx_info() -> Box<v2::TxInfo> {
166+
pub fn get_tx_info() -> Box<v3::TxInfo> {
167167
get_execution_info().tx_info
168168
}
169169

crates/cairo-lang-runner/src/profiling_test_data/major_test_cases

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ Weight by sierra statement:
760760
statement 58: 7 (contract_address_try_from_felt252([5], [14]) { fallthrough([15], [16]) 207([17]) })
761761
statement 96: 6 (withdraw_gas_all([33], [6], [43]) { fallthrough([44], [45]) 158([46], [47]) })
762762
statement 766: 6 (store_temp<core::panics::PanicResult::<(core::integer::u256,)>>([37]) -> ([37]))
763-
statement 98: 5 (get_execution_info_v2_syscall([45], [3]) { fallthrough([48], [49], [50]) 145([51], [52], [53]) })
763+
statement 98: 5 (get_execution_info_v3_syscall([45], [3]) { fallthrough([48], [49], [50]) 145([51], [52], [53]) })
764764
statement 486: 5 (store_temp<test::erc_20::Event>([187]) -> ([187]))
765765
statement 746: 4 (u128s_from_felt252([0], [12]) { fallthrough([16], [17]) 788([18], [19], [20]) })
766766
statement 756: 4 (u128s_from_felt252([16], [25]) { fallthrough([29], [30]) 768([31], [32], [33]) })
@@ -827,7 +827,7 @@ Weight by sierra statement:
827827
statement 65: 1 (store_temp<felt252>([22]) -> ([22]))
828828
statement 73: 1 (store_temp<felt252>([32]) -> ([32]))
829829
statement 95: 1 (store_temp<BuiltinCosts>([43]) -> ([43]))
830-
statement 101: 1 (store_temp<Box<core::starknet::info::v2::ExecutionInfo>>([50]) -> ([50]))
830+
statement 101: 1 (store_temp<Box<core::starknet::info::v3::ExecutionInfo>>([50]) -> ([50]))
831831
statement 109: 1 (store_temp<RangeCheck>([44]) -> ([44]))
832832
statement 110: 1 (store_temp<GasBuiltin>([48]) -> ([48]))
833833
statement 111: 1 (store_temp<Pedersen>([0]) -> ([0]))
@@ -938,7 +938,7 @@ Weight by concrete libfunc:
938938
libfunc u128_overflowing_add: 6
939939
libfunc u128_overflowing_sub: 6
940940
libfunc withdraw_gas_all: 6
941-
libfunc get_execution_info_v2_syscall: 5
941+
libfunc get_execution_info_v3_syscall: 5
942942
libfunc jump: 5
943943
libfunc store_temp<Pedersen>: 5
944944
libfunc store_temp<test::erc_20::Event>: 5
@@ -966,7 +966,7 @@ Weight by concrete libfunc:
966966
libfunc enum_match<test::erc_20::Event>: 1
967967
libfunc function_call<user@test::erc_20::StorageImpl::transfer_helper>: 1
968968
libfunc function_call<user@test::erc_20::__wrapper__IERC20Impl__transfer>: 1
969-
libfunc store_temp<Box<core::starknet::info::v2::ExecutionInfo>>: 1
969+
libfunc store_temp<Box<core::starknet::info::v3::ExecutionInfo>>: 1
970970
libfunc store_temp<BuiltinCosts>: 1
971971
return: 5
972972
Weight by generic libfunc:
@@ -985,7 +985,7 @@ Weight by generic libfunc:
985985
libfunc u128_overflowing_add: 6
986986
libfunc u128_overflowing_sub: 6
987987
libfunc withdraw_gas_all: 6
988-
libfunc get_execution_info_v2_syscall: 5
988+
libfunc get_execution_info_v3_syscall: 5
989989
libfunc jump: 5
990990
libfunc array_new: 4
991991
libfunc function_call: 4

crates/cairo-lang-starknet-classes/src/allowed_libfuncs_lists/audited.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"get_class_hash_at_syscall": null,
9494
"get_execution_info_syscall": null,
9595
"get_execution_info_v2_syscall": null,
96+
"get_execution_info_v3_syscall": { "major": 1, "minor": 8, "patch": 0 },
9697
"hades_permutation": null,
9798
"i128_const": null,
9899
"i128_diff": null,

crates/cairo-lang-starknet-classes/src/compiled_class_hash_test_data/contracts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ test_compiled_class_hash
103103
libfuncs_coverage__libfuncs_coverage
104104

105105
//! > compiled_class_hash
106-
37af083d4d0b894641dc2e9f9aef603efe7199aff4f031b11fedfb3cc461827
106+
6cf46c5e38a64dbd80c5e58b944786bb0779c6a96193933d8fe72af7b4413a4
107107

108108
//! > legacy_compiled_class_hash
109-
4249d473545e380bae0afb2bf7d6ee08cd229fdf50508a304c673e21db19ee9
109+
4ad32441130e7b55710971a573253b4949890f2e0043b3535454f15036fe8a5
110110

111111
//! > ==========================================================================
112112

crates/cairo-lang-starknet/cairo_level_tests/contracts/libfuncs_coverage.cairo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ enum StarknetLibfuncs {
175175
GetBlockHash: u64,
176176
GetExecutionInfo,
177177
GetExecutionInfoV2,
178+
GetExecutionInfoV3,
178179
ReplaceClass: starknet::ClassHash,
179180
SendMessageToL1: (felt252, Span<felt252>),
180181
GetClassHashAt: starknet::ContractAddress,
@@ -524,6 +525,9 @@ fn starknet_libfuncs(libfuncs: StarknetLibfuncs) {
524525
StarknetLibfuncs::GetExecutionInfoV2 => use_and_panic(
525526
syscalls::get_execution_info_v2_syscall(),
526527
),
528+
StarknetLibfuncs::GetExecutionInfoV3 => use_and_panic(
529+
syscalls::get_execution_info_v3_syscall(),
530+
),
527531
StarknetLibfuncs::ReplaceClass(class_hash) => use_and_panic(
528532
syscalls::replace_class_syscall(class_hash),
529533
),

0 commit comments

Comments
 (0)