Skip to content

Change the order of account ID limbs in memory and advice stack #2422

@Fumuran

Description

@Fumuran

The general rule we have is that the prefix is at the most significant position, i.e. index 0 in a word on the stack or index 3 in a word in memory.

Therefore, for consistency, the memory layout should be:

[nonce, 0, account_id_suffix, account_id_prefix]

When we load it onto the stack (mem_loadw_be) it would then be:

[account_id_prefix, account_id_suffix, 0, nonce]

So, compared to what we have currently on the stack, prefix and suffix are swapped.

The in-memory order is the same as the advice input order, so this change should apply to the native account loading in the prologue and the foreign account loading in the advice inputs creation, as well as some other places like how we put the native asset ID onto the stack, etc.

Originally posted by @PhilippGackstatter in #2408 (comment)

Metadata

Metadata

Labels

kernelsRelated to transaction, batch, or block kernels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions