当前位置:网站首页>Polygon zkEVM Prover
Polygon zkEVM Prover
2022-08-09 03:43:00 【mutourend】
1. 引言
前序博客有:
Polygon zkEVM Prover开源代码见:
- https://github.com/0xPolygonHermez/zkevm-prover(C++,生产版本)
- https://github.com/0xPolygonHermez/zkevm-proverjs(Javascript,参考版本)
Polygon zkEVM Prover负责:
- 生成zkEVM proof。
Polygon zkEVM Prover程序中提供了3个RPC服务:
- 1)Prover服务:
- 1.1)调用Prover component来执行输入数据(为a batch of EVM transactions)、计算the resulting state、基于PIL多项式定义及其约束,为该计算生成证明。
- 1.2)当被Prover服务调用时,Executor component会联合14个状态机来对输入数据进行处理,以生成证明所需的evaluations of the committed polynomials。每个状态机生成各自的computation evidence data,而更复杂的计算则委托给下一级的状态机。
- 1.3)Prover component调用Stark component来生成 Executor状态机所commit多项式的证明。
- 1.4)Prover服务的接口定义在文件zk-prover.proto文件内。
- 2)Executor服务:
- 2.1)调用Executor component来执行输入数据(为a batch of EVM transactions)、计算the resulting state。注意,不同于Prover服务,Executor服务不生成证明。
- 2.2)提供了一种快速方法,来检查所提议的batch of transactions构建正确,且符合单个batch证明所需的工作量要求。
- 2.3)当被Executor服务调用时,Executor component仅使用Main状态机,因为此处不需要生成证明,也就不需要committed polynomials。
- 2.4)Executor服务的接口定义在文件executor.proto文件内。
- 3)StateDB服务:
- 3.1)提供了接口来访问the state of the system(a Merkle tree)和存储状态的数据库。
- 3.2)由executor和prover使用,作为单一状态数据源,可用于获取状态详情,如账号余额。
- 3.3)StateDB服务的接口定义在statedb.proto文件内。
testvectors/config.json
文件中包含了配置不同Prover可选项的配置参数,最重要的相关参数有:
Parameter | Default | Description |
---|---|---|
runProverServer | true | Enable Prover GRPC service |
runExecutorServer | true | Enable Executor server |
runStateDBServer | true | Enable StateDB (Merkle-tree) GRPC service |
runFile | false | Execute the Prover using as input a test file defined in "inputFile" parameter |
inputFile | input_executor.json | Test input file. It must be located in the testvectors folder |
outputPath | output | Output path folder to store the result files. It must be located in the testvectors folder |
databaseURL | local | Connection string for the PostgreSQL database used by the StateDB service. If the value is "local" then the service will not use a database and the data will be stored only in memory (no persistence). The PostgreSQL database connection string has the following format: "postgresql://<user>:<password>@<ip>:<port>/<database>" . For example: "postgresql://statedb:[email protected]:5432/testdb" |
stateDBURL | local | Connection string for the StateDB service. If the value is "local" then the GRPC StateDB service will not be used and local StateDB client will be used instead. The StateDB service connection string has the following format: "<ip>:<port>" . For example: "127.0.0.1:50061" |
若想运行a proof test,需做如下配置:
- 1)修改
config.json
文件中的"runFile"参数为“true”,其它参数必须配置为“false”。 - 2)将“inputFile”参数指向所需测试的input test data,
testvectors/input_executor.json
即为一个测试文件。 - 3)在
testvectors
文件夹内运行$ ../build/zkProver
来启动Prover。 - 4)输出的proof文件存储在“outputPath”配置参数指定的文件夹内。
边栏推荐
- 了解CV和RoboMaster视觉组(五)CNN没有不变性?
- 剑指 Offer 56 - I. 数组中数字出现的次数
- Mysql表打不开
- How to resolve the conflict between LAN segment and WAN segment when Honor router (WS831) is used as wireless relay
- 光刻机随感
- 《剑指offer》题解——week1(持续更新)
- A few words about Microsoft's 2022/2023 autumn recruits
- 了解CV和RoboMaster视觉组(五)目标跟踪:概述与光流法
- 笔记本重装系统如何找回之前自己自带的office
- 了解CV和RoboMaster视觉组(五)滤波器、观测器和预测方法:粒子滤波器Particle Filter
猜你喜欢
el-popover 内嵌 el-table 后位置错位 乱飘 解决方案
phpStdudy的下载和DVWA的搭建
创建一个DAPP的全流程
光刻机随感
Error detected while processing /home/test/.vim/plugin/visualmark.vim
了解CV和RoboMaster视觉组(五)滤波器、观测器和预测方法
365 days challenge LeetCode1000 topic - Day 051 special binary sequence partition
Mysql表打不开
电脑重装系统如何在 Win11查看显卡型号信息
rk3399 PCIe rc设备枚举之设备资源识别分析
随机推荐
了解CV和RoboMaster视觉组(五)目标跟踪:概述与光流法
MutationObserver接口(一) 基本用法
phpStdudy的下载和DVWA的搭建
了解CV和RoboMaster视觉组(五)滤波器、观测器和预测方法:自适应滤波器的应用
31 basic statistical concepts
发明时代,「幂集创新」事关你我
powershell 执行策略
项目中'说到做不到'的个人分析
电脑重装系统如何在 Win11查看显卡型号信息
leetcode 5709. 最大升序子数组和
为什么有的时间函数在同一事务内返回的都是同一值?
全链路UI设计笔记
OpenCV相机标定完全指南(有手就行)
【图形学】19 光照模型(四、Blinn-Phong光照模型)
创建一个DAPP的全流程
欧拉22.02系统 mysql5.7 arm版本的安装包, 哪里能下载到?
Arrays and slices
盘点检索任务中的损失函数
If A, B, C, and D process parts, the total number of processed parts is 370. If the number of parts processed by A is 10 more, if the number of parts processed by B is 20 less, if the number of parts
了解CV和RoboMaster视觉组(五)滤波器、观测器和预测方法