当前位置:网站首页>Polygon zkEVM network node
Polygon zkEVM network node
2022-08-04 03:04:00 【mutourend】
1. 引言
前序博客有:
Polygon zkEVMNetwork node code to see:
1.1 Polygon zkEVM 关键词
Polygon zkEVMIn a network of key words there:
- 1)L1:是指rollup合约部署的base链——For the etheric fang provids or testing,Also can be for anyEVM兼容链.
- 2)L2:为rollup网络,即Polygon zkEVM网络.
- 3)Batch:As a set of usezkEVM proverTo perform or certificate of trade,会将batch发送到L1,也会从L1同步batch.
- 4)Sequencer:该角色负责:选择交易,将交易排序,Packaged deal forbatch发送到L1.
- 5)Trusted sequencer:L2There can be only onetrusted sequencer,Trusted sequencer具有特殊权限——Predictable will be submitted toL1的batches,Which can be in withL1交互之前,commit to a specific sequence(见后面 “7)Sequence” 解释).这样可实现fast finality,And reduce the cost(降低gas费).
- 6)Permissionless sequencer:Can be held by anybodysequencer角色.相比于trusted sequencer,permissionless sequencerCompetitive disadvantage(如slow finality,MEV攻击).The main purpose is to providecensorship resistance和网络的unstoppability特性.
- 7)Sequence:由trusted sequencer发送到L1以更新state的数据称为sequence,其包含了batches和其它metadata.
- 8)Force batch:由permissionless sequencers发送到L1以更新state的数据,仅包含了batch.
- 9)L2 Block:与L1 block类似,但是为L2的.大多由JSON RPC接口使用.当前,所有的L2 BlocksAll set to contain only a deal,The aim is to achieveinstant finality;不需要close a batch,以支持JSON RPC exposeHas been the result of the processing trade.
- 10)Trusted state:是指对 由trusted sequencer Share to deal Processing ofstate.This state is considered to be credible,因为trusted sequencer可commit to a certain sequence,然后send a different one to L1.
- 11)Virtual State:是指对 已提交到L1的交易 Processed by a state.These deals have bytrusted或permissionless sequencer打包在batches发送到了L1.这些batches也可称为virtual batches.注意,该state是trustless的,因为其依赖于L1The safety of the assumptions.
- 12)Consolidated stateStrengthening state:已提交a ZKP(Zero Knowledge Proof)In the chain to justifying thethe execution of a sequence of the last virtual batch To achieve the state of the.
- 13)Invalid transaction无效交易:Refers to the trading can't handle,Invalid transactions would not affect state.注意,Invalid transaction can be included in thevirtual batch内.Trading invalid reason can be associated with the etheric fang agreement,如invalid nonce、balance不足等;Also may be due tozkEVM引入的限制,如每隔batch可利用的资源有限,Therefore can be calculatedkeccakHash total co.
- 14)Reverted transaction:The deal has to perform,但是(Because of intelligent logic contract)被reverted了.revertedDeal with the difference between invalid transaction,reverted交易会改变状态——At least can increasesender的nonce值.
- 15)Proof of Efficiency(PoE):为Polygon zkEVM的共识协议,由智能合约强化.
2. Polygon zkEVM网络总体架构

