Skip to content
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

Fix issue 600 #707

Merged
merged 2 commits into from
May 31, 2024
Merged

Fix issue 600 #707

merged 2 commits into from
May 31, 2024

Conversation

hackaugusto
Copy link
Contributor

@hackaugusto hackaugusto commented May 27, 2024

fixes #600

  • Removes the inputs length from the NULLIFIER_COMMITMENT, since now it is available in the INPUTS_HASH
  • Removes the difference among consumed/created notes' inputs, now both encode the inputs prefixed by its length and padded to an even number of words
  • Add the length as the first element to the INPUTS_HASH
  • Update some of the documentation which was out of date

@hackaugusto hackaugusto requested a review from bobbinth May 27, 2024 11:36
#!
#! Stack: [BH, acct_id, IAH, NC]
#! Advice stack: [NR, PH, CR, SR, BR, PH, BN,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was out-of-date, the NOTE_ROOT is much deeper in the advice stack:

#! Advice stack: [
#! PREVIOUS_BLOCK_HASH,
#! CHAIN_MMR_HASH,
#! ACCOUNT_ROOT,
#! NULLIFIER_ROOT,
#! BATCH_ROOT,
#! PROOF_HASH,
#! [block_num, version, timestamp, 0],
#! ZERO,
#! NOTE_ROOT,
#! [account_id, 0, 0, account_nonce],
#! ACCOUNT_VAULT_ROOT,
#! ACCOUNT_STORAGE_ROOT,
#! ACCOUNT_CODE_ROOT,
#! number_of_input_notes,
#! TX_SCRIPT_ROOT,

Instead of copying and pasting the docs, I added a reference to prepare_transaction

#!
#! - consumed_note_ptr is the memory address at which the consumed note data begins.
#! - num_inputs is the number of inputs defined for the consumed note.
export.get_consumed_note_num_inputs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The num_inputs is now defined in the advice map, these are no longer needed

exec.note::increment_current_consumed_note_ptr
loc_load.0
neq
# => [current_consumed_note_ptr]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I think these APIs should change to pass an explict idx, it would make testing possible.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left some comments inline - most of these are pretty small.

@hackaugusto hackaugusto requested a review from bobbinth May 29, 2024 12:46
@hackaugusto hackaugusto dismissed bobbinth’s stale review May 29, 2024 12:46

applied requested changes, please re-review

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left a couple more minor comments inline. After these are resolved, we can merge.

@bobbinth
Copy link
Contributor

Oh - and let's update changelog.

@hackaugusto
Copy link
Contributor Author

Oh - and let's update changelog.

Added

@hackaugusto hackaugusto force-pushed the hacka-issue-600 branch 5 times, most recently from e9c8ea0 to bcf8167 Compare May 31, 2024 11:20
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good! Thank you!

@bobbinth bobbinth merged commit 0206e21 into next May 31, 2024
9 checks passed
@bobbinth bobbinth deleted the hacka-issue-600 branch May 31, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants