@aztec/prover-node 1.0.0-nightly.20250607 → 1.0.0-nightly.20250610
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/actions/download-epoch-proving-job.d.ts +1 -1
- package/dest/job/epoch-proving-job.d.ts.map +1 -1
- package/dest/job/epoch-proving-job.js +7 -3
- package/dest/prover-node-publisher.d.ts +3 -0
- package/dest/prover-node-publisher.d.ts.map +1 -1
- package/dest/prover-node-publisher.js +26 -15
- package/package.json +21 -20
- package/src/job/epoch-proving-job.ts +16 -3
- package/src/prover-node-publisher.ts +45 -25
|
@@ -8,11 +8,11 @@ export declare function downloadEpochProvingJob(location: string, log: Logger, c
|
|
|
8
8
|
dataDirectory: string;
|
|
9
9
|
jobDataDownloadPath: string;
|
|
10
10
|
}): Promise<{
|
|
11
|
+
rollupVersion: number;
|
|
11
12
|
l2BlockNumber: number;
|
|
12
13
|
l2BlockHash: string;
|
|
13
14
|
rollupAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
14
15
|
l1ChainId: number;
|
|
15
|
-
rollupVersion: number;
|
|
16
16
|
l1BlockNumber: number;
|
|
17
17
|
}>;
|
|
18
18
|
//# sourceMappingURL=download-epoch-proving-job.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epoch-proving-job.d.ts","sourceRoot":"","sources":["../../src/job/epoch-proving-job.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"epoch-proving-job.d.ts","sourceRoot":"","sources":["../../src/job/epoch-proving-job.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAmB,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,4BAA4B,EAC5B,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAEzC,OAA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AAW,IAAI,IAAI,GAAG,SAAS;IAI/B,cAAc,IAAI,mBAAmB;IAI5C,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,MAAM,GAEjB;IAED,OAAO,KAAK,GAAG,GAEd;IAED;;OAEG;IAIU,GAAG;IAmHhB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IAML,IAAI,CAAC,KAAK,GAAE,4BAAwC;IASjE,OAAO,CAAC,oBAAoB;IAoB5B;;;OAGG;YACW,kBAAkB;IAiChC,OAAO,CAAC,cAAc;YAiBR,MAAM;IAQpB,OAAO,CAAC,iBAAiB;YAIX,UAAU;CAmBzB;AASD,OAAO,EAAE,KAAK,oBAAoB,EAAE,CAAC"}
|
|
@@ -4,6 +4,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
4
4
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
|
+
import { BatchedBlob, Blob } from '@aztec/blob-lib';
|
|
7
8
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
8
9
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
10
|
import { RunningPromise, promiseWithResolvers } from '@aztec/foundation/promise';
|
|
@@ -99,7 +100,9 @@ import { validateEpochProvingJobData } from './epoch-proving-job-data.js';
|
|
|
99
100
|
const { promise, resolve } = promiseWithResolvers();
|
|
100
101
|
this.runPromise = promise;
|
|
101
102
|
try {
|
|
102
|
-
this.
|
|
103
|
+
const allBlobs = (await Promise.all(this.blocks.map(async (block)=>await Blob.getBlobs(block.body.toBlobFields())))).flat();
|
|
104
|
+
const finalBlobBatchingChallenges = await BatchedBlob.precomputeBatchedBlobChallenges(allBlobs);
|
|
105
|
+
this.prover.startNewEpoch(epochNumber, fromBlock, epochSizeBlocks, finalBlobBatchingChallenges);
|
|
103
106
|
await this.prover.startTubeCircuits(this.txs);
|
|
104
107
|
await asyncPool(this.config.parallelBlockLimit ?? 32, this.blocks, async (block)=>{
|
|
105
108
|
this.checkState();
|
|
@@ -136,7 +139,7 @@ import { validateEpochProvingJobData } from './epoch-proving-job-data.js';
|
|
|
136
139
|
});
|
|
137
140
|
const executionTime = timer.ms();
|
|
138
141
|
this.progressState('awaiting-prover');
|
|
139
|
-
const { publicInputs, proof } = await this.prover.finaliseEpoch();
|
|
142
|
+
const { publicInputs, proof, batchedBlobInputs } = await this.prover.finaliseEpoch();
|
|
140
143
|
this.log.info(`Finalised proof for epoch ${epochNumber}`, {
|
|
141
144
|
epochNumber,
|
|
142
145
|
uuid: this.uuid,
|
|
@@ -148,7 +151,8 @@ import { validateEpochProvingJobData } from './epoch-proving-job-data.js';
|
|
|
148
151
|
toBlock,
|
|
149
152
|
epochNumber,
|
|
150
153
|
publicInputs,
|
|
151
|
-
proof
|
|
154
|
+
proof,
|
|
155
|
+
batchedBlobInputs
|
|
152
156
|
});
|
|
153
157
|
if (!success) {
|
|
154
158
|
throw new Error('Failed to submit epoch proof to L1');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BatchedBlob } from '@aztec/blob-lib';
|
|
1
2
|
import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
|
|
2
3
|
import type { L1TxUtils, RollupContract } from '@aztec/ethereum';
|
|
3
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -51,9 +52,11 @@ export declare class ProverNodePublisher {
|
|
|
51
52
|
toBlock: number;
|
|
52
53
|
publicInputs: RootRollupPublicInputs;
|
|
53
54
|
proof: Proof;
|
|
55
|
+
batchedBlobInputs: BatchedBlob;
|
|
54
56
|
}): Promise<boolean>;
|
|
55
57
|
private validateEpochProofSubmission;
|
|
56
58
|
private sendSubmitEpochProofTx;
|
|
59
|
+
private getEpochProofPublicInputsArgs;
|
|
57
60
|
private getSubmitEpochProofArgs;
|
|
58
61
|
protected sleepOrInterrupted(): Promise<void>;
|
|
59
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prover-node-publisher.d.ts","sourceRoot":"","sources":["../src/prover-node-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAIzD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"prover-node-publisher.d.ts","sourceRoot":"","sources":["../src/prover-node-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAIzD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,s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G,OAAO,CAAC,OAAO,CAAC;YA+CN,4BAA4B;YAyD5B,sBAAsB;IAwCpC,OAAO,CAAC,6BAA6B;IAwBrC,OAAO,CAAC,uBAAuB;cAoBf,kBAAkB;CAGnC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
|
|
1
2
|
import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
|
|
2
3
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
4
|
import { areArraysEqual } from '@aztec/foundation/collection';
|
|
@@ -8,6 +9,7 @@ import { InterruptibleSleep } from '@aztec/foundation/sleep';
|
|
|
8
9
|
import { Timer } from '@aztec/foundation/timer';
|
|
9
10
|
import { RollupAbi } from '@aztec/l1-artifacts';
|
|
10
11
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
12
|
+
import { inspect } from 'util';
|
|
11
13
|
import { encodeFunctionData } from 'viem';
|
|
12
14
|
import { ProverNodePublisherMetrics } from './metrics.js';
|
|
13
15
|
export class ProverNodePublisher {
|
|
@@ -92,7 +94,7 @@ export class ProverNodePublisher {
|
|
|
92
94
|
return false;
|
|
93
95
|
}
|
|
94
96
|
async validateEpochProofSubmission(args) {
|
|
95
|
-
const { fromBlock, toBlock, publicInputs } = args;
|
|
97
|
+
const { fromBlock, toBlock, publicInputs, batchedBlobInputs } = args;
|
|
96
98
|
// Check that the block numbers match the expected epoch to be proven
|
|
97
99
|
const { pendingBlockNumber: pending, provenBlockNumber: proven } = await this.rollupContract.getTips();
|
|
98
100
|
// Don't publish if proven is beyond our toBlock, pointless to do so
|
|
@@ -113,8 +115,12 @@ export class ProverNodePublisher {
|
|
|
113
115
|
if (publicInputs.endArchiveRoot.toString() !== endBlockLog.archive) {
|
|
114
116
|
throw new Error(`End archive root mismatch: ${publicInputs.endArchiveRoot.toString()} !== ${endBlockLog.archive}`);
|
|
115
117
|
}
|
|
118
|
+
// Check the batched blob inputs from the root rollup against the batched blob computed in ts
|
|
119
|
+
if (!publicInputs.blobPublicInputs.equals(FinalBlobAccumulatorPublicInputs.fromBatchedBlob(batchedBlobInputs))) {
|
|
120
|
+
throw new Error(`Batched blob mismatch: ${inspect(publicInputs.blobPublicInputs)} !== ${inspect(FinalBlobAccumulatorPublicInputs.fromBatchedBlob(batchedBlobInputs))}`);
|
|
121
|
+
}
|
|
116
122
|
// Compare the public inputs computed by the contract with the ones injected
|
|
117
|
-
const rollupPublicInputs = await this.rollupContract.getEpochProofPublicInputs(this.
|
|
123
|
+
const rollupPublicInputs = await this.rollupContract.getEpochProofPublicInputs(this.getEpochProofPublicInputsArgs(args));
|
|
118
124
|
const argsPublicInputs = [
|
|
119
125
|
...publicInputs.toFields()
|
|
120
126
|
];
|
|
@@ -124,17 +130,8 @@ export class ProverNodePublisher {
|
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
132
|
async sendSubmitEpochProofTx(args) {
|
|
127
|
-
const proofHex = `0x${args.proof.withoutPublicInputs().toString('hex')}`;
|
|
128
|
-
const argsArray = this.getSubmitEpochProofArgs(args);
|
|
129
133
|
const txArgs = [
|
|
130
|
-
|
|
131
|
-
start: argsArray[0],
|
|
132
|
-
end: argsArray[1],
|
|
133
|
-
args: argsArray[2],
|
|
134
|
-
fees: argsArray[3],
|
|
135
|
-
blobPublicInputs: argsArray[4],
|
|
136
|
-
proof: proofHex
|
|
137
|
-
}
|
|
134
|
+
this.getSubmitEpochProofArgs(args)
|
|
138
135
|
];
|
|
139
136
|
this.log.info(`SubmitEpochProof proofSize=${args.proof.withoutPublicInputs().length} bytes`);
|
|
140
137
|
const data = encodeFunctionData({
|
|
@@ -162,7 +159,8 @@ export class ProverNodePublisher {
|
|
|
162
159
|
return undefined;
|
|
163
160
|
}
|
|
164
161
|
}
|
|
165
|
-
|
|
162
|
+
getEpochProofPublicInputsArgs(args) {
|
|
163
|
+
// Returns arguments for EpochProofLib.sol -> getEpochProofPublicInputs()
|
|
166
164
|
return [
|
|
167
165
|
BigInt(args.fromBlock),
|
|
168
166
|
BigInt(args.toBlock),
|
|
@@ -170,11 +168,24 @@ export class ProverNodePublisher {
|
|
|
170
168
|
previousArchive: args.publicInputs.previousArchiveRoot.toString(),
|
|
171
169
|
endArchive: args.publicInputs.endArchiveRoot.toString(),
|
|
172
170
|
proverId: EthAddress.fromField(args.publicInputs.proverId).toString()
|
|
173
|
-
},
|
|
171
|
+
} /*_args*/ ,
|
|
174
172
|
makeTuple(AZTEC_MAX_EPOCH_DURATION * 2, (i)=>i % 2 === 0 ? args.publicInputs.fees[i / 2].recipient.toField().toString() : args.publicInputs.fees[(i - 1) / 2].value.toString()),
|
|
175
|
-
|
|
173
|
+
args.batchedBlobInputs.getEthBlobEvaluationInputs()
|
|
176
174
|
];
|
|
177
175
|
}
|
|
176
|
+
getSubmitEpochProofArgs(args) {
|
|
177
|
+
// Returns arguments for EpochProofLib.sol -> submitEpochRootProof()
|
|
178
|
+
const proofHex = `0x${args.proof.withoutPublicInputs().toString('hex')}`;
|
|
179
|
+
const argsArray = this.getEpochProofPublicInputsArgs(args);
|
|
180
|
+
return {
|
|
181
|
+
start: argsArray[0],
|
|
182
|
+
end: argsArray[1],
|
|
183
|
+
args: argsArray[2],
|
|
184
|
+
fees: argsArray[3],
|
|
185
|
+
blobInputs: argsArray[4],
|
|
186
|
+
proof: proofHex
|
|
187
|
+
};
|
|
188
|
+
}
|
|
178
189
|
async sleepOrInterrupted() {
|
|
179
190
|
await this.interruptibleSleep.sleep(this.sleepTimeMs);
|
|
180
191
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-node",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250610",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -52,25 +52,26 @@
|
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
56
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
57
|
-
"@aztec/blob-
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/
|
|
61
|
-
"@aztec/
|
|
62
|
-
"@aztec/
|
|
63
|
-
"@aztec/
|
|
64
|
-
"@aztec/
|
|
65
|
-
"@aztec/
|
|
66
|
-
"@aztec/
|
|
67
|
-
"@aztec/
|
|
68
|
-
"@aztec/
|
|
69
|
-
"@aztec/
|
|
70
|
-
"@aztec/
|
|
71
|
-
"@aztec/
|
|
72
|
-
"@aztec/
|
|
73
|
-
"@aztec/
|
|
55
|
+
"@aztec/archiver": "1.0.0-nightly.20250610",
|
|
56
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250610",
|
|
57
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250610",
|
|
58
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250610",
|
|
59
|
+
"@aztec/constants": "1.0.0-nightly.20250610",
|
|
60
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250610",
|
|
61
|
+
"@aztec/ethereum": "1.0.0-nightly.20250610",
|
|
62
|
+
"@aztec/foundation": "1.0.0-nightly.20250610",
|
|
63
|
+
"@aztec/kv-store": "1.0.0-nightly.20250610",
|
|
64
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250610",
|
|
65
|
+
"@aztec/node-lib": "1.0.0-nightly.20250610",
|
|
66
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250610",
|
|
67
|
+
"@aztec/p2p": "1.0.0-nightly.20250610",
|
|
68
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250610",
|
|
69
|
+
"@aztec/prover-client": "1.0.0-nightly.20250610",
|
|
70
|
+
"@aztec/sequencer-client": "1.0.0-nightly.20250610",
|
|
71
|
+
"@aztec/simulator": "1.0.0-nightly.20250610",
|
|
72
|
+
"@aztec/stdlib": "1.0.0-nightly.20250610",
|
|
73
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250610",
|
|
74
|
+
"@aztec/world-state": "1.0.0-nightly.20250610",
|
|
74
75
|
"source-map-support": "^0.5.21",
|
|
75
76
|
"tslib": "^2.4.0",
|
|
76
77
|
"viem": "2.23.7"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BatchedBlob, Blob } from '@aztec/blob-lib';
|
|
1
2
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
2
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
4
|
import { RunningPromise, promiseWithResolvers } from '@aztec/foundation/promise';
|
|
@@ -113,7 +114,12 @@ export class EpochProvingJob implements Traceable {
|
|
|
113
114
|
this.runPromise = promise;
|
|
114
115
|
|
|
115
116
|
try {
|
|
116
|
-
|
|
117
|
+
const allBlobs = (
|
|
118
|
+
await Promise.all(this.blocks.map(async block => await Blob.getBlobs(block.body.toBlobFields())))
|
|
119
|
+
).flat();
|
|
120
|
+
|
|
121
|
+
const finalBlobBatchingChallenges = await BatchedBlob.precomputeBatchedBlobChallenges(allBlobs);
|
|
122
|
+
this.prover.startNewEpoch(epochNumber, fromBlock, epochSizeBlocks, finalBlobBatchingChallenges);
|
|
117
123
|
await this.prover.startTubeCircuits(this.txs);
|
|
118
124
|
|
|
119
125
|
await asyncPool(this.config.parallelBlockLimit ?? 32, this.blocks, async block => {
|
|
@@ -158,11 +164,18 @@ export class EpochProvingJob implements Traceable {
|
|
|
158
164
|
const executionTime = timer.ms();
|
|
159
165
|
|
|
160
166
|
this.progressState('awaiting-prover');
|
|
161
|
-
const { publicInputs, proof } = await this.prover.finaliseEpoch();
|
|
167
|
+
const { publicInputs, proof, batchedBlobInputs } = await this.prover.finaliseEpoch();
|
|
162
168
|
this.log.info(`Finalised proof for epoch ${epochNumber}`, { epochNumber, uuid: this.uuid, duration: timer.ms() });
|
|
163
169
|
|
|
164
170
|
this.progressState('publishing-proof');
|
|
165
|
-
const success = await this.publisher.submitEpochProof({
|
|
171
|
+
const success = await this.publisher.submitEpochProof({
|
|
172
|
+
fromBlock,
|
|
173
|
+
toBlock,
|
|
174
|
+
epochNumber,
|
|
175
|
+
publicInputs,
|
|
176
|
+
proof,
|
|
177
|
+
batchedBlobInputs,
|
|
178
|
+
});
|
|
166
179
|
if (!success) {
|
|
167
180
|
throw new Error('Failed to submit epoch proof to L1');
|
|
168
181
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BatchedBlob, FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
|
|
1
2
|
import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
|
|
2
3
|
import type { L1TxUtils, RollupContract } from '@aztec/ethereum';
|
|
3
4
|
import { makeTuple } from '@aztec/foundation/array';
|
|
@@ -15,6 +16,7 @@ import type { FeeRecipient, RootRollupPublicInputs } from '@aztec/stdlib/rollup'
|
|
|
15
16
|
import type { L1PublishProofStats } from '@aztec/stdlib/stats';
|
|
16
17
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
17
18
|
|
|
19
|
+
import { inspect } from 'util';
|
|
18
20
|
import { type Hex, type TransactionReceipt, encodeFunctionData } from 'viem';
|
|
19
21
|
|
|
20
22
|
import { ProverNodePublisherMetrics } from './metrics.js';
|
|
@@ -94,6 +96,7 @@ export class ProverNodePublisher {
|
|
|
94
96
|
toBlock: number;
|
|
95
97
|
publicInputs: RootRollupPublicInputs;
|
|
96
98
|
proof: Proof;
|
|
99
|
+
batchedBlobInputs: BatchedBlob;
|
|
97
100
|
}): Promise<boolean> {
|
|
98
101
|
const { epochNumber, fromBlock, toBlock } = args;
|
|
99
102
|
const ctx = { epochNumber, fromBlock, toBlock };
|
|
@@ -146,8 +149,9 @@ export class ProverNodePublisher {
|
|
|
146
149
|
toBlock: number;
|
|
147
150
|
publicInputs: RootRollupPublicInputs;
|
|
148
151
|
proof: Proof;
|
|
152
|
+
batchedBlobInputs: BatchedBlob;
|
|
149
153
|
}) {
|
|
150
|
-
const { fromBlock, toBlock, publicInputs } = args;
|
|
154
|
+
const { fromBlock, toBlock, publicInputs, batchedBlobInputs } = args;
|
|
151
155
|
|
|
152
156
|
// Check that the block numbers match the expected epoch to be proven
|
|
153
157
|
const { pendingBlockNumber: pending, provenBlockNumber: proven } = await this.rollupContract.getTips();
|
|
@@ -176,8 +180,17 @@ export class ProverNodePublisher {
|
|
|
176
180
|
);
|
|
177
181
|
}
|
|
178
182
|
|
|
183
|
+
// Check the batched blob inputs from the root rollup against the batched blob computed in ts
|
|
184
|
+
if (!publicInputs.blobPublicInputs.equals(FinalBlobAccumulatorPublicInputs.fromBatchedBlob(batchedBlobInputs))) {
|
|
185
|
+
throw new Error(
|
|
186
|
+
`Batched blob mismatch: ${inspect(publicInputs.blobPublicInputs)} !== ${inspect(FinalBlobAccumulatorPublicInputs.fromBatchedBlob(batchedBlobInputs))}`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
179
190
|
// Compare the public inputs computed by the contract with the ones injected
|
|
180
|
-
const rollupPublicInputs = await this.rollupContract.getEpochProofPublicInputs(
|
|
191
|
+
const rollupPublicInputs = await this.rollupContract.getEpochProofPublicInputs(
|
|
192
|
+
this.getEpochProofPublicInputsArgs(args),
|
|
193
|
+
);
|
|
181
194
|
const argsPublicInputs = [...publicInputs.toFields()];
|
|
182
195
|
|
|
183
196
|
if (!areArraysEqual(rollupPublicInputs.map(Fr.fromHexString), argsPublicInputs, (a, b) => a.equals(b))) {
|
|
@@ -193,20 +206,9 @@ export class ProverNodePublisher {
|
|
|
193
206
|
toBlock: number;
|
|
194
207
|
publicInputs: RootRollupPublicInputs;
|
|
195
208
|
proof: Proof;
|
|
209
|
+
batchedBlobInputs: BatchedBlob;
|
|
196
210
|
}): Promise<TransactionReceipt | undefined> {
|
|
197
|
-
const
|
|
198
|
-
const argsArray = this.getSubmitEpochProofArgs(args);
|
|
199
|
-
|
|
200
|
-
const txArgs = [
|
|
201
|
-
{
|
|
202
|
-
start: argsArray[0],
|
|
203
|
-
end: argsArray[1],
|
|
204
|
-
args: argsArray[2],
|
|
205
|
-
fees: argsArray[3],
|
|
206
|
-
blobPublicInputs: argsArray[4],
|
|
207
|
-
proof: proofHex,
|
|
208
|
-
},
|
|
209
|
-
] as const;
|
|
211
|
+
const txArgs = [this.getSubmitEpochProofArgs(args)] as const;
|
|
210
212
|
|
|
211
213
|
this.log.info(`SubmitEpochProof proofSize=${args.proof.withoutPublicInputs().length} bytes`);
|
|
212
214
|
const data = encodeFunctionData({
|
|
@@ -239,32 +241,50 @@ export class ProverNodePublisher {
|
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
243
|
|
|
242
|
-
private
|
|
244
|
+
private getEpochProofPublicInputsArgs(args: {
|
|
243
245
|
fromBlock: number;
|
|
244
246
|
toBlock: number;
|
|
245
247
|
publicInputs: RootRollupPublicInputs;
|
|
246
|
-
|
|
248
|
+
batchedBlobInputs: BatchedBlob;
|
|
247
249
|
}) {
|
|
250
|
+
// Returns arguments for EpochProofLib.sol -> getEpochProofPublicInputs()
|
|
248
251
|
return [
|
|
249
|
-
BigInt(args.fromBlock)
|
|
250
|
-
BigInt(args.toBlock)
|
|
252
|
+
BigInt(args.fromBlock) /*_start*/,
|
|
253
|
+
BigInt(args.toBlock) /*_end*/,
|
|
251
254
|
{
|
|
252
255
|
previousArchive: args.publicInputs.previousArchiveRoot.toString(),
|
|
253
256
|
endArchive: args.publicInputs.endArchiveRoot.toString(),
|
|
254
257
|
proverId: EthAddress.fromField(args.publicInputs.proverId).toString(),
|
|
255
|
-
}
|
|
258
|
+
} /*_args*/,
|
|
256
259
|
makeTuple(AZTEC_MAX_EPOCH_DURATION * 2, i =>
|
|
257
260
|
i % 2 === 0
|
|
258
261
|
? args.publicInputs.fees[i / 2].recipient.toField().toString()
|
|
259
262
|
: args.publicInputs.fees[(i - 1) / 2].value.toString(),
|
|
260
|
-
)
|
|
261
|
-
|
|
262
|
-
.filter((_, i) => i < args.toBlock - args.fromBlock + 1)
|
|
263
|
-
.map(b => b.toString())
|
|
264
|
-
.join(``)}`,
|
|
263
|
+
) /*_fees*/,
|
|
264
|
+
args.batchedBlobInputs.getEthBlobEvaluationInputs() /*_blobPublicInputs*/,
|
|
265
265
|
] as const;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
private getSubmitEpochProofArgs(args: {
|
|
269
|
+
fromBlock: number;
|
|
270
|
+
toBlock: number;
|
|
271
|
+
publicInputs: RootRollupPublicInputs;
|
|
272
|
+
proof: Proof;
|
|
273
|
+
batchedBlobInputs: BatchedBlob;
|
|
274
|
+
}) {
|
|
275
|
+
// Returns arguments for EpochProofLib.sol -> submitEpochRootProof()
|
|
276
|
+
const proofHex: Hex = `0x${args.proof.withoutPublicInputs().toString('hex')}`;
|
|
277
|
+
const argsArray = this.getEpochProofPublicInputsArgs(args);
|
|
278
|
+
return {
|
|
279
|
+
start: argsArray[0],
|
|
280
|
+
end: argsArray[1],
|
|
281
|
+
args: argsArray[2],
|
|
282
|
+
fees: argsArray[3],
|
|
283
|
+
blobInputs: argsArray[4],
|
|
284
|
+
proof: proofHex,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
268
288
|
protected async sleepOrInterrupted() {
|
|
269
289
|
await this.interruptibleSleep.sleep(this.sleepTimeMs);
|
|
270
290
|
}
|