当前位置:网站首页>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.如与
state
Interactive data interface can be obtained;Processing trade interface;与pool
Interactive store trading interface.2)Pool:通过
RPC
To store the dealDB,pool
Stored in trading the follow-up can be made ofsequencer
To select or discarded.3)Trusted Sequencer:从
pool
Get the trade,使用state
For 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 sequencer
Running 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:通过
etherman
Get data from the etheric fang updatestate
(为virtual state 或 consolidated state).If the node is nottrusted sequencer
,还会从trusted sequencer
的broadcast
获取数据并更新state
(为trusted state).同时synchronizer
Also find and deal withreorgs,reorgsOnly happen in:trusted sequencer
通过broadcast
发送的数据 与 发送到L1的sequences数据 不同时(即trusted state与virtual state不同时,会进行reorg).8)State:负责管理存储在
StateDB
的状态数据(batches、blocks、transactions等),同时State
Will 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
state
Send a request to getprover
The 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/Executor
Are 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).
Merkletree
Module 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/Executor
In 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.
推荐将prover
Run on separate instance,Because it is important for the hardware requirements.此外,Other modules can be run on a single instance.
边栏推荐
- STM8S105K4T6------Serial port sending and receiving
- QNX Hypervisor 2.2用户手册]10.2 vdev 8259
- 安装postgis时报找不到“POSTGIS_VERSION”这个函数
- ssh服务详解
- [QNX Hypervisor 2.2用户手册]10.3 vdev gic
- unsafe.Pointer, pointer, reference in golang
- 2022年最新海南建筑八大员(材料员)模拟考试试题及答案
- 如何在MySQL中的数据库下删除所有的表
- Architecture of the actual combat camp module three operations
- 多线程间的通信方式你知道几种?
猜你喜欢
随机推荐
倒计时2天,“文化数字化战略新型基础设施暨文化艺术链生态建设发布会”启幕在即
golang中的unsafe.Pointer,指针,引用
ssh服务详解
自制蓝牙手机app控制stm8/stm32/C51板载LED
香港服务器有哪些常用的型号
《nlp入门+实战:第八章:使用Pytorch实现手写数字识别》
基地址:环境变量
Polygon zkEVM网络节点
在更一般意义上验算移位距离和假设
mpf5_定价Bond_yield curve_Spot coupon_duration_有效利率_连续复利_远期_Vasicek短期_CIR模型Derivatives_Tridiagonal_ppf
异步编程解决方案 Generator生成器函数、iterator迭代器、async/await、Promise
【Playwright测试教程】5分钟上手
【云原生】DevOps(六):Jenkins流水线
How many ways do you know about communication between multiple threads?
QNX Hypervisor 2.2 user manual] 10.1 gm vdev options
从图文展示到以云为核,第五代验证码独有的策略情报能力
There are n steps in total, and you can go up to 1 or 2 steps each time. How many ways are there?
千兆2光8电管理型工业以太网交换机WEB管理X-Ring一键环网交换机
C语言--环形缓存区
MRS: Alluxio的使用介绍