The above said is bytrusted sequencerOperation of a single node architecture diagram.In the actual network will have multiple roles the node,Details of subsequent add.
The above architecture diagram:
1)(JSON)RPC:为用户(如metamask、etherscan等)And node interaction interface.与以太坊RPC完全兼容,And attached some additional port.如与
stateInteractive data interface can be obtained;Processing trade interface;与poolInteractive store trading interface.2)Pool:通过
RPCTo store the dealDB,poolStored in trading the follow-up can be made ofsequencerTo select or discarded.3)Trusted Sequencer:从
poolGet the trade,使用stateFor transaction processing to check whether the deal is effective,创建sequences.Once the deal is added to thestate中,Can right awaybroadcast服务可用.sequences可通过etherman发送到L1.4)Broadcast:由非
trusted sequencerRunning in the nodesynchronizer使用的API,用于同步trusted state.5)Permissionless Sequencer:待续....
6)Etherman:对 Want associated with the etheric fang network and contract Interactive method of abstract.
7)Synchronizer:通过
ethermanGet data from the etheric fang updatestate(为virtual state 或 consolidated state).If the node is nottrusted sequencer,还会从trusted sequencer的broadcast获取数据并更新state(为trusted state).同时synchronizerAlso find and deal withreorgs,reorgsOnly happen in:trusted sequencer通过broadcast发送的数据 与 发送到L1的sequences数据 不同时(即trusted state与virtual state不同时,会进行reorg).8)State:负责管理存储在
StateDB的状态数据(batches、blocks、transactions等),同时StateWill also deal withexecutor和Merkletree服务的集成.9)StateDB:For the state data persistence layer.例外情况是,Merkle tree由
Merkletree服务处理.10)Aggregator:通过生成ZKPs(Zero Knowledge proofs)来consolidate强化batches.It will pass to the
stateSend a request to getproverThe required input data.一旦proof生成,可通过etherman发送到以太坊.11)Prover/Executor:生成ZK proofs的服务.注意
Prover/Executor并未在 https://github.com/0xPolygonHermez/zkevm-node 中实现,But from the perspective of the node as its“黑盒”.
当前Prover/Executor有2版实现:- (a)JSImplement the reference version——zkevm-proverjs库
- (b)CLanguage production version to realize——zkevm-prover库
尽管
Prover/ExecutorAre the same software/服务,但是,The purpose of the actual runtime with different:- (a)作为
Executor:提供EVM实现,To support transaction processing,And obtain the neededresult metadata(如state root、receipts、logs) - (b)作为
Prover:生成ZKPs
12)Merkletree:The service in the storeMerkle tree,Contains all the account information(如balances、nonces、smart contract code 和 smart contract storage).
MerkletreeModule is not in https://github.com/0xPolygonHermez/zkevm-node 中实现,But as a node of an external service.Merkletree的实现见https://github.com/0xPolygonHermez/zkevm-prover(即与Prover/ExecutorIn the same warehouse).
3. Polygon zkEVM节点角色
Polygon zkEVMThe node software support to run multiple roles,Start the role of different service.zkEVMMost of the services within the node software can run different instances,而JSON RPCServices can be run on more than one instance of(And all other services can only have one instance).
Polygon zkEVMMainly has the role of:
- 1)RPC角色
- 2)Trusted sequencer角色
- 3)Permissionless sequencer角色
- 4)Aggregator角色
3.1 RPC角色
Anyone can bearRPC角色.
运行RPCRole required services and modules have:
- 1)JSON RPC:Can run in a separate instance,Can have multiple instances.
- 2)Synchronizer:For a single instance,Can run on separate instance.
- 3)Executor & Merkletree:为服务,Can run on separate instance.
- 4)StateDB:为Postgres SQL,Can run in a separate instance.
Must only by asynchronizer,And recommended forexecutorInstances have exclusive access to(并不是必须的).
RPCRoles can be run within a single instance,但是,If the received request as the increase of the number of,A drop in performance,将JSON RPC和executorService running in multiple instances 是有益的.
3.2 Trusted sequencer角色
Polygon zkEVMIn the network can only have an entity to undertaketrusted sequencer角色.The role in intelligent contracts to strengthen,合约内trusted sequencerThe relevant methods can only be by a specific private keyowner执行.
运行Trusted sequencerRole required services and modules have:
- 1)JSON RPC:Can run in a separate instance,Can have multiple instances.
- 2)Sequencer & Synchronizer:A single instance for running together.
- 3)Executor & Merkletree:为服务,Can run on separate instance.
- 4)Broadcast:Can run on separate instance.
- 5)Pool DB:为Postgres SQL,Can run in a separate instance.
- 6)StateDB:为Postgres SQL,Can run in a separate instance.
注意,JSON RPCNeeds to receive transaction,推荐将JSON RPCRun on separate instance,Depending on the network load,可有多个JSON RPC.同时推荐JSON RPC和SequencerDon't share the sameexecutor实例,以确保sequencer对executorHave exclusive access to.
3.3 Permissionless sequencer角色
待续...
3.4 Aggregator角色
Anyone can bearAggregator角色.
运行AggregatorRole required services and modules have:
- 1)Synchronizer:For a single instance,Run on separate instance.
- 2)Executor & Merkletree:为服务,Can run on separate instance.
- 3)StateDB:为Postgres SQL,Can run in a separate instance.
- 4)Aggregator:For a single instance,Run on separate instance.
- 5)Prover:For a single instance,Run on separate instance.
- 6)Executor:For a single instance,Run on separate instance.
推荐将proverRun on separate instance,Because it is important for the hardware requirements.此外,Other modules can be run on a single instance.
边栏推荐
- Homemade bluetooth mobile app to control stm8/stm32/C51 onboard LED
- [QNX Hypervisor 2.2 User Manual] 10.3 vdev gic
- ant-design的Select组件采用自定义后缀图标(suffixIcon属性)时,点击该自定义图标没有反应,不会展示下拉菜单的问题
- 《nlp入门+实战:第八章:使用Pytorch实现手写数字识别》
- 第08章 索引的创建与设计原则【2.索引及调优篇】【MySQL高级】
- C语言--环形缓存区
- 多线程间的通信方式你知道几种?
- 基于Qt的目录统计QDirStat
- How to read the resources files in the directory path?
- Pine Script | How to display and typeset a plot switch?
猜你喜欢

STM8S105K4T6------Serial port sending and receiving

Taurus.MVC WebAPI 入门开发教程1:框架下载环境配置与运行(含系列目录)。

Zabbix set up email alert + enterprise WeChat alert

案例 | 重庆银行流动数据安全挑战及应对实践

MallBook联合人民交通出版社,推动驾培领域新发展,开启驾培智慧交易新生态

esp8266-01s刷固件步骤

pytorch applied to MNIST handwritten font recognition

哎,又跟HR在小群吵了一架!

JVM内存和垃圾回收-07.堆

In the season of going overseas, the localization of Internet tips for going overseas
随机推荐
大佬们,读取mysql300万单表要很长时间,有什么参数可以优惠,或者有什么办法可以快点
查看mysql死锁语法
Polygon zkEVM网络节点
APP电商如何快速分润分账?
golang中的unsafe.Pointer,指针,引用
yum 仅下载包
Presto中broadcast join和partition join执行计划的处理过程
tkmapper的crud示例:
sql注入一般流程(附例题)
STM8S-----option byte
【医保科普】维护医保基金安全,我们可以这样做
4路双向HDMI综合业务高清视频光端机8路HDMI高清视频光端机
一个属于程序员的七夕节!
There are n steps in total, and you can go up to 1 or 2 steps each time. How many ways are there?
STM8S-----选项字节
C# 构造函数业务场景测试项目
小程序+新零售,玩转行业新玩法!
kingbaseES V8R2/R3 表在指定表空间,为何显示为默认表空间?
自制蓝牙手机app控制stm8/stm32/C51板载LED
Simple record of Flink principle flow chart