-
Notifications
You must be signed in to change notification settings - Fork 125
Conversation
Signed-off-by: smtmfft <smtmfft@taikocha.in>
Signed-off-by: smtmfft <smtm@taiko.xzy>
dbff513
to
2376ae7
Compare
b2d67f6
to
781e358
Compare
Signed-off-by: smtmfft <smtm@taiko.xzy>
let bytecodes_len: u32 = var("BTYECODES_LEN") | ||
.unwrap_or_else(|_| "1".to_string()) | ||
.parse() | ||
.expect("Cannot parse BTYECODES_LEN env var as u32"); |
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.
Not sure I understand the purpose of this.
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.
bytecode_circuit absorbs bytecode array, i.e., 1 or N bytecodes. To make a full data table, we can either use 1 large bytecode or N small bytecode to fill up the 2^k rows. This variable is created for these 2 cases, although they actually makes little difference.
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
if bytecodes_num == 0 { | ||
vec![] | ||
} else { | ||
assert!(bytecode_len >= 1); | ||
(0..bytecodes_num * bytecode_len) | ||
.collect::<Vec<usize>>() | ||
.chunks(bytecode_len) | ||
.map(|idx_range| { |
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.
Simple for
loop makes ,more sense here? Because you do bytecodes_num * bytecode_len
and then create chunks of bytecode_len
, so may as well just use some loops?
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.
Yes, only diff is the value sequence, changed to for_each loop and make the fillup logic simpler.
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
To resolve privacy-scaling-explorations#666
Reuse BytecodeCircuitTester to avoid more dup code.