diff --git a/crates/blockifier/feature_contracts/cairo1/account_faulty.cairo b/crates/blockifier/feature_contracts/cairo1/account_faulty.cairo index d80388d178..a3ee668ea6 100644 --- a/crates/blockifier/feature_contracts/cairo1/account_faulty.cairo +++ b/crates/blockifier/feature_contracts/cairo1/account_faulty.cairo @@ -11,7 +11,7 @@ mod Account { use option::{Option, OptionTrait}; use starknet::{ContractAddress, call_contract_syscall, contract_address_try_from_felt252, - get_tx_info, info::SyscallResultTrait, send_message_to_l1_syscall, + get_execution_info, get_tx_info, info::SyscallResultTrait, send_message_to_l1_syscall, syscalls::get_block_hash_syscall, TxInfo}; // Validate Scenarios. @@ -24,6 +24,8 @@ mod Account { const CALL_CONTRACT: felt252 = 2; // Use get_block_hash syscall. const GET_BLOCK_HASH: felt252 = 3; + // Use get_execution_info syscall. + const GET_EXECUTION_INFO: felt252 = 4; // get_selector_from_name('foo'). const FOO_ENTRY_POINT_SELECTOR: felt252 = ( @@ -121,9 +123,23 @@ mod Account { .unwrap_syscall(); return starknet::VALIDATED; } - assert (scenario == GET_BLOCK_HASH, 'Unknown scenario'); - let block_number: u64 = 0; - get_block_hash_syscall(block_number).unwrap_syscall(); + if (scenario == GET_BLOCK_HASH){ + let block_number: u64 = 0; + get_block_hash_syscall(block_number).unwrap_syscall(); + return starknet::VALIDATED; + } + + assert (scenario == GET_EXECUTION_INFO, 'Unknown scenario'); + + let block_number: felt252 = *signature[1_u32]; + let block_timestamp: felt252 = *signature[2_u32]; + let sequencer_address: felt252 = *signature[3_u32]; + + let execution_info = starknet::get_execution_info().unbox(); + let block_info = execution_info.block_info.unbox(); + assert(block_info.block_number.into() == block_number, 'BLOCK_NUMBER_MISMATCH'); + assert(block_info.block_timestamp.into() == block_timestamp, 'BLOCK_TIMESTAMP_MISMATCH'); + assert(block_info.sequencer_address.into() == sequencer_address, 'SEQUENCER_MISMATCH'); starknet::VALIDATED } diff --git a/crates/blockifier/feature_contracts/cairo1/compiled/account_faulty.casm.json b/crates/blockifier/feature_contracts/cairo1/compiled/account_faulty.casm.json index 13adc4c369..4e9ead30cb 100644 --- a/crates/blockifier/feature_contracts/cairo1/compiled/account_faulty.casm.json +++ b/crates/blockifier/feature_contracts/cairo1/compiled/account_faulty.casm.json @@ -42,21 +42,21 @@ "0x1", "0x208b7fff7fff7ffe", "0x1104800180018000", - "0x6ed", + "0x786", "0x482480017fff8000", - "0x6ec", + "0x785", "0x480080007fff8000", "0xa0680017fff8000", "0x9", "0x4824800180007fe8", - "0x6fae", + "0x8354", "0x482480017fff8000", "0x100000000000000000000000000000000", "0x400080007ff67fff", "0x10780017fff7fff", "0x24", "0x4824800180007fe8", - "0x6fae", + "0x8354", "0x400080007ff77fff", "0x482480017ff78000", "0x1", @@ -72,7 +72,7 @@ "0x48127ffe7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", - "0x47a", + "0x513", "0x48127ff27fff8000", "0x48127ff27fff8000", "0x48127ff27fff8000", @@ -160,7 +160,7 @@ "0x48127ffc7fff8000", "0x48127ffc7fff8000", "0x1104800180018000", - "0x427", + "0x4c0", "0x20680017fff7ffe", "0x59", "0x48307ffc80007ffd", @@ -185,21 +185,21 @@ "0x1", "0x208b7fff7fff7ffe", "0x1104800180018000", - "0x65e", + "0x6f7", "0x482480017fff8000", - "0x65d", + "0x6f6", "0x480080007fff8000", "0xa0680017fff8000", "0x9", "0x4824800180007fc6", - "0x8912", + "0x9cb8", "0x482480017fff8000", "0x100000000000000000000000000000000", "0x400080007fd47fff", "0x10780017fff7fff", "0x27", "0x4824800180007fc6", - "0x8912", + "0x9cb8", "0x400080007fd57fff", "0x482480017fd58000", "0x1", @@ -209,7 +209,7 @@ "0x48127fe07fff8000", "0x48127ff27fff8000", "0x1104800180018000", - "0x429", + "0x4c2", "0x20680017fff7ffd", "0x11", "0x40780017fff7fff", @@ -218,7 +218,7 @@ "0x48127ffe7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", - "0x3e8", + "0x481", "0x48127ff27fff8000", "0x48127ff27fff8000", "0x48127ff27fff8000", @@ -324,7 +324,7 @@ "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", - "0x3e8", + "0x481", "0x20680017fff7ffe", "0x90", "0x48127ffc7fff8000", @@ -340,7 +340,7 @@ "0x48127ffa7fff8000", "0x40137ffb7fff8001", "0x1104800180018000", - "0x411", + "0x4aa", "0x20680017fff7ffa", "0x6a", "0x20680017fff7ffd", @@ -367,21 +367,21 @@ "0x1", "0x208b7fff7fff7ffe", "0x1104800180018000", - "0x5a8", + "0x641", "0x482480017fff8000", - "0x5a7", + "0x640", "0x480080007fff8000", "0xa0680017fff8000", "0x9", "0x4824800180007ff2", - "0xb766", + "0xcb0c", "0x482480017fff8000", "0x100000000000000000000000000000000", "0x400080007fef7fff", "0x10780017fff7fff", "0x28", "0x4824800180007ff2", - "0xb766", + "0xcb0c", "0x400080007ff07fff", "0x482480017ff08000", "0x1", @@ -392,7 +392,7 @@ "0x48127ff17fff8000", "0x48127ff17fff8000", "0x1104800180018000", - "0x425", + "0x4be", "0x20680017fff7ffd", "0x11", "0x40780017fff7fff", @@ -401,7 +401,7 @@ "0x48127ffe7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", - "0x331", + "0x3ca", "0x48127ff27fff8000", "0x48127ff27fff8000", "0x48127ff27fff8000", @@ -515,7 +515,7 @@ "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", - "0x329", + "0x3c2", "0x20680017fff7ffe", "0x85", "0x48127ffc7fff8000", @@ -531,7 +531,7 @@ "0x48127ffa7fff8000", "0x40137ffb7fff8001", "0x1104800180018000", - "0x352", + "0x3eb", "0x20680017fff7ffa", "0x5f", "0x20680017fff7ffd", @@ -558,9 +558,9 @@ "0x1", "0x208b7fff7fff7ffe", "0x1104800180018000", - "0x4e9", + "0x582", "0x482480017fff8000", - "0x4e8", + "0x581", "0x480080007fff8000", "0xa0680017fff8000", "0x9", @@ -581,14 +581,14 @@ "0x48127ff27fff8000", "0x48127ff27fff8000", "0x1104800180018000", - "0x396", + "0x42f", "0x40780017fff7fff", "0x1", "0x48127ffe7fff8000", "0x48127ffe7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", - "0x276", + "0x30f", "0x482480017fd88000", "0x1", "0x48127ff47fff8000", @@ -712,9 +712,9 @@ "0x1", "0x208b7fff7fff7ffe", "0x1104800180018000", - "0x44f", + "0x4e8", "0x482480017fff8000", - "0x44e", + "0x4e7", "0x480080007fff8000", "0xa0680017fff8000", "0x9", @@ -729,7 +729,7 @@ "0x0", "0x400080007ff87fff", "0x1104800180018000", - "0x31b", + "0x3b4", "0x40780017fff7fff", "0x1", "0x482480017ff58000", @@ -784,7 +784,7 @@ "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", - "0x1b7", + "0x250", "0x482680017ff98000", "0x1", "0x20680017fff7ffd", @@ -811,21 +811,21 @@ "0x1", "0x208b7fff7fff7ffe", "0x1104800180018000", - "0x3ec", + "0x485", "0x482480017fff8000", - "0x3eb", + "0x484", "0x480080007fff8000", "0xa0680017fff8000", "0x9", "0x4824800180007fe4", - "0x7652", + "0x89f8", "0x482480017fff8000", "0x100000000000000000000000000000000", "0x400080007ff67fff", "0x10780017fff7fff", "0x20", "0x4824800180007fe4", - "0x7652", + "0x89f8", "0x400080007ff77fff", "0x482480017ff78000", "0x1", @@ -833,7 +833,7 @@ "0x480a7ffb7fff8000", "0x48127ff37fff8000", "0x1104800180018000", - "0x2b4", + "0x34d", "0x20680017fff7ffd", "0xc", "0x40780017fff7fff", @@ -937,30 +937,30 @@ "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", - "0x27a", + "0x313", "0x20680017fff7ffd", - "0x10d", + "0x1a6", "0x480a7ffb7fff8000", "0x480080037ffe8000", "0x480080047ffd8000", "0x480680017fff8000", "0x0", "0x1104800180018000", - "0x286", + "0x31f", "0x480080037ff08000", "0x480080047fef8000", "0x20680017fff7ffb", - "0xf8", + "0x191", "0x480080007ffd8000", "0x4824800180007fff", "0x0", "0x20680017fff7fff", "0xe", "0x40780017fff7fff", - "0x28", - "0x48127fd07fff8000", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x52", + "0x48127fa67fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x0", "0x480680017fff8000", @@ -973,7 +973,7 @@ "0x20680017fff7fff", "0x24", "0x40780017fff7fff", - "0x23", + "0x4d", "0x480680017fff8000", "0x0", "0x4824800180007fff", @@ -982,9 +982,9 @@ "0xe", "0x40780017fff7fff", "0x2", - "0x48127fd07fff8000", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x48127fa67fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x0", "0x480680017fff8000", @@ -997,9 +997,9 @@ "0x480680017fff8000", "0x496e76616c6964207363656e6172696f", "0x400080007ffe7fff", - "0x48127fd07fff8000", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x48127fa67fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x1", "0x48127ffa7fff8000", @@ -1009,14 +1009,16 @@ "0x4824800180007ffd", "0x2", "0x20680017fff7fff", - "0x76", - "0x48127ff67fff8000", - "0x48127ff97fff8000", - "0x48127ff97fff8000", + "0x78", + "0x40780017fff7fff", + "0x2a", + "0x48127fcc7fff8000", + "0x48127fcf7fff8000", + "0x48127fcf7fff8000", "0x480680017fff8000", "0x1", "0x1104800180018000", - "0x240", + "0x2d7", "0x20680017fff7ffd", "0x63", "0x40780017fff7fff", @@ -1052,33 +1054,33 @@ "0x3", "0x480680017fff8000", "0x43616c6c436f6e7472616374", - "0x400080007fcc7fff", - "0x400080017fcc7fcb", - "0x400080027fcc7ff5", - "0x400080037fcc7ffb", - "0x400080047fcc7ffc", - "0x400080057fcc7ffd", - "0x480080077fcc8000", + "0x400080007fa27fff", + "0x400080017fa27fa1", + "0x400080027fa27ff5", + "0x400080037fa27ffb", + "0x400080047fa27ffc", + "0x400080057fa27ffd", + "0x480080077fa28000", "0x20680017fff7fff", "0xb", - "0x480080067fcb8000", - "0x482480017fca8000", + "0x480080067fa18000", + "0x482480017fa08000", "0xa", "0x480680017fff8000", "0x0", - "0x480080087fc88000", - "0x480080097fc78000", + "0x480080087f9e8000", + "0x480080097f9d8000", "0x10780017fff7fff", "0x9", - "0x480080067fcb8000", - "0x482480017fca8000", + "0x480080067fa18000", + "0x482480017fa08000", "0xa", "0x480680017fff8000", "0x1", - "0x480080087fc88000", - "0x480080097fc78000", + "0x480080087f9e8000", + "0x480080097f9d8000", "0x1104800180018000", - "0x224", + "0x2bb", "0x20680017fff7ffd", "0xc", "0x48127ff37fff8000", @@ -1108,8 +1110,8 @@ "0x400080007ffe7fff", "0x482480017fe58000", "0x3", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x1", "0x48127ffa7fff8000", @@ -1119,51 +1121,51 @@ "0x40780017fff7fff", "0x17", "0x48127fe57fff8000", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x1", "0x48127fe37fff8000", "0x48127fe37fff8000", "0x208b7fff7fff7ffe", - "0x40780017fff7fff", - "0x18", - "0x4824800180007fe4", + "0x4824800180007ffc", "0x3", "0x20680017fff7fff", - "0x33", + "0x35", + "0x40780017fff7fff", + "0x42", "0x480680017fff8000", "0x0", "0x480680017fff8000", "0x476574426c6f636b48617368", - "0x400080007fcc7fff", - "0x400080017fcc7fcb", - "0x400080027fcc7ffe", - "0x480080047fcc8000", + "0x400080007fa27fff", + "0x400080017fa27fa1", + "0x400080027fa27ffe", + "0x480080047fa28000", "0x20680017fff7fff", "0xc", - "0x480080037fcb8000", - "0x482480017fca8000", + "0x480080037fa18000", + "0x482480017fa08000", "0x6", "0x480680017fff8000", "0x0", "0x480680017fff8000", "0x0", - "0x480080057fc78000", + "0x480080057f9d8000", "0x10780017fff7fff", "0x9", - "0x480080037fcb8000", - "0x482480017fca8000", + "0x480080037fa18000", + "0x482480017fa08000", "0x7", "0x480680017fff8000", "0x1", - "0x480080057fc88000", - "0x480080067fc78000", + "0x480080057f9e8000", + "0x480080067f9d8000", "0x1104800180018000", - "0x1de", + "0x275", "0x20680017fff7ffd", "0xc", - "0x48127fd07fff8000", + "0x48127fa67fff8000", "0x48127ff57fff8000", "0x48127ff57fff8000", "0x480680017fff8000", @@ -1173,7 +1175,7 @@ "0x480680017fff8000", "0x56414c4944", "0x208b7fff7fff7ffe", - "0x48127fd07fff8000", + "0x48127fa67fff8000", "0x48127ff57fff8000", "0x48127ff57fff8000", "0x480680017fff8000", @@ -1181,16 +1183,167 @@ "0x48127ffa7fff8000", "0x48127ffa7fff8000", "0x208b7fff7fff7ffe", + "0x4824800180007ffb", + "0x4", + "0x20680017fff7fff", + "0x95", + "0x48127ff47fff8000", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480680017fff8000", + "0x1", + "0x1104800180018000", + "0x228", + "0x20680017fff7ffd", + "0x82", + "0x48127ffc7fff8000", + "0x48127fe87fff8000", + "0x48127fe87fff8000", + "0x480680017fff8000", + "0x2", + "0x1104800180018000", + "0x21f", + "0x480080007ff08000", + "0x20680017fff7ffc", + "0x6e", + "0x48127ffb7fff8000", + "0x48127fd87fff8000", + "0x48127fd87fff8000", + "0x480680017fff8000", + "0x3", + "0x1104800180018000", + "0x215", + "0x480080007fef8000", + "0x20680017fff7ffc", + "0x5a", + "0x48127fb57fff8000", + "0x48127fb57fff8000", + "0x1104800180018000", + "0x249", + "0x480080007fe98000", + "0x20680017fff7ffc", + "0x49", + "0x480080007ffe8000", + "0x480080007fff8000", + "0x48307fd780007fff", + "0x480080017ffd8000", + "0x480080027ffc8000", + "0x20680017fff7ffd", + "0x32", + "0x48307fe480007ffe", + "0x20680017fff7fff", + "0x1f", + "0x48307ff980007ffe", + "0x20680017fff7fff", + "0xe", + "0x40780017fff7fff", + "0x2", + "0x48127fdc7fff8000", + "0x48127ff07fff8000", + "0x48127ff07fff8000", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x56414c4944", + "0x208b7fff7fff7ffe", "0x40780017fff7fff", - "0xb", + "0x1", + "0x480680017fff8000", + "0x53455155454e4345525f4d49534d41544348", + "0x400080007ffe7fff", + "0x48127fdc7fff8000", + "0x48127ff07fff8000", + "0x48127ff07fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x424c4f434b5f54494d455354414d505f4d49534d41544348", + "0x400080007ffe7fff", + "0x48127fdc7fff8000", + "0x48127ff07fff8000", + "0x48127ff07fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x2", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x424c4f434b5f4e554d4245525f4d49534d41544348", + "0x400080007ffe7fff", + "0x48127fdc7fff8000", + "0x48127ff07fff8000", + "0x48127ff07fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x9", + "0x48127fdc7fff8000", + "0x48127ff07fff8000", + "0x48127ff07fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff07fff8000", + "0x48127ff07fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1f", + "0x48127fdc7fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", + "0x480680017fff8000", + "0x1", + "0x48127fda7fff8000", + "0x48127fda7fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x2f", + "0x48127fcc7fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", + "0x480680017fff8000", + "0x1", + "0x48127fca7fff8000", + "0x48127fca7fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x3f", + "0x48127fbd7fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", + "0x480680017fff8000", + "0x1", + "0x48127fbb7fff8000", + "0x48127fbb7fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x4c", "0x40780017fff7fff", "0x1", "0x480680017fff8000", "0x556e6b6e6f776e207363656e6172696f", "0x400080007ffe7fff", - "0x48127fd07fff8000", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x48127fa67fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x1", "0x48127ffa7fff8000", @@ -1198,24 +1351,24 @@ "0x1", "0x208b7fff7fff7ffe", "0x40780017fff7fff", - "0x2a", - "0x48127fd07fff8000", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x54", + "0x48127fa67fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x1", - "0x48127fce7fff8000", - "0x48127fce7fff8000", + "0x48127fa47fff8000", + "0x48127fa47fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", - "0x3b", + "0x65", "0x480a7ffb7fff8000", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x480680017fff8000", "0x1", - "0x48127fbf7fff8000", - "0x48127fbf7fff8000", + "0x48127f957fff8000", + "0x48127f957fff8000", "0x208b7fff7fff7ffe", "0x400380007ffd7ffb", "0x480a7ffc7fff8000", @@ -1288,7 +1441,7 @@ "0x20680017fff7fff", "0xe", "0x40780017fff7fff", - "0x64", + "0x8e", "0x480a7ff87fff8000", "0x480a7ff97fff8000", "0x480a7ffa7fff8000", @@ -1303,7 +1456,7 @@ "0x480a7ff97fff8000", "0x480a7ffa7fff8000", "0x1104800180018000", - "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffe91", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffdf8", "0x20680017fff7ffd", "0xb", "0x48127ffa7fff8000", @@ -1326,7 +1479,7 @@ "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", - "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffe56", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffdbd", "0x20680017fff7ffe", "0x2b", "0xa0680017fff8004", @@ -1413,7 +1566,7 @@ "0x48127ffa7fff8000", "0x480080007ff68000", "0x1104800180018000", - "0xee", + "0x119", "0x20680017fff7ffa", "0xc", "0x48127ff87fff8000", @@ -1478,7 +1631,7 @@ "0x48127ffd7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", - "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffde2", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd49", "0x20680017fff7ffd", "0xb", "0x48127ffa7fff8000", @@ -1539,7 +1692,7 @@ "0x20680017fff7fff", "0x9", "0x40780017fff7fff", - "0x64", + "0x8e", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x480a7ffc7fff8000", @@ -1549,7 +1702,7 @@ "0x480a7ffb7fff8000", "0x480a7ffc7fff8000", "0x1104800180018000", - "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd9b", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd02", "0x20680017fff7ffd", "0xc", "0x48127ffa7fff8000", @@ -1573,7 +1726,7 @@ "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", - "0xba", + "0x4e", "0x20680017fff7ffd", "0xa", "0x48127ffb7fff8000", @@ -1650,10 +1803,53 @@ "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x476574457865637574696f6e496e666f", + "0x400280007ffd7fff", + "0x400380017ffd7ffc", + "0x480280037ffd8000", + "0x20680017fff7fff", + "0xc", + "0x480280027ffd8000", + "0x482680017ffd8000", + "0x5", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480280047ffd8000", + "0x10780017fff7fff", + "0x9", + "0x480280027ffd8000", + "0x482680017ffd8000", + "0x6", + "0x480680017fff8000", + "0x1", + "0x480280047ffd8000", + "0x480280057ffd8000", "0x1104800180018000", - "0xa4", + "0x7f", + "0x20680017fff7ffd", + "0xa", + "0x48127ff67fff8000", + "0x48127ff67fff8000", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe", + "0x48127ff67fff8000", + "0x48127ff67fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x79", "0x482480017fff8000", - "0xa3", + "0x78", "0x480080007fff8000", "0xa0680017fff8000", "0x9", @@ -1685,7 +1881,7 @@ "0x480a7ff97fff8000", "0x480a7ffa7fff8000", "0x1104800180018000", - "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffcef", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffc2b", "0x20680017fff7ffe", "0x27", "0x400280007ffc7fff", @@ -1758,49 +1954,6 @@ "0x482480017ff78000", "0x1", "0x208b7fff7fff7ffe", - "0x480680017fff8000", - "0x476574457865637574696f6e496e666f", - "0x400280007ffd7fff", - "0x400380017ffd7ffc", - "0x480280037ffd8000", - "0x20680017fff7fff", - "0xc", - "0x480280027ffd8000", - "0x482680017ffd8000", - "0x5", - "0x480680017fff8000", - "0x0", - "0x480680017fff8000", - "0x0", - "0x480280047ffd8000", - "0x10780017fff7fff", - "0x9", - "0x480280027ffd8000", - "0x482680017ffd8000", - "0x6", - "0x480680017fff8000", - "0x1", - "0x480280047ffd8000", - "0x480280057ffd8000", - "0x1104800180018000", - "0x13", - "0x20680017fff7ffd", - "0xa", - "0x48127ff67fff8000", - "0x48127ff67fff8000", - "0x480680017fff8000", - "0x0", - "0x480680017fff8000", - "0x0", - "0x48127ffb7fff8000", - "0x208b7fff7fff7ffe", - "0x48127ff67fff8000", - "0x48127ff67fff8000", - "0x480680017fff8000", - "0x1", - "0x48127ffb7fff8000", - "0x48127ffb7fff8000", - "0x208b7fff7fff7ffe", "0x20780017fff7ffb", "0x8", "0x480680017fff8000", @@ -1857,7 +2010,7 @@ { "TestLessThanOrEqual": { "lhs": { - "Immediate": "0x6fae" + "Immediate": "0x8354" }, "rhs": { "Deref": { @@ -1966,7 +2119,7 @@ { "TestLessThanOrEqual": { "lhs": { - "Immediate": "0x8912" + "Immediate": "0x9cb8" }, "rhs": { "Deref": { @@ -2101,7 +2254,7 @@ { "TestLessThanOrEqual": { "lhs": { - "Immediate": "0xb766" + "Immediate": "0xcb0c" }, "rhs": { "Deref": { @@ -2467,7 +2620,7 @@ { "TestLessThanOrEqual": { "lhs": { - "Immediate": "0x7652" + "Immediate": "0x89f8" }, "rhs": { "Deref": { @@ -2549,7 +2702,7 @@ ] ], [ - 1017, + 1019, [ { "AllocSegment": { @@ -2562,7 +2715,7 @@ ] ], [ - 1020, + 1022, [ { "TestLessThan": { @@ -2584,7 +2737,7 @@ ] ], [ - 1024, + 1026, [ { "LinearSplit": { @@ -2613,7 +2766,7 @@ ] ], [ - 1034, + 1036, [ { "LinearSplit": { @@ -2642,14 +2795,14 @@ ] ], [ - 1056, + 1058, [ { "SystemCall": { "system": { "Deref": { "register": "AP", - "offset": -52 + "offset": -94 } } } @@ -2657,7 +2810,7 @@ ] ], [ - 1099, + 1101, [ { "AllocSegment": { @@ -2670,14 +2823,14 @@ ] ], [ - 1137, + 1139, [ { "SystemCall": { "system": { "Deref": { "register": "AP", - "offset": -52 + "offset": -94 } } } @@ -2685,7 +2838,20 @@ ] ], [ - 1181, + 1246, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 1262, [ { "AllocSegment": { @@ -2698,7 +2864,33 @@ ] ], [ - 1327, + 1278, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 1334, + [ + { + "AllocSegment": { + "dst": { + "register": "AP", + "offset": 0 + } + } + } + ] + ], + [ + 1480, [ { "TestLessThan": { @@ -2720,7 +2912,7 @@ ] ], [ - 1331, + 1484, [ { "LinearSplit": { @@ -2749,7 +2941,7 @@ ] ], [ - 1341, + 1494, [ { "LinearSplit": { @@ -2778,7 +2970,7 @@ ] ], [ - 1401, + 1554, [ { "AllocSegment": { @@ -2791,7 +2983,7 @@ ] ], [ - 1461, + 1614, [ { "SystemCall": { @@ -2806,7 +2998,7 @@ ] ], [ - 1507, + 1660, [ { "SystemCall": { @@ -2821,7 +3013,7 @@ ] ], [ - 1590, + 1743, [ { "TestLessThan": { @@ -2846,7 +3038,7 @@ ] ], [ - 1610, + 1763, [ { "AllocSegment": { @@ -2859,7 +3051,22 @@ ] ], [ - 1653, + 1805, + [ + { + "SystemCall": { + "system": { + "Deref": { + "register": "FP", + "offset": -3 + } + } + } + } + ] + ], + [ + 1849, [ { "TestLessThanOrEqual": { @@ -2881,7 +3088,7 @@ ] ], [ - 1736, + 1932, [ { "AllocSegment": { @@ -2892,21 +3099,6 @@ } } ] - ], - [ - 1760, - [ - { - "SystemCall": { - "system": { - "Deref": { - "register": "FP", - "offset": -3 - } - } - } - } - ] ] ], "entry_points_by_type": { @@ -2958,4 +3150,4 @@ } ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/src/transaction/test_utils.rs b/crates/blockifier/src/transaction/test_utils.rs index 015f87cea5..7509957e3d 100644 --- a/crates/blockifier/src/transaction/test_utils.rs +++ b/crates/blockifier/src/transaction/test_utils.rs @@ -43,6 +43,7 @@ pub const VALID: u64 = 0; pub const INVALID: u64 = 1; pub const CALL_CONTRACT: u64 = 2; pub const GET_BLOCK_HASH: u64 = 3; +pub const GET_EXECUTION_INFO: u64 = 4; macro_rules! impl_from_versioned_tx { ($(($specified_tx_type:ty, $enum_variant:ident)),*) => { diff --git a/crates/blockifier/src/transaction/transactions_test.rs b/crates/blockifier/src/transaction/transactions_test.rs index 084d83fdfa..bb52b1bd2b 100644 --- a/crates/blockifier/src/transaction/transactions_test.rs +++ b/crates/blockifier/src/transaction/transactions_test.rs @@ -58,7 +58,8 @@ use crate::test_utils::{ create_calldata, default_invoke_tx_args, test_erc20_account_balance_key, test_erc20_sequencer_balance_key, CairoVersion, NonceManager, SaltManager, ACCOUNT_CONTRACT_CAIRO1_PATH, BALANCE, CHAIN_ID_NAME, CURRENT_BLOCK_NUMBER, - CURRENT_BLOCK_TIMESTAMP, MAX_FEE, MAX_L1_GAS_AMOUNT, MAX_L1_GAS_PRICE, + CURRENT_BLOCK_NUMBER_FOR_VALIDATE, CURRENT_BLOCK_TIMESTAMP, + CURRENT_BLOCK_TIMESTAMP_FOR_VALIDATE, MAX_FEE, MAX_L1_GAS_AMOUNT, MAX_L1_GAS_PRICE, TEST_ACCOUNT_CONTRACT_ADDRESS, TEST_ACCOUNT_CONTRACT_CLASS_HASH, TEST_CLASS_HASH, TEST_CONTRACT_ADDRESS, TEST_CONTRACT_CAIRO0_PATH, TEST_CONTRACT_CAIRO1_PATH, TEST_SEQUENCER_ADDRESS, @@ -75,7 +76,7 @@ use crate::transaction::objects::{ use crate::transaction::test_utils::{ account_invoke_tx, calculate_class_info_for_testing, create_account_tx_for_validate_test, create_account_tx_test_state, l1_resource_bounds, FaultyAccountTxCreatorArgs, CALL_CONTRACT, - GET_BLOCK_HASH, INVALID, VALID, + GET_BLOCK_HASH, GET_EXECUTION_INFO, INVALID, VALID, }; use crate::transaction::transaction_types::TransactionType; use crate::transaction::transactions::{ExecutableTransaction, L1HandlerTransaction}; @@ -1420,7 +1421,6 @@ fn test_validate_accounts_tx( if let CairoVersion::Cairo1 = cairo_version { // Trying to use the syscall get_block_hash (forbidden). - // TODO(Arni, 12/12/2023): Test this scenario with the constructor. let account_tx = create_account_tx_for_validate_test( &mut NonceManager::default(), FaultyAccountTxCreatorArgs { @@ -1465,6 +1465,25 @@ fn test_validate_accounts_tx( ); account_tx.execute(state, block_context, true, true).unwrap(); } + + if let CairoVersion::Cairo1 = cairo_version { + let account_tx = create_account_tx_for_validate_test( + // Calling the syscall get_execution_info and get block_info which was modified for + // validate. + nonce_manager, + FaultyAccountTxCreatorArgs { + scenario: GET_EXECUTION_INFO, + contract_address_salt: salt_manager.next_salt(), + additional_data: Some(vec![ + StarkFelt::from(CURRENT_BLOCK_NUMBER_FOR_VALIDATE), + StarkFelt::from(CURRENT_BLOCK_TIMESTAMP_FOR_VALIDATE), + StarkFelt::from(0_u64), // Sequencer address for validate. + ]), + ..default_args + }, + ); + account_tx.execute(state, block_context, true, true).unwrap(); + } } #[rstest]