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

chore: prover rename leaf index next index #851

Merged
merged 9 commits into from
Jun 25, 2024

Conversation

ananas-block
Copy link
Contributor

@ananas-block ananas-block commented Jun 22, 2024

builds on #850
changes:

  • rename leafIndex to nextIndex (nextIndex is the naming we use in indexed array)
  • rename files in merkle-tree dir
    • test_tree.go -> merkle_tree.go
    • tree_test.go -> gen_test_data.go
  • isLess limits the bitsize to 248 bit equivalent to truncated addresses of 31 bytes
    • our highest indexed array value FIELD_SIZE - 1 is too great now to work with the circuit, HIGHEST_ADDRESS_PLUS_ONE is 2^248 -1the highest 248 bit value. The highest address must be less than HIGHEST_ADDRESS_PLUS_ONE hence the name plus one.
  • regenerated proving keys
  • add leaf hash gadget unit test

@ananas-block ananas-block force-pushed the jorrit/chore-prover-rename-leaf-index-next-index branch 2 times, most recently from 415349c to 4b046e0 Compare June 22, 2024 17:34
@ananas-block ananas-block force-pushed the jorrit/chore-prover-rename-leaf-index-next-index branch from 4b046e0 to 982aa9c Compare June 23, 2024 21:58
@ananas-block ananas-block force-pushed the jorrit/chore-prover-rename-leaf-index-next-index branch from 4897f1f to 744e511 Compare June 24, 2024 22:38
@ananas-block ananas-block force-pushed the jorrit/chore-prover-rename-leaf-index-next-index branch from 744e511 to 0c7f6f5 Compare June 24, 2024 22:49
sergeytimoshin and others added 5 commits June 25, 2024 00:22
The commit updates variables and parameters names in the light-prover, changing from camelCase to snake_case for better readability and consistency. This includes updates in the scripts `generate_keys.sh` and `main.go`. Changes have been made in flags like `compressedAccounts` to `compressed-accounts` and array names like `compressedAccounts_arr` to `compressed_accounts_arr`.
Copy link
Contributor

@vadorovsky vadorovsky 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, just one question

pub const FIELD_SIZE_SUB_ONE: &str =
"21888242871839275222246405745257275088548364400416034343698204186575808495616";
pub const HIGHEST_ADDRESS_PLUS_ONE: &str =
"452312848583266388373324160190187140051835877600158453279131187530910662655";
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this value stand for now? It seems lower than the Fr field size limit. Is it intentional to reduce the available range of addresses?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • isLess limits the bitsize to 248 bit equivalent to truncated addresses of 31 bytes
    • our highest indexed array value FIELD_SIZE - 1 is too great now to work with the circuit, HIGHEST_ADDRESS_PLUS_ONE is 2^248 -1the highest 248 bit value. The highest address must be less than HIGHEST_ADDRESS_PLUS_ONE hence the name plus one.

@ananas-block ananas-block merged commit 338e474 into main Jun 25, 2024
15 checks passed
@ananas-block ananas-block deleted the jorrit/chore-prover-rename-leaf-index-next-index branch June 25, 2024 16:56
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.

3 participants