... | ... | @@ -282,41 +282,10 @@ fn gen_witness(&self, trace: &GethExecStep, current_state: &mut WitnessExecHelpe |
|
|
|
|
|
#### get_lookups
|
|
|
|
|
|
从core row, cnt=1,vers[24]~vers[31]的位置获取值,去向为Bytecode进行lookup, 这里使用的LookUp类型为`LookupEntry::BytecodeFull`
|
|
|
除了state lookup 外,
|
|
|
|
|
|
```rust
|
|
|
fn get_lookups(
|
|
|
&self,
|
|
|
config: &ExecutionConfig<F, NUM_STATE_HI_COL, NUM_STATE_LO_COL>,
|
|
|
meta: &mut ConstraintSystem<F>,
|
|
|
) -> Vec<(String, LookupEntry<F>)> {
|
|
|
let stack_lookup = query_expression(meta, |meta| config.get_state_lookup(meta, 0));
|
|
|
let bytecode_loopup = query_expression(meta, |meta| config.get_bytecode_full_lookup(meta));
|
|
|
vec![
|
|
|
("jump_lookup_stack".into(), stack_lookup),
|
|
|
("jump_lookup_bytecode".into(), bytecode_loopup),
|
|
|
]
|
|
|
}
|
|
|
pub(crate) fn get_bytecode_full_lookup(&self, meta: &mut VirtualCells<F>) -> LookupEntry<F> {
|
|
|
let (addr, pc, opcode, not_code, value_hi, value_lo, cnt, is_push) = (
|
|
|
meta.query_advice(self.vers[24], Rotation::prev()),
|
|
|
meta.query_advice(self.vers[25], Rotation::prev()),
|
|
|
meta.query_advice(self.vers[26], Rotation::prev()),
|
|
|
meta.query_advice(self.vers[27], Rotation::prev()),
|
|
|
meta.query_advice(self.vers[28], Rotation::prev()),
|
|
|
meta.query_advice(self.vers[29], Rotation::prev()),
|
|
|
meta.query_advice(self.vers[30], Rotation::prev()),
|
|
|
meta.query_advice(self.vers[31], Rotation::prev()),
|
|
|
);
|
|
|
LookupEntry::BytecodeFull {
|
|
|
addr,
|
|
|
pc,
|
|
|
opcode,
|
|
|
not_code,
|
|
|
value_hi,
|
|
|
value_lo,
|
|
|
cnt,
|
|
|
is_push,
|
|
|
}
|
|
|
}
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
- [5-state.markdown](../5-state)
|
|
|
|
|
|
需要从core row, cnt=1,vers[24]~vers[31]的位置获取值,去向为Bytecode进行lookup, 这里使用的LookUp类型为`LookupEntry::BytecodeFull`
|
|
|
|
|
|
- [6-bytecode](zkevm-docs/6-bytecode.markdown) |
|
|
\ No newline at end of file |