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 code example for codecopy --story=1 authored Jul 11, 2024 by gzxu's avatar gzxu
Hide whitespace changes
Inline Side-by-side
Showing with 31 additions and 1 deletion
+31 -1
  • zkevm-docs/4-core.markdown zkevm-docs/4-core.markdown +31 -1
  • No files found.
zkevm-docs/4-core.markdown
View page @ d3a50a98
......@@ -260,4 +260,34 @@ pub(crate) trait ExecutionGadget<
```
代码:https://git.code.tencent.com/chainmaker-zk/zkevm/blob/develop/zkevm-circuits/src/execution/add.rs
# 执行状态的转换流程
\ No newline at end of file
# 执行状态的转换流程
某些执行状态之前或之后,需要约束为某个特定的执行状态,比如 end\_block,需要约束之前执行状态是END\_TX或BEGIN\_BLOCK,约束之后执行状态是 BEGIN\_BLOCK 或END\_CHUNK。
constraints.append(&mut config.get_exec_state_constraints(
meta,
ExecStateTransition::new(
// 之前的执行状态约束,没有cond,表示两种执行状态都可以。
vec![ExecutionState::END_TX, ExecutionState::BEGIN_BLOCK],
// 当前 gadget 的 NUM_ROW
NUM_ROW,
// 之后的执行状态约束
vec![
// 如果 next_is_begin_block == 1,下个执行状态是 BEGIN_BLOCK
(
ExecutionState::BEGIN_BLOCK,
begin_block::NUM_ROW,
Some(next_is_begin_block), // 这里为了减少 degree
),
// 如果 next_is_end_chunk == 1,下个执行状态是 END_CHUNK
(
ExecutionState::END_CHUNK,
end_chunk::NUM_ROW,
Some(next_is_end_chunk), // 这里为了减少 degree
),
],
// 和 next_is_begin_block, next_is_end_chunk 作用一样
// vec 内不为0的,对应之后的执行状态
Some(vec![1.expr() - is_zero.expr(), is_zero.expr()]),
),
));
\ No newline at end of file
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号