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

variable resources #265

Merged
merged 12 commits into from
Sep 14, 2024
Merged

variable resources #265

merged 12 commits into from
Sep 14, 2024

Conversation

XuyangSong
Copy link
Collaborator

@XuyangSong XuyangSong commented Aug 23, 2024

The implementation of supporting a variable number of resources, close #263

  • Build a merkle tree from full leaves and get the path for the designated leave
  • Existence(merkle path) check circuit supporting variable depthes
  • Adjust resource logic APIs and the implementation
  • Adjust out of circuit checks in the partial transaction
  • Update tests
  • Update application examples
  • Update Taiga specs and README

@XuyangSong XuyangSong marked this pull request as ready for review August 28, 2024 09:05
Copy link
Contributor

@Acentelles Acentelles 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 to me!

taiga_halo2/examples/tx_examples/token_swap_with_intent.rs Outdated Show resolved Hide resolved
taiga_halo2/src/circuit/integrity.rs Show resolved Hide resolved
@@ -67,29 +69,27 @@ pub const RESOURCE_LOGIC_CIRCUIT_PUBLIC_INPUT_NUM: usize =
RESOURCE_LOGIC_CIRCUIT_MANDATORY_PUBLIC_INPUT_NUM
+ RESOURCE_LOGIC_CIRCUIT_CUSTOM_PUBLIC_INPUT_NUM
+ RESOURCE_LOGIC_CIRCUIT_RESOURCE_ENCRYPTION_PUBLIC_INPUT_NUM;
pub const RESOURCE_LOGIC_CIRCUIT_MANDATORY_PUBLIC_INPUT_NUM: usize = 9;
pub const RESOURCE_LOGIC_CIRCUIT_MANDATORY_PUBLIC_INPUT_NUM: usize = 6;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still want this RESOURCE_LOGIC_CIRCUIT_MANDATORY_PUBLIC_INPUT_NUM?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for RESOURCE_LOGIC_CIRCUIT_CUSTOM_PUBLIC_INPUT_NUM and RESOURCE_LOGIC_CIRCUIT_RESOURCE_ENCRYPTION_PUBLIC_INPUT_NUM

Copy link
Contributor

Choose a reason for hiding this comment

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

Are these now an upper bound instead of a mandatory strict number?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, we still need the mandatory strict number.
Variable resource number wouldn't affect the number of resource logic public inputs. Because only the root(one element) of the resources go to the public inputs.

taiga_halo2/src/resource_tree.rs Outdated Show resolved Hide resolved
@XuyangSong XuyangSong merged commit de70468 into main Sep 14, 2024
6 checks passed
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.

Memory(resources) sharing between compliance circuits and resource logic
2 participants