feat: optimize layouts and procedures for little-endian#2512
Open
PhilippGackstatter wants to merge 10 commits intopgackst-bele-migrationfrom
Open
feat: optimize layouts and procedures for little-endian#2512PhilippGackstatter wants to merge 10 commits intopgackst-bele-migrationfrom
PhilippGackstatter wants to merge 10 commits intopgackst-bele-migrationfrom
Conversation
188e9ae to
575c8b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Broken out of #2508 to reduce diff size. This PR optimizes a few things for the new little-endian-based word layout:
auth::adv_insert_hqwordin favor ofadv.insert_hqword.$kernel::account::is_slot_id_ltfor the new little-endian stack layout by running suffix comparison first.account_id::validatefor the new little-endian stack layout by running suffix validation first.[digest0, digest1, digest2, digest3]now definessuffix = digest0(+ shaping) andprefix = digest1.push.SLOT_NAME[0..2]which pushes the first two elements in little-endian order.AccountId::try_from([prefix, suffix])withAccountId::try_from_elements(suffix, prefix)which is better than the[Felt; 2]API that has unnamed fields (and used the "wrong" order). Fixes the order to besuffix, prefix. This is now finally consistent with the APIs ofAssetIdandStorageSlotId(the other "half-word types").RATE0, RATE1, CAPACITYas the hasher layout.Signature,AuthScheme,AuthSecretKeytoFalcon512Poseidon2.