Skip to content

Commit

Permalink
optimization: MPT verify hardcode key_pow2 64 nibbles
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagofneto committed Oct 31, 2023
1 parent 97aad21 commit e56d6cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/data_structures/eth_mpt.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ impl MPTImpl of MPTTrait {
) -> Result<Words64, felt252> {
let mut current_hash = *self.root;
let mut proof_index: usize = 0;
let mut key_pow2: u256 = pow(2, (key_len.into() - 1) * 4);
let mut key_pow2: u256 = if key_len == 64 {
0x1000000000000000000000000000000000000000000000000000000000000000
} else {
pow(2, (key_len.into() - 1) * 4)
};

let proof_len = proof.len();

Expand Down

0 comments on commit e56d6cf

Please sign in to comment.