... | ... | @@ -30,7 +30,7 @@ flowchart LR |
|
|
|
|
|
主要约束及状态变化
|
|
|
|
|
|
![image.png](/uploads/2/B684BD2BF40B4C4980E9866D3F7ADA9C/image.png)
|
|
|
![image.png](/uploads/2/64EF98D7F40D429E87C2F64F206269E5/image.png)
|
|
|
|
|
|
|
|
|
## 具体Gadget设计
|
... | ... | @@ -39,11 +39,11 @@ flowchart LR |
|
|
|
|
|
主要约束:
|
|
|
- state_stamp = pre + 2
|
|
|
- log_stamp = pre + 1
|
|
|
- log_stamp = pre
|
|
|
- next_pc = pc
|
|
|
|
|
|
gen_witness状态变化
|
|
|
- log_stamp += 1
|
|
|
- 无
|
|
|
|
|
|
|
|
|
|cnt| | | | |
|
... | ... | @@ -91,11 +91,12 @@ gen_witness状态变化 |
|
|
|
|
|
主要约束:
|
|
|
- state_stamp = pre
|
|
|
- log_stamp = pre
|
|
|
- log_stamp = pre + (1 * topic_left_0)
|
|
|
- next_pc = pc + (1 * topic_left_0)
|
|
|
|
|
|
gen_witness状态变化
|
|
|
- 根据opcode 初始化state.topic_left
|
|
|
- 根据opcode初始化state.topic_left
|
|
|
- state.topic_left==0时 log_stamp += 1
|
|
|
|
|
|
|
|
|
|cnt| | | | |
|
... | ... | @@ -122,11 +123,12 @@ gen_witness状态变化 |
|
|
### LogTopicGadget设计
|
|
|
主要约束:
|
|
|
- state_stamp = pre
|
|
|
- log_stamp = pre
|
|
|
- log_stamp = pre + (1 * topic_left_0)
|
|
|
- next_pc = pc + (1 * topic_left_0)
|
|
|
|
|
|
gen_witness状态变化
|
|
|
- state.topic_left-=1
|
|
|
- state.topic_left -= 1
|
|
|
- state.topic_left==0时 log_stamp += 1
|
|
|
|
|
|
|cnt| | | | |
|
|
|
|---|-------|-------|---------|---------|
|
... | ... | |