-
Notifications
You must be signed in to change notification settings - Fork 1
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
Receipt Leaf Circuit #405
base: feat/receipt-trie
Are you sure you want to change the base?
Receipt Leaf Circuit #405
Changes from 1 commit
cb98991
0922676
82f304d
375beb5
6a2d2d8
ba702ee
bbf02b0
13d3cec
64b8c9f
fc59d4d
f4d4a4b
455290f
d644c70
04f6d13
5a2f7e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -631,7 +631,7 @@ where | |
let arrays: Vec<Array<T, RANDOM_ACCESS_SIZE>> = (0..padded_size) | ||
.map(|i| Array { | ||
arr: create_array(|j| { | ||
let index = 64 * i + j; | ||
let index = RANDOM_ACCESS_SIZE * i + j; | ||
if index < self.arr.len() { | ||
self.arr[index] | ||
} else { | ||
|
@@ -647,7 +647,7 @@ where | |
let less_than_check = less_than_unsafe(b, at, array_size, 12); | ||
let true_target = b._true(); | ||
b.connect(less_than_check.target, true_target.target); | ||
b.range_check(at, 12); | ||
|
||
let (low_bits, high_bits) = b.split_low_high(at, 6, 12); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry i'm a bit lost in this function. Can you write an example or just more doc about how you approach the decomposition and how you do the random access and the recombination at the end ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah sure thing |
||
|
||
// Search each of the smaller arrays for the target at `low_bits` | ||
|
@@ -1293,7 +1293,10 @@ mod test { | |
}; | ||
run_circuit::<F, D, C, _>(circuit); | ||
|
||
arr2[0] += 1; // ensure arr2 is different from arr | ||
arr2[0] = match arr2[0].checked_add(1) { | ||
Some(num) => num, | ||
None => arr2[0] - 1, | ||
}; | ||
let res = panic::catch_unwind(|| { | ||
let circuit = TestSliceEqual { | ||
arr, | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why unsafe is safe there ? Can you put that in a comment ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it was because on line 637 I range check
at
to be a 12-bit number anyway so it seemed pointless to do it twice.