当前位置:网站首页>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”配置参数指定的文件夹内。
边栏推荐
猜你喜欢
随机推荐
2022-08-08 The fifth group Gu Xiangquan study notes day31-collection-junit unit test
VMware不正常关机
sklearn(一)
leetcode 2021春季挑战赛 1. 采购方案
【Redis底层解析】字典类型
2022-08-08 The fifth group Gu Xiangquan study notes day31-collection-IO stream-File class
xml reference configuration file
发明时代,「幂集创新」事关你我
Session、cookie、token有什么区别?
《剑指offer》题解——week1(持续更新)
光刻机随感
了解CV和RoboMaster视觉组(五)目标跟踪:基于深度学习的方法
别了,IE浏览器
Deep learning - in the recognition, for example, this paper discusses how to preserve the neural network model
H264之sps解析分辨率
了解CV和RoboMaster视觉组(五)运动建模与预测
SQL注入(2)
365 days challenge LeetCode1000 topic - Day 051 special binary sequence partition
static成员及代码块
PhotoShop软件笔记









