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 04, 2024 by qingyun Ma's avatar qingyun Ma
Hide whitespace changes
Inline Side-by-side
Showing with 8 additions and 4 deletions
+8 -4
  • zkevm-docs/6-bytecode.markdown zkevm-docs/6-bytecode.markdown +8 -4
  • No files found.
zkevm-docs/6-bytecode.markdown
View page @ 3b33c5ae
...@@ -158,15 +158,19 @@ cnt !=0 的情况只有一种,PUSH指令所PUSH的byte(非最后一个byte), ...@@ -158,15 +158,19 @@ cnt !=0 的情况只有一种,PUSH指令所PUSH的byte(非最后一个byte),
cnt !=0 ----> `cnt_prev - cnt_cur = 1 `(约束cnt) cnt !=0 ----> `cnt_prev - cnt_cur = 1 `(约束cnt)
cnt !=0 ----> `acc_hi_prev + is_high*(acc_hi_prev*255 + bytecode) - acc_hi_cur =0`(约束acc_hi) **cnt_prev != 0**
cnt_prev != 0说明当前行为PUSH指令PUSH的byte
cnt_prev !=0 -----> `is_high_prev - is_heigh_cur - cnt_is_15 = 0` (用于约束cnt=15和cat=16的分界线的cnt, 当cnt=15时, cnt_is_15=1,因为cnt>=16时is_high=1, cnt<16时is_high=0, 所以cnt_is_16_is_high - cnt_is_15_is_high =1)
cnt_prev !=0 ----> `acc_hi_prev + is_high*(acc_hi_prev*255 + bytecode) - acc_hi_cur =0`(约束acc_hi)
​ cnt !=0 && is_high=0 ----> `acc_hi_cur-acc_hi_prev=0` (cnt < 16的行,acc_hi的值是不变的) ​ cnt !=0 && is_high=0 ----> `acc_hi_cur-acc_hi_prev=0` (cnt < 16的行,acc_hi的值是不变的)
​ cnt !=0 && is_high=1 ----> `acc_hi_prev + (acc_hi_prev*255 + bytecode) - acc_hi_cur =0=0` (即acc_hi_cur的值为`acc_pre*256+bytecoce`) ​ cnt !=0 && is_high=1 ----> `acc_hi_prev + (acc_hi_prev*255 + bytecode) - acc_hi_cur =0=0` (即acc_hi_cur的值为`acc_pre*256+bytecoce`)
cnt !=0 ----> `acc_lo_cur - acc_lo_prev - (1-is_high) *(acc_lo_prev*255 + bytecode)=0` (约束acc_lo,当cnt < 16, 即high=0时,acc_lo_cur=acc_lo_prev*256 + bytecode) cnt_prev !=0 ----> `acc_lo_cur - acc_lo_prev - (1-is_high) *(acc_lo_prev*255 + bytecode)=0` (约束acc_lo,当cnt < 16, 即high=0时,acc_lo_cur=acc_lo_prev*256 + bytecode)
cnt !=0 -----> `is_high_prev - is_heigh_cur - cnt_is_15 = 0` (用于约束cnt=15和cat=16的分界线的cnt, 当cnt=15时, cnt_is_15=1,因为cnt>=16时is_high=1, cnt<16时is_high=0, 所以cnt_is_16_is_high - cnt_is_15_is_high =1)
......
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号