当前位置:网站首页>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.
边栏推荐
猜你喜欢

跨境电商看不到另一面:商家刷单、平台封号、黑灰产牟利

Why use Selenium for automated testing

【医保科普】维护医保基金安全,我们可以这样做

一文看懂推荐系统:召回04:离散特征处理,one-hot编码和embedding特征嵌入

Development of Taurus. MVC WebAPI introductory tutorial 1: download environment configuration and operation framework (including series directory).

三分建设,七分管理!产品、系统、组织三管齐下节能降耗

单片机C语言->的用法,和意思

说说数据治理中常见的20个问题

函数,递归以及dom简单操作

pytorch applied to MNIST handwritten font recognition
随机推荐
db2中kettle报错 Field [XXX] is required and couldn‘t be found 解决方法
uni-app 从零开始-基础模版(一)
Sfdp 超级表单开发平台 V6.0.5 正式发布
云开发校园微社区微信小程序源码/二手交易/兼职交友微信小程序开源源码
Deep Learning (3) Classification Theory Part
【翻译】Terraform和Kubernetes的交集
Countdown to 2 days, the "New Infrastructure of Cultural Digital Strategy and Ecological Construction of Cultural Art Chain" will kick off soon
董明珠直播时冷脸离场,员工频犯低级错误,自家产品没人能弄明白
KingbaseES数据库启动失败,报“内存段超过可用内存”
织梦内核电动伸缩门卷闸门门业公司网站模板 带手机版【站长亲测】
Polygon zkEVM网络节点
[Study Notes Dish Dog Learning C] Dynamic Memory Management
SQL注入中 #、 --+、 --%20、 %23是什么意思?
STM8S105K4T6------串口发送和接收
ant-design的Select组件采用自定义后缀图标(suffixIcon属性)时,点击该自定义图标没有反应,不会展示下拉菜单的问题
STM8S project creation (STVD creation) --- use COSMIC to create a C language project
Good bosses, please ask the flink CDC oracle to Doris, found that the CPU is unusual, a run down
逻辑漏洞----其他类型
基本表单验证流程
基于Qt的目录统计QDirStat