-
Notifications
You must be signed in to change notification settings - Fork 80
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 witgen for bus accumulators #1628
Conversation
let alpha = from_base(challenge(0, 1)); | ||
let beta = from_base(challenge(0, 2)); | ||
|
||
let is_first: col = std::well_known::is_first; | ||
col witness stage(1) acc; | ||
|
||
bus_receive(is_first, ARITH_INTERACTION_ID, [0, x, y, z], latch, [acc], alpha, beta); | ||
bus_send(is_first, ARITH_INTERACTION_ID, [0, x, y, z], instr_add, [acc], alpha, beta); |
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.
These (and the changes below) were bugs.
acc1' = acc1_next; | ||
acc2' = acc2_next; | ||
|
||
// TODO: Expose final value of acc as public. |
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.
open issue?
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.
This needs to be done all over the place (we have the same TODO many times) and is tracked in #1499.
Co-authored-by: Leo <[email protected]>
Fixes #1604
With this PR, we bypass machine detection during witness generation of stages > 0. See this comment for a motivation.
This currently needs to be tested manually, as follows:
Computing
main.acc1 + main_arith.acc1
andmain.acc2 + main_arith.acc2
both yields21888242871839275222246405745257275088548364400416034343698204186575808495617
, which is the BN254 scalar field prime! In other words, the partial accumulators sum to 0.