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
  • 4 core

4 core · Changes

Page history
feat: add exec state --story=1 authored Jul 12, 2024 by gzxu's avatar gzxu
Show whitespace changes
Inline Side-by-side
Showing with 9 additions and 0 deletions
+9 -0
  • zkevm-docs/4-core.markdown zkevm-docs/4-core.markdown +9 -0
  • No files found.
zkevm-docs/4-core.markdown
View page @ 895569b4
......@@ -265,6 +265,15 @@ pub(crate) trait ExecutionGadget<
![image.png](/uploads/2/088B5A7969A744E7850B04351472A9F1/image.png)
如图中所示,最外层是 BEGIN_CHUNK 和 END_CHUNK 的gadget,约束 chunk 相关的数据项,比如区块数量。BEGIN_CHUNK 会进入 BEGIN_BLOCK 。
往内一层是 BEGIN_BLOCK 和 END_BLOCK 的gadget,约束当前区块,比如区块内交易、log 数量。对于BEGIN_BLOCK,如果区块内不存在交易,则 BEGIN_BLOCK -> END_BLOCK 结束当前区块;否则 BEGIN_BLOCK->BEGIN_TX进入交易的执行状态。对于END_BLOCK,如果当前不是最后的区块,则 END_BLOCK -> BEGIN_BLOCK; 否则结束区块的执行状态 END_BLOCK -> END_CHUNK。
再往内一层是 BEGIN_TX 和 END_TX 的gadget,约束当前交易。转换和block类似不再赘述。
最里面一层是交易内的普通状态,转换过程和solidity的调用类似,遇到RETURN/REVERT、STOP 则进入END_CALL返回父函数;如果当前已经是最顶层的函数,那么就结束交易。(通过call_id是否等于0来判断当前是否结束交易)
## 执行状态的转换约束
某些执行状态之前或之后,需要约束为某个特定的执行状态,比如 end\_block,需要约束之前执行状态是END\_TX或BEGIN\_BLOCK,约束之后执行状态是 BEGIN\_BLOCK 或END\_CHUNK。
......
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号