Skip to content

Commit

Permalink
chore: cleanup hint
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdud007 committed May 28, 2024
1 parent 2be5277 commit f004ed9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/mpt.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func verify_mpt_proof_inner{
pow2_array: felt*,
) -> (value: felt*, value_len: felt) {
alloc_locals;
%{ print(f"\n\nNode index {ids.node_index+1}/{ids.mpt_proof_len} \n \t {ids.n_nibbles_already_checked=}") %}
// %{ print(f"\n\nNode index {ids.node_index+1}/{ids.mpt_proof_len} \n \t {ids.n_nibbles_already_checked=}") %}
if (node_index == mpt_proof_len - 1) {
// Last node : item of interest is the value.
// Check that the hash of the last node is the expected one.
Expand Down
22 changes: 11 additions & 11 deletions lib/rlp_little.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -249,25 +249,25 @@ func assert_subset_in_key_be{range_check_ptr, bitwise_ptr: BitwiseBuiltin*}(

// Get the little endian 256 bit number from the extracted 64 bit le words array :
let key_subset_256_le = key_subset_to_uint256(key_subset, key_subset_len);
%{
key_subset_256_le = hex(ids.key_subset_256_le.low + ids.key_subset_256_le.high*2**128)[2:]
print(f"Key subset 256 le: {key_subset_256_le}")
%}
// %{
// key_subset_256_le = hex(ids.key_subset_256_le.low + ids.key_subset_256_le.high*2**128)[2:]
// print(f"Key subset 256 le: {key_subset_256_le}")
// %}
let (key_subset_be_tmp: Uint256, n_bytes: felt) = uint256_reverse_endian_no_padding(
key_subset_256_le, pow2_array
);
%{
orig_key = hex(ids.key_be.low + ids.key_be.high*2**128)[2:]
key_subset = hex(ids.key_subset_be_tmp.low + ids.key_subset_be_tmp.high*2**128)[2:]
print(f"Orig key: {orig_key}, n_nibbles={len(orig_key)}")
print(f"Key subset: {key_subset}, n_nibbles={len(key_subset)}")
%}
// %{
// orig_key = hex(ids.key_be.low + ids.key_be.high*2**128)[2:]
// key_subset = hex(ids.key_subset_be_tmp.low + ids.key_subset_be_tmp.high*2**128)[2:]
// print(f"Orig key: {orig_key}, n_nibbles={len(orig_key)}")
// print(f"Key subset: {key_subset}, n_nibbles={len(key_subset)}")
// %}

// Cut nibble of the key subset if needed from the leftmost position. 0x123 -> 0x23
local key_subset_be: Uint256;
local bitwise_ptr_f: BitwiseBuiltin*;
if (cut_nibble != 0) {
%{ print(f"Cut nibble") %}
// %{ print(f"Cut nibble") %}
if (key_subset_be_tmp.high != 0) {
let (_, key_susbet_be_high) = bitwise_divmod(
key_subset_be_tmp.high, pow2_array[8 * (n_bytes - 16) - 4]
Expand Down

0 comments on commit f004ed9

Please sign in to comment.