Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
zkevm-circuits
zkevm-circuits
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

  • zkp
  • zkevm-circuitszkevm-circuits
  • Wiki
    • Zkevm docs
  • 6 bytecode

6 bytecode · Changes

Page history
chore: update bytecode doc authored Jan 03, 2024 by qingyun Ma's avatar qingyun Ma
Hide whitespace changes
Inline Side-by-side
Showing with 8 additions and 61 deletions
+8 -61
  • zkevm-docs/6-bytecode.markdown zkevm-docs/6-bytecode.markdown +8 -61
  • No files found.
zkevm-docs/6-bytecode.markdown
View page @ 340bc77e
......@@ -184,72 +184,17 @@ addr unchange && addr != 0 ----> pc_cur - pc_prev = 1 (同一个合约中pc是
**todo:**
区分Opcode(非PUSH)、Opcode(PUSH)、Push的Byte:
总结:
​ cnt_prev=0 && cnt_cur !=0 ----> OPCODE(PUSH)
Opcode(非PUSH): cnt!=0 -----> cnt!=0的约束
​ cnt_prev=0 && cnt_cur =0 && addr != 0 ---> OPCODE(非PUSH)
Opcode(PUSH): cnt、is_high、acc_hi、acc_lo、value_hi、value_lo值都为0 (该约束缺少)
​ addr = 0 ----> Padding row
Addr=0, 所有值都为0
​ cnt_prev != 0 && cnt_cur != 0 ------> PUSH的byte(非push的最后一个字节)
怎么区分Opcode是否为PUSH指令(IsZeroConfig?? 但是PUSH指令有12个,PUSH1~PUSH32)
当cnt != 0时
当前的value_lo等于Rotation(cur_cnt)的value_lo,value_hi也是同理,即value_lo和value_hi应等于最终计算出的value_lo、value_hi(PUSH的最后一个byte)
当cnt_prev=0时
​ padding的行由addr=0来约束,所有值都为0
​ Bytecode是Opcode而不是PUSH的byte
当cnt_prev!=0时
​ 当前行一定为PUSH指令所PUSH的字节
当cnt==0时
​ Opcode(PUSH): cnt为0
​ PUSH的最后一个byte的cnt_prev-cnt_cur=1 (怎么区分是PUSH的byte而不是Opcode)
怎么区分Opcode是否为PUSH指令(IsZeroConfig?? 但是PUSH指令有12个,PUSH1~PUSH32)
怎么区分是PUSH的byte而不是Opcode
is_code? ----> 如果是opcode===>is_code=1, 如果不是opcode===>is_code=0
is_push? ---->如果是push===>is_push=1, 如果不是is_push===>is_push=0
Tag? ----> Nil,OPCODE_NOPUSH, OPCODE_PUSH, BYTE
或者如下:
cnt_prev=0 && cnt_cur !=0 ----> OPCODE(PUSH)
cnt_prev=0 && cnt_cur =0 && addr != 0 ---> OPCODE(非PUSH)
addr = 0 ----> Padding row
cnt_prev != 0 && cnt_cur != 0 ------> PUSH的byte(非push的最后一个字节)
cnt_prev != 0 && cnt_cur == 0 -------> PUSH的最后一个字节
问题:
PUSH指令中的的 value_lo和value_hi都是PUSH的最后一个byte时所得到的
​
​ cnt_prev != 0 && cnt_cur == 0 -------> PUSH的最后一个字节
......@@ -257,3 +202,5 @@ PUSH指令中的的 value_lo和value_hi都是PUSH的最后一个byte时所得到
每一个byte都应该在fixed电路中Lookup到,即每一个字节大小都应该在0~255范围内
Lookup Fixed table, 约束Bytecode是否为正确的Opcode
Clone repository
  • basics
    • evm
    • halo2
  • code notes
    • binary_number_with_real_selector
    • how to use macro
    • simple_lt
    • simple_lt_word
  • Home
  • image
  • zkevm docs
    • 1 introduction
    • 10 public
    • 11 fixed
    • 12 exp
    • 13 keccak
    • 14 comparisons
    • 15 differences
View All Pages

Copyright © 2024 ChainWeaver Org. All Rights Reserved. 版权所有。

京ICP备2023035722号-3

京公网安备 11010802044225号