当前位置:网站首页>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.
边栏推荐
- [Playwright Test Tutorial] 5 minutes to get started
- 香港服务器有哪些常用的型号
- 出海季,互联网出海锦囊之本地化
- STM8S105k4t6c--------------点亮LED
- 自制蓝牙手机app控制stm8/stm32/C51板载LED
- 从图文展示到以云为核,第五代验证码独有的策略情报能力
- Countdown to 2 days, the "New Infrastructure of Cultural Digital Strategy and Ecological Construction of Cultural Art Chain" will kick off soon
- 力扣(LeetCode)215. 数组中的第K个最大元素(2022.08.03)
- Exclude_reserved_words 排除关键字
- Mini program + new retail, play the new way of playing in the industry!
猜你喜欢

阿里云国际版基于快照与镜像功能迁移云服务器数据

《nlp入门+实战:第八章:使用Pytorch实现手写数字识别》
SQL注入中 #、 --+、 --%20、 %23是什么意思?

Zabbix set up email alert + enterprise WeChat alert

KingbaseES数据库启动失败,报“内存段超过可用内存”

Countdown to 2 days, the "New Infrastructure of Cultural Digital Strategy and Ecological Construction of Cultural Art Chain" will kick off soon

一个属于程序员的七夕节!

瑞能微计量芯片RN2026的实用程序

sqoop ETL tool

STM8S105k4t6c---------------Light up LED
随机推荐
MallBook 助力SKT思珂特教育集团,立足变化,拥抱敏捷交易
Homemade bluetooth mobile app to control stm8/stm32/C51 onboard LED
MySQL 查询练习(1)
力扣(LeetCode)215. 数组中的第K个最大元素(2022.08.03)
SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropri
【Playwright测试教程】5分钟上手
STM8S-----option byte
new Date将字符串转化成日期格式 兼容IE,ie8如何通过new Date将字符串转化成日期格式,js中如何进行字符串替换, replace() 方法详解
【翻译】Terraform和Kubernetes的交集
TOML configuration file format, YAML's top contender
阿里云国际版基于快照与镜像功能迁移云服务器数据
【医保科普】维护医保基金安全,我们可以这样做
Zabbix设置邮件告警+企业微信告警
activiti流程执行过程中,数据库表的使用关系
函数,递归以及dom简单操作
yum 仅下载包
Sfdp 超级表单开发平台 V6.0.5 正式发布
2022焊工(初级)上岗证题目模拟考试平台操作
STM8S105K4T6------串口发送和接收
flinkcdc 消费 mysql binlog 没有 sqltype=delete 的数据是什么原