Functionality Infinite Private Money Trees - #26
Open
hooperben wants to merge 13 commits into
Open
Conversation
TomAFrench
reviewed
May 28, 2026
| fn assert_balanced(input_notes: [InputNote; NOTE_COUNT], output_notes: [OutputNote; NOTE_COUNT]) { | ||
| // Pass A: anchor on each non-empty input asset_id. | ||
| for i in 0..NOTE_COUNT { | ||
| if input_notes[i].asset_amount != 0 { |
There was a problem hiding this comment.
I don't think this if-statement is helpful. I would expect the following constraints to still hold if the condition were false so we're just multiplying in an extra predicate unnecessarily.
TomAFrench
reviewed
May 28, 2026
| // Pass B: anchor on each non-empty output asset_id. Catches | ||
| // assets that appear only on the output side (mint attempts). | ||
| for i in 0..NOTE_COUNT { | ||
| if output_notes[i].asset_amount != 0 { |
There was a problem hiding this comment.
ditto here, and you could simplify this to just assert that there is a note with a matching id in the inputs (as then the value equality has been asserted in the first pass).
TomAFrench
reviewed
May 28, 2026
Comment on lines
+127
to
+128
| in_sum += input_notes[j].asset_amount * in_match; | ||
| out_sum += output_notes[j].asset_amount * out_match; |
There was a problem hiding this comment.
Watch out for field overflows here. consider the inputs [0] and the outputs [1, p-1] which looks like it would pass this.
Owner
Author
There was a problem hiding this comment.
pretty certain this is addressed in the most recent commit. Really appreciate your review and time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new way of scaling commbank.eth's state tree - by adding the ability for n+1 tree's in the contracts state
the
stressdirectory is a test harness that runs simulations of commbank.eth's intended behaviour. In this case - it was to test that the scaling of these trees rolled over well when a tree filled. See stress/TEST_REPORT.md for full simulation behaviour report