-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: incorrect nonce value #499
Comments
I am having a similar issue. Not located on the #[external(v0)]
fn test_get_execution_info(
self: @ContractState,
expected_block_info: BlockInfo,
expected_tx_info: TxInfo,
// Expected call info.
expected_caller_address: felt252,
expected_contract_address: felt252,
expected_entry_point_selector: felt252,
) {
let execution_info = starknet::get_execution_info().unbox();
let block_info = execution_info.block_info.unbox();
assert(block_info == expected_block_info, 'BLOCK_INFO_MISMATCH');
let tx_info = execution_info.tx_info.unbox();
assert(tx_info.version == expected_tx_info.version, 'VERSION_MISMATCH');
// This one is failing
assert(tx_info.account_contract_address == expected_tx_info.account_contract_address, 'ACC_CTRCT_ADRR_MISMATCH');
// Every other field after this is correct
... The Please find the full test code here |
It seems the issue is related to the array rewrite. Basically the Starknet glue code is still using the old arrays and therefore the offsets are all wrong after an array is found in the struct. I'm working on it. |
That PR is mostly ready: there's only a test that is failing and I'm not sure why but I'll probably fix it in a different PR. |
@azteca1998 just tried but it seems like I am not getting an error with the signature. Still taking the first example, running let signature = tx_info.signature;
(*signature.at(0)).print(); Seems to make the VM error out. Maybe it's important to note that my signature's length is 5. By the way I made a PR here to add Kakarot to SiR so that might help you with the debugging. |
Well, this is embarassing. I accidentally made it so that when converting arrays to the internal representation, the start offset is always |
I am sending a transaction to a contract which tries to get the nonce of the sender via the transaction info syscall. The below is the cairo 1 snippet I am running (with the link to the full code here):
However, printing the
tx_info.nonce
value gets me a0x1139045e000000000000000000000000000000000
instead of0x0
. I tried tracing the nonce value all the way to thewrap_get_execution_info_v2
and it seems the value was still correct. Couldn't figure out at what point the nonce gets set to this incorrect value.The text was updated successfully, but these errors were encountered: