@aztec/prover-client 3.0.0-canary.a9708bd → 3.0.0-manual.20251030
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/block-factory/light.d.ts +5 -3
- package/dest/block-factory/light.d.ts.map +1 -1
- package/dest/block-factory/light.js +16 -9
- package/dest/config.js +1 -1
- package/dest/mocks/fixtures.d.ts +4 -1
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +31 -3
- package/dest/mocks/test_context.d.ts +32 -9
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +78 -22
- package/dest/orchestrator/block-building-helpers.d.ts +33 -31
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +126 -137
- package/dest/orchestrator/block-proving-state.d.ts +60 -53
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +214 -187
- package/dest/orchestrator/checkpoint-proving-state.d.ts +63 -0
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/checkpoint-proving-state.js +211 -0
- package/dest/orchestrator/epoch-proving-state.d.ts +34 -28
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +128 -84
- package/dest/orchestrator/orchestrator.d.ts +31 -30
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +368 -236
- package/dest/orchestrator/tx-proving-state.d.ts +11 -9
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/tx-proving-state.js +26 -23
- package/dest/prover-client/server-epoch-prover.d.ts +9 -8
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +9 -9
- package/dest/proving_broker/broker_prover_facade.d.ts +20 -15
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +36 -21
- package/dest/proving_broker/config.d.ts +8 -8
- package/dest/proving_broker/config.js +5 -5
- package/dest/proving_broker/factory.js +1 -1
- package/dest/proving_broker/fixtures.js +1 -1
- package/dest/proving_broker/proof_store/index.d.ts +1 -0
- package/dest/proving_broker/proof_store/index.d.ts.map +1 -1
- package/dest/proving_broker/proof_store/index.js +1 -0
- package/dest/proving_broker/proving_broker.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +29 -18
- package/dest/proving_broker/proving_broker_database/persisted.js +5 -5
- package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
- package/dest/proving_broker/proving_job_controller.js +38 -18
- package/dest/test/mock_prover.d.ts +22 -17
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +35 -20
- package/package.json +16 -17
- package/src/block-factory/light.ts +35 -9
- package/src/config.ts +1 -1
- package/src/mocks/fixtures.ts +39 -11
- package/src/mocks/test_context.ts +137 -31
- package/src/orchestrator/block-building-helpers.ts +211 -211
- package/src/orchestrator/block-proving-state.ts +235 -245
- package/src/orchestrator/checkpoint-proving-state.ts +299 -0
- package/src/orchestrator/epoch-proving-state.ts +172 -127
- package/src/orchestrator/orchestrator.ts +545 -303
- package/src/orchestrator/tx-proving-state.ts +49 -43
- package/src/prover-client/server-epoch-prover.ts +28 -18
- package/src/proving_broker/broker_prover_facade.ts +157 -86
- package/src/proving_broker/config.ts +7 -7
- package/src/proving_broker/factory.ts +1 -1
- package/src/proving_broker/fixtures.ts +1 -1
- package/src/proving_broker/proof_store/index.ts +1 -0
- package/src/proving_broker/proving_broker.ts +36 -18
- package/src/proving_broker/proving_broker_database/persisted.ts +5 -5
- package/src/proving_broker/proving_job_controller.ts +38 -18
- package/src/test/mock_prover.ts +142 -60
- package/dest/bin/get-proof-inputs.d.ts +0 -2
- package/dest/bin/get-proof-inputs.d.ts.map +0 -1
- package/dest/bin/get-proof-inputs.js +0 -51
- package/src/bin/get-proof-inputs.ts +0 -59
|
@@ -1,42 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
3
3
|
AVM_VK_INDEX,
|
|
4
|
-
|
|
5
|
-
PUBLIC_TUBE_VK_INDEX,
|
|
6
|
-
type TUBE_PROOF_LENGTH,
|
|
4
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
7
5
|
} from '@aztec/constants';
|
|
6
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
7
|
+
import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
8
8
|
import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
9
9
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
10
|
-
import type { ProofAndVerificationKey } from '@aztec/stdlib/interfaces/server';
|
|
10
|
+
import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
11
|
+
import { ProofData } from '@aztec/stdlib/proofs';
|
|
11
12
|
import {
|
|
12
|
-
AvmProofData,
|
|
13
13
|
type BaseRollupHints,
|
|
14
14
|
PrivateBaseRollupHints,
|
|
15
|
-
|
|
16
|
-
PrivateTubeData,
|
|
15
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
17
16
|
PublicBaseRollupHints,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
TubeInputs,
|
|
17
|
+
PublicChonkVerifierPublicInputs,
|
|
18
|
+
PublicTxBaseRollupPrivateInputs,
|
|
21
19
|
} from '@aztec/stdlib/rollup';
|
|
22
20
|
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
23
21
|
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
24
22
|
import type { ProcessedTx } from '@aztec/stdlib/tx';
|
|
25
23
|
import { VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
26
24
|
|
|
25
|
+
import {
|
|
26
|
+
getChonkProofFromTx,
|
|
27
|
+
getPublicChonkVerifierPrivateInputsFromTx,
|
|
28
|
+
toProofData,
|
|
29
|
+
} from './block-building-helpers.js';
|
|
30
|
+
|
|
27
31
|
/**
|
|
28
32
|
* Helper class to manage the proving cycle of a transaction
|
|
29
33
|
* This includes the public VMs and the public kernels
|
|
30
34
|
* Also stores the inputs to the base rollup for this transaction and the tree snapshots
|
|
31
35
|
*/
|
|
32
36
|
export class TxProvingState {
|
|
33
|
-
private
|
|
37
|
+
private publicChonkVerifier?: PublicInputsAndRecursiveProof<
|
|
38
|
+
PublicChonkVerifierPublicInputs,
|
|
39
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
40
|
+
>;
|
|
34
41
|
private avm?: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>;
|
|
35
42
|
|
|
36
43
|
constructor(
|
|
37
44
|
public readonly processedTx: ProcessedTx,
|
|
38
45
|
private readonly baseRollupHints: BaseRollupHints,
|
|
39
46
|
public readonly treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot>,
|
|
47
|
+
private readonly proverId: Fr,
|
|
40
48
|
) {}
|
|
41
49
|
|
|
42
50
|
get requireAvmProof() {
|
|
@@ -44,33 +52,38 @@ export class TxProvingState {
|
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
public ready() {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public getTubeInputs() {
|
|
51
|
-
return new TubeInputs(!!this.processedTx.data.forPublic, this.processedTx.clientIvcProof);
|
|
55
|
+
return !this.requireAvmProof || (!!this.avm && !!this.publicChonkVerifier);
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
public getAvmInputs(): AvmCircuitInputs {
|
|
55
59
|
return this.processedTx.avmProvingRequest!.inputs;
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
public getPublicChonkVerifierPrivateInputs() {
|
|
63
|
+
return getPublicChonkVerifierPrivateInputsFromTx(this.processedTx, this.proverId);
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
public getBaseRollupTypeAndInputs() {
|
|
59
67
|
if (this.requireAvmProof) {
|
|
60
68
|
return {
|
|
61
|
-
rollupType: '
|
|
69
|
+
rollupType: 'rollup-tx-base-public' satisfies CircuitName,
|
|
62
70
|
inputs: this.#getPublicBaseInputs(),
|
|
63
71
|
};
|
|
64
72
|
} else {
|
|
65
73
|
return {
|
|
66
|
-
rollupType: '
|
|
74
|
+
rollupType: 'rollup-tx-base-private' satisfies CircuitName,
|
|
67
75
|
inputs: this.#getPrivateBaseInputs(),
|
|
68
76
|
};
|
|
69
77
|
}
|
|
70
78
|
}
|
|
71
79
|
|
|
72
|
-
public
|
|
73
|
-
|
|
80
|
+
public setPublicChonkVerifierProof(
|
|
81
|
+
publicChonkVerifierProofAndVk: PublicInputsAndRecursiveProof<
|
|
82
|
+
PublicChonkVerifierPublicInputs,
|
|
83
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
84
|
+
>,
|
|
85
|
+
) {
|
|
86
|
+
this.publicChonkVerifier = publicChonkVerifierProofAndVk;
|
|
74
87
|
}
|
|
75
88
|
|
|
76
89
|
public setAvmProof(avmProofAndVk: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>) {
|
|
@@ -78,54 +91,47 @@ export class TxProvingState {
|
|
|
78
91
|
}
|
|
79
92
|
|
|
80
93
|
#getPrivateBaseInputs() {
|
|
81
|
-
if (!this.
|
|
82
|
-
throw new Error('
|
|
94
|
+
if (!(this.baseRollupHints instanceof PrivateBaseRollupHints)) {
|
|
95
|
+
throw new Error('Mismatched base rollup hints, expected private base rollup hints');
|
|
83
96
|
}
|
|
84
97
|
|
|
85
|
-
const
|
|
86
|
-
const tubeData = new PrivateTubeData(
|
|
98
|
+
const privateTailProofData = new ProofData(
|
|
87
99
|
this.processedTx.data.toPrivateToRollupKernelCircuitPublicInputs(),
|
|
88
|
-
this.
|
|
89
|
-
|
|
100
|
+
getChonkProofFromTx(this.processedTx),
|
|
101
|
+
getVkData('HidingKernelToRollup'),
|
|
90
102
|
);
|
|
91
103
|
|
|
92
|
-
|
|
93
|
-
throw new Error('Mismatched base rollup hints, expected private base rollup hints');
|
|
94
|
-
}
|
|
95
|
-
return new PrivateBaseRollupInputs(tubeData, this.baseRollupHints);
|
|
104
|
+
return new PrivateTxBaseRollupPrivateInputs(privateTailProofData, this.baseRollupHints);
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
#getPublicBaseInputs() {
|
|
99
108
|
if (!this.processedTx.avmProvingRequest) {
|
|
100
109
|
throw new Error('Should create private base rollup for a tx not requiring avm proof.');
|
|
101
110
|
}
|
|
102
|
-
if (!this.
|
|
103
|
-
throw new Error('Tx not ready for proving base rollup:
|
|
111
|
+
if (!this.publicChonkVerifier) {
|
|
112
|
+
throw new Error('Tx not ready for proving base rollup: public chonk verifier proof undefined');
|
|
104
113
|
}
|
|
105
114
|
if (!this.avm) {
|
|
106
115
|
throw new Error('Tx not ready for proving base rollup: avm proof undefined');
|
|
107
116
|
}
|
|
117
|
+
if (!(this.baseRollupHints instanceof PublicBaseRollupHints)) {
|
|
118
|
+
throw new Error('Mismatched base rollup hints, expected public base rollup hints');
|
|
119
|
+
}
|
|
108
120
|
|
|
109
|
-
const
|
|
110
|
-
this.processedTx.data.toPrivateToPublicKernelCircuitPublicInputs(),
|
|
111
|
-
this.tube.proof,
|
|
112
|
-
this.#getVkData(this.tube!.verificationKey, PUBLIC_TUBE_VK_INDEX),
|
|
113
|
-
);
|
|
121
|
+
const publicChonkVerifierProofData = toProofData(this.publicChonkVerifier);
|
|
114
122
|
|
|
115
|
-
const avmProofData = new
|
|
123
|
+
const avmProofData = new ProofData(
|
|
116
124
|
this.processedTx.avmProvingRequest.inputs.publicInputs,
|
|
117
125
|
this.avm.proof,
|
|
118
126
|
this.#getVkData(this.avm!.verificationKey, AVM_VK_INDEX),
|
|
119
127
|
);
|
|
120
128
|
|
|
121
|
-
|
|
122
|
-
throw new Error('Mismatched base rollup hints, expected public base rollup hints');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return new PublicBaseRollupInputs(tubeData, avmProofData, this.baseRollupHints);
|
|
129
|
+
return new PublicTxBaseRollupPrivateInputs(publicChonkVerifierProofData, avmProofData, this.baseRollupHints);
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
#getVkData(verificationKey: VerificationKeyData, vkIndex: number) {
|
|
133
|
+
// TODO(#17162): Add avm vk hash to the tree and call `getVkData('AVM')` instead.
|
|
134
|
+
// Below will return a path to an empty leaf.
|
|
129
135
|
const vkPath = getVKSiblingPath(vkIndex);
|
|
130
136
|
return new VkData(verificationKey, vkIndex, vkPath);
|
|
131
137
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { BatchedBlob, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
2
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import type { EthAddress
|
|
3
|
+
import type { EthAddress } from '@aztec/stdlib/block';
|
|
4
4
|
import type { EpochProver } from '@aztec/stdlib/interfaces/server';
|
|
5
5
|
import type { Proof } from '@aztec/stdlib/proofs';
|
|
6
|
-
import type { RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
7
|
-
import type { BlockHeader,
|
|
6
|
+
import type { CheckpointConstantData, RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
7
|
+
import type { BlockHeader, ProcessedTx, Tx } from '@aztec/stdlib/tx';
|
|
8
|
+
import type { UInt64 } from '@aztec/stdlib/types';
|
|
8
9
|
|
|
9
10
|
import type { ProvingOrchestrator } from '../orchestrator/orchestrator.js';
|
|
10
11
|
import type { BrokerCircuitProverFacade } from '../proving_broker/broker_prover_facade.js';
|
|
@@ -18,17 +19,33 @@ export class ServerEpochProver implements EpochProver {
|
|
|
18
19
|
|
|
19
20
|
startNewEpoch(
|
|
20
21
|
epochNumber: number,
|
|
21
|
-
|
|
22
|
-
totalNumBlocks: number,
|
|
22
|
+
totalNumCheckpoints: number,
|
|
23
23
|
finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
|
|
24
24
|
): void {
|
|
25
|
-
this.orchestrator.startNewEpoch(epochNumber,
|
|
25
|
+
this.orchestrator.startNewEpoch(epochNumber, totalNumCheckpoints, finalBlobBatchingChallenges);
|
|
26
26
|
this.facade.start();
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
startNewCheckpoint(
|
|
29
|
+
checkpointIndex: number,
|
|
30
|
+
constants: CheckpointConstantData,
|
|
31
|
+
l1ToL2Messages: Fr[],
|
|
32
|
+
totalNumBlocks: number,
|
|
33
|
+
totalNumBlobFields: number,
|
|
34
|
+
headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
35
|
+
): Promise<void> {
|
|
36
|
+
return this.orchestrator.startNewCheckpoint(
|
|
37
|
+
checkpointIndex,
|
|
38
|
+
constants,
|
|
39
|
+
l1ToL2Messages,
|
|
40
|
+
totalNumBlocks,
|
|
41
|
+
totalNumBlobFields,
|
|
42
|
+
headerOfLastBlockInPreviousCheckpoint,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
startChonkVerifierCircuits(txs: Tx[]): Promise<void> {
|
|
46
|
+
return this.orchestrator.startChonkVerifierCircuits(txs);
|
|
30
47
|
}
|
|
31
|
-
setBlockCompleted(blockNumber: number, expectedBlockHeader?: BlockHeader): Promise<
|
|
48
|
+
setBlockCompleted(blockNumber: number, expectedBlockHeader?: BlockHeader): Promise<BlockHeader> {
|
|
32
49
|
return this.orchestrator.setBlockCompleted(blockNumber, expectedBlockHeader);
|
|
33
50
|
}
|
|
34
51
|
finalizeEpoch(): Promise<{ publicInputs: RootRollupPublicInputs; proof: Proof; batchedBlobInputs: BatchedBlob }> {
|
|
@@ -40,19 +57,12 @@ export class ServerEpochProver implements EpochProver {
|
|
|
40
57
|
getProverId(): EthAddress {
|
|
41
58
|
return this.orchestrator.getProverId();
|
|
42
59
|
}
|
|
43
|
-
getBlock(index: number): L2Block {
|
|
44
|
-
return this.orchestrator.getBlock(index);
|
|
45
|
-
}
|
|
46
60
|
async stop(): Promise<void> {
|
|
47
61
|
await this.facade.stop();
|
|
48
62
|
await this.orchestrator.stop();
|
|
49
63
|
}
|
|
50
|
-
startNewBlock(
|
|
51
|
-
|
|
52
|
-
l1ToL2Messages: Fr[],
|
|
53
|
-
previousBlockHeader: BlockHeader,
|
|
54
|
-
): Promise<void> {
|
|
55
|
-
return this.orchestrator.startNewBlock(globalVariables, l1ToL2Messages, previousBlockHeader);
|
|
64
|
+
startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number): Promise<void> {
|
|
65
|
+
return this.orchestrator.startNewBlock(blockNumber, timestamp, totalNumTxs);
|
|
56
66
|
}
|
|
57
67
|
addTxs(txs: ProcessedTx[]): Promise<void> {
|
|
58
68
|
return this.orchestrator.addTxs(txs);
|
|
@@ -3,7 +3,6 @@ import type {
|
|
|
3
3
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
4
4
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
5
5
|
RECURSIVE_PROOF_LENGTH,
|
|
6
|
-
TUBE_PROOF_LENGTH,
|
|
7
6
|
} from '@aztec/constants';
|
|
8
7
|
import { sha256 } from '@aztec/foundation/crypto';
|
|
9
8
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -23,22 +22,29 @@ import {
|
|
|
23
22
|
type ServerCircuitProver,
|
|
24
23
|
makeProvingJobId,
|
|
25
24
|
} from '@aztec/stdlib/interfaces/server';
|
|
26
|
-
import type {
|
|
25
|
+
import type { ParityBasePrivateInputs, ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
27
26
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
28
27
|
import type {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
BlockMergeRollupPrivateInputs,
|
|
29
|
+
BlockRollupPublicInputs,
|
|
30
|
+
BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
31
|
+
BlockRootFirstRollupPrivateInputs,
|
|
32
|
+
BlockRootRollupPrivateInputs,
|
|
33
|
+
BlockRootSingleTxFirstRollupPrivateInputs,
|
|
34
|
+
BlockRootSingleTxRollupPrivateInputs,
|
|
35
|
+
CheckpointMergeRollupPrivateInputs,
|
|
36
|
+
CheckpointPaddingRollupPrivateInputs,
|
|
37
|
+
CheckpointRollupPublicInputs,
|
|
38
|
+
CheckpointRootRollupPrivateInputs,
|
|
39
|
+
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
40
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
41
|
+
PublicChonkVerifierPrivateInputs,
|
|
42
|
+
PublicChonkVerifierPublicInputs,
|
|
43
|
+
PublicTxBaseRollupPrivateInputs,
|
|
44
|
+
RootRollupPrivateInputs,
|
|
39
45
|
RootRollupPublicInputs,
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
TxMergeRollupPrivateInputs,
|
|
47
|
+
TxRollupPublicInputs,
|
|
42
48
|
} from '@aztec/stdlib/rollup';
|
|
43
49
|
|
|
44
50
|
import { InlineProofStore, type ProofStore } from './proof_store/index.js';
|
|
@@ -412,183 +418,248 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
412
418
|
}
|
|
413
419
|
|
|
414
420
|
getBaseParityProof(
|
|
415
|
-
inputs:
|
|
421
|
+
inputs: ParityBasePrivateInputs,
|
|
416
422
|
signal?: AbortSignal,
|
|
417
423
|
epochNumber?: number,
|
|
418
424
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>> {
|
|
419
425
|
return this.enqueueJob(
|
|
420
|
-
this.generateId(ProvingRequestType.
|
|
421
|
-
ProvingRequestType.
|
|
426
|
+
this.generateId(ProvingRequestType.PARITY_BASE, inputs, epochNumber),
|
|
427
|
+
ProvingRequestType.PARITY_BASE,
|
|
422
428
|
inputs,
|
|
423
429
|
epochNumber,
|
|
424
430
|
signal,
|
|
425
431
|
);
|
|
426
432
|
}
|
|
427
433
|
|
|
428
|
-
|
|
429
|
-
input:
|
|
434
|
+
getTxMergeRollupProof(
|
|
435
|
+
input: TxMergeRollupPrivateInputs,
|
|
430
436
|
signal?: AbortSignal,
|
|
431
437
|
epochNumber?: number,
|
|
432
|
-
): Promise<
|
|
433
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
434
|
-
> {
|
|
438
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
435
439
|
return this.enqueueJob(
|
|
436
|
-
this.generateId(ProvingRequestType.
|
|
437
|
-
ProvingRequestType.
|
|
440
|
+
this.generateId(ProvingRequestType.TX_MERGE_ROLLUP, input, epochNumber),
|
|
441
|
+
ProvingRequestType.TX_MERGE_ROLLUP,
|
|
438
442
|
input,
|
|
439
443
|
epochNumber,
|
|
440
444
|
signal,
|
|
441
445
|
);
|
|
442
446
|
}
|
|
443
447
|
|
|
444
|
-
|
|
445
|
-
|
|
448
|
+
getPublicChonkVerifierProof(
|
|
449
|
+
inputs: PublicChonkVerifierPrivateInputs,
|
|
446
450
|
signal?: AbortSignal,
|
|
447
451
|
epochNumber?: number,
|
|
448
452
|
): Promise<
|
|
449
|
-
PublicInputsAndRecursiveProof<
|
|
453
|
+
PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
450
454
|
> {
|
|
451
455
|
return this.enqueueJob(
|
|
452
|
-
this.generateId(ProvingRequestType.
|
|
453
|
-
ProvingRequestType.
|
|
456
|
+
this.generateId(ProvingRequestType.PUBLIC_CHONK_VERIFIER, inputs, epochNumber),
|
|
457
|
+
ProvingRequestType.PUBLIC_CHONK_VERIFIER,
|
|
458
|
+
inputs,
|
|
459
|
+
epochNumber,
|
|
460
|
+
signal,
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
getPrivateTxBaseRollupProof(
|
|
465
|
+
baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
466
|
+
signal?: AbortSignal,
|
|
467
|
+
epochNumber?: number,
|
|
468
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
469
|
+
return this.enqueueJob(
|
|
470
|
+
this.generateId(ProvingRequestType.PRIVATE_TX_BASE_ROLLUP, baseRollupInput, epochNumber),
|
|
471
|
+
ProvingRequestType.PRIVATE_TX_BASE_ROLLUP,
|
|
472
|
+
baseRollupInput,
|
|
473
|
+
epochNumber,
|
|
474
|
+
signal,
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
getPublicTxBaseRollupProof(
|
|
479
|
+
inputs: PublicTxBaseRollupPrivateInputs,
|
|
480
|
+
signal?: AbortSignal,
|
|
481
|
+
epochNumber?: number,
|
|
482
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
483
|
+
return this.enqueueJob(
|
|
484
|
+
this.generateId(ProvingRequestType.PUBLIC_TX_BASE_ROLLUP, inputs, epochNumber),
|
|
485
|
+
ProvingRequestType.PUBLIC_TX_BASE_ROLLUP,
|
|
486
|
+
inputs,
|
|
487
|
+
epochNumber,
|
|
488
|
+
signal,
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
getRootParityProof(
|
|
493
|
+
inputs: ParityRootPrivateInputs,
|
|
494
|
+
signal?: AbortSignal,
|
|
495
|
+
epochNumber?: number,
|
|
496
|
+
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>> {
|
|
497
|
+
return this.enqueueJob(
|
|
498
|
+
this.generateId(ProvingRequestType.PARITY_ROOT, inputs, epochNumber),
|
|
499
|
+
ProvingRequestType.PARITY_ROOT,
|
|
500
|
+
inputs,
|
|
501
|
+
epochNumber,
|
|
502
|
+
signal,
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
getBlockRootFirstRollupProof(
|
|
507
|
+
input: BlockRootFirstRollupPrivateInputs,
|
|
508
|
+
signal?: AbortSignal,
|
|
509
|
+
epochNumber?: number,
|
|
510
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
511
|
+
return this.enqueueJob(
|
|
512
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP, input, epochNumber),
|
|
513
|
+
ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP,
|
|
454
514
|
input,
|
|
455
515
|
epochNumber,
|
|
456
516
|
signal,
|
|
457
517
|
);
|
|
458
518
|
}
|
|
459
519
|
|
|
460
|
-
|
|
461
|
-
input:
|
|
520
|
+
getBlockRootSingleTxFirstRollupProof(
|
|
521
|
+
input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
462
522
|
signal?: AbortSignal,
|
|
463
523
|
epochNumber?: number,
|
|
464
|
-
): Promise<
|
|
465
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
466
|
-
> {
|
|
524
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
467
525
|
return this.enqueueJob(
|
|
468
|
-
this.generateId(ProvingRequestType.
|
|
469
|
-
ProvingRequestType.
|
|
526
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP, input, epochNumber),
|
|
527
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP,
|
|
470
528
|
input,
|
|
471
529
|
epochNumber,
|
|
472
530
|
signal,
|
|
473
531
|
);
|
|
474
532
|
}
|
|
475
533
|
|
|
476
|
-
|
|
477
|
-
input:
|
|
534
|
+
getBlockRootEmptyTxFirstRollupProof(
|
|
535
|
+
input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
478
536
|
signal?: AbortSignal,
|
|
479
537
|
epochNumber?: number,
|
|
480
|
-
): Promise<
|
|
481
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
482
|
-
> {
|
|
538
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
483
539
|
return this.enqueueJob(
|
|
484
|
-
this.generateId(ProvingRequestType.
|
|
485
|
-
ProvingRequestType.
|
|
540
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP, input, epochNumber),
|
|
541
|
+
ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP,
|
|
486
542
|
input,
|
|
487
543
|
epochNumber,
|
|
488
544
|
signal,
|
|
489
545
|
);
|
|
490
546
|
}
|
|
491
547
|
|
|
492
|
-
|
|
493
|
-
input:
|
|
548
|
+
getBlockRootRollupProof(
|
|
549
|
+
input: BlockRootRollupPrivateInputs,
|
|
494
550
|
signal?: AbortSignal,
|
|
495
551
|
epochNumber?: number,
|
|
496
|
-
): Promise<
|
|
497
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
498
|
-
> {
|
|
552
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
499
553
|
return this.enqueueJob(
|
|
500
|
-
this.generateId(ProvingRequestType.
|
|
501
|
-
ProvingRequestType.
|
|
554
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_ROLLUP, input, epochNumber),
|
|
555
|
+
ProvingRequestType.BLOCK_ROOT_ROLLUP,
|
|
502
556
|
input,
|
|
503
557
|
epochNumber,
|
|
504
558
|
signal,
|
|
505
559
|
);
|
|
506
560
|
}
|
|
507
561
|
|
|
508
|
-
|
|
509
|
-
input:
|
|
562
|
+
getBlockRootSingleTxRollupProof(
|
|
563
|
+
input: BlockRootSingleTxRollupPrivateInputs,
|
|
510
564
|
signal?: AbortSignal,
|
|
511
565
|
epochNumber?: number,
|
|
512
|
-
): Promise<
|
|
513
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
514
|
-
> {
|
|
566
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
515
567
|
return this.enqueueJob(
|
|
516
|
-
this.generateId(ProvingRequestType.
|
|
517
|
-
ProvingRequestType.
|
|
568
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP, input, epochNumber),
|
|
569
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP,
|
|
570
|
+
input,
|
|
571
|
+
epochNumber,
|
|
572
|
+
signal,
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
getBlockMergeRollupProof(
|
|
577
|
+
input: BlockMergeRollupPrivateInputs,
|
|
578
|
+
signal?: AbortSignal,
|
|
579
|
+
epochNumber?: number,
|
|
580
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
581
|
+
return this.enqueueJob(
|
|
582
|
+
this.generateId(ProvingRequestType.BLOCK_MERGE_ROLLUP, input, epochNumber),
|
|
583
|
+
ProvingRequestType.BLOCK_MERGE_ROLLUP,
|
|
518
584
|
input,
|
|
519
585
|
epochNumber,
|
|
520
586
|
signal,
|
|
521
587
|
);
|
|
522
588
|
}
|
|
523
|
-
|
|
524
|
-
|
|
589
|
+
|
|
590
|
+
getCheckpointRootRollupProof(
|
|
591
|
+
input: CheckpointRootRollupPrivateInputs,
|
|
525
592
|
signal?: AbortSignal,
|
|
526
593
|
epochNumber?: number,
|
|
527
594
|
): Promise<
|
|
528
|
-
PublicInputsAndRecursiveProof<
|
|
595
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
529
596
|
> {
|
|
530
597
|
return this.enqueueJob(
|
|
531
|
-
this.generateId(ProvingRequestType.
|
|
532
|
-
ProvingRequestType.
|
|
533
|
-
|
|
598
|
+
this.generateId(ProvingRequestType.CHECKPOINT_ROOT_ROLLUP, input, epochNumber),
|
|
599
|
+
ProvingRequestType.CHECKPOINT_ROOT_ROLLUP,
|
|
600
|
+
input,
|
|
534
601
|
epochNumber,
|
|
535
602
|
signal,
|
|
536
603
|
);
|
|
537
604
|
}
|
|
538
605
|
|
|
539
|
-
|
|
540
|
-
|
|
606
|
+
getCheckpointRootSingleBlockRollupProof(
|
|
607
|
+
input: CheckpointRootSingleBlockRollupPrivateInputs,
|
|
541
608
|
signal?: AbortSignal,
|
|
542
609
|
epochNumber?: number,
|
|
543
610
|
): Promise<
|
|
544
|
-
PublicInputsAndRecursiveProof<
|
|
611
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
545
612
|
> {
|
|
546
613
|
return this.enqueueJob(
|
|
547
|
-
this.generateId(ProvingRequestType.
|
|
548
|
-
ProvingRequestType.
|
|
549
|
-
|
|
614
|
+
this.generateId(ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP, input, epochNumber),
|
|
615
|
+
ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP,
|
|
616
|
+
input,
|
|
550
617
|
epochNumber,
|
|
551
618
|
signal,
|
|
552
619
|
);
|
|
553
620
|
}
|
|
554
621
|
|
|
555
|
-
|
|
556
|
-
|
|
622
|
+
getCheckpointPaddingRollupProof(
|
|
623
|
+
input: CheckpointPaddingRollupPrivateInputs,
|
|
557
624
|
signal?: AbortSignal,
|
|
558
625
|
epochNumber?: number,
|
|
559
|
-
): Promise<
|
|
626
|
+
): Promise<
|
|
627
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
628
|
+
> {
|
|
560
629
|
return this.enqueueJob(
|
|
561
|
-
this.generateId(ProvingRequestType.
|
|
562
|
-
ProvingRequestType.
|
|
563
|
-
|
|
630
|
+
this.generateId(ProvingRequestType.CHECKPOINT_PADDING_ROLLUP, input, epochNumber),
|
|
631
|
+
ProvingRequestType.CHECKPOINT_PADDING_ROLLUP,
|
|
632
|
+
input,
|
|
564
633
|
epochNumber,
|
|
565
634
|
signal,
|
|
566
635
|
);
|
|
567
636
|
}
|
|
568
637
|
|
|
569
|
-
|
|
570
|
-
input:
|
|
638
|
+
getCheckpointMergeRollupProof(
|
|
639
|
+
input: CheckpointMergeRollupPrivateInputs,
|
|
571
640
|
signal?: AbortSignal,
|
|
572
641
|
epochNumber?: number,
|
|
573
|
-
): Promise<
|
|
642
|
+
): Promise<
|
|
643
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
644
|
+
> {
|
|
574
645
|
return this.enqueueJob(
|
|
575
|
-
this.generateId(ProvingRequestType.
|
|
576
|
-
ProvingRequestType.
|
|
646
|
+
this.generateId(ProvingRequestType.CHECKPOINT_MERGE_ROLLUP, input, epochNumber),
|
|
647
|
+
ProvingRequestType.CHECKPOINT_MERGE_ROLLUP,
|
|
577
648
|
input,
|
|
578
649
|
epochNumber,
|
|
579
650
|
signal,
|
|
580
651
|
);
|
|
581
652
|
}
|
|
582
653
|
|
|
583
|
-
|
|
584
|
-
|
|
654
|
+
getRootRollupProof(
|
|
655
|
+
input: RootRollupPrivateInputs,
|
|
585
656
|
signal?: AbortSignal,
|
|
586
657
|
epochNumber?: number,
|
|
587
|
-
): Promise<
|
|
658
|
+
): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs, typeof RECURSIVE_PROOF_LENGTH>> {
|
|
588
659
|
return this.enqueueJob(
|
|
589
|
-
this.generateId(ProvingRequestType.
|
|
590
|
-
ProvingRequestType.
|
|
591
|
-
|
|
660
|
+
this.generateId(ProvingRequestType.ROOT_ROLLUP, input, epochNumber),
|
|
661
|
+
ProvingRequestType.ROOT_ROLLUP,
|
|
662
|
+
input,
|
|
592
663
|
epochNumber,
|
|
593
664
|
signal,
|
|
594
665
|
);
|
|
@@ -22,9 +22,9 @@ export const ProverBrokerConfig = z.object({
|
|
|
22
22
|
/** If starting a prover broker locally, the directory to store broker data */
|
|
23
23
|
dataDirectory: z.string().optional(),
|
|
24
24
|
/** The size of the data store map */
|
|
25
|
-
|
|
26
|
-
/** The size of the prover broker's database. Will override the
|
|
27
|
-
|
|
25
|
+
dataStoreMapSizeKb: z.number().int().nonnegative(),
|
|
26
|
+
/** The size of the prover broker's database. Will override the dataStoreMapSizeKb if set. */
|
|
27
|
+
proverBrokerStoreMapSizeKb: z.number().int().nonnegative().optional(),
|
|
28
28
|
/** The prover broker may batch jobs together before writing to the database */
|
|
29
29
|
proverBrokerBatchSize: z.number().int().nonnegative(),
|
|
30
30
|
/** How often the job batches get flushed */
|
|
@@ -34,7 +34,7 @@ export const ProverBrokerConfig = z.object({
|
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
export type ProverBrokerConfig = z.infer<typeof ProverBrokerConfig> &
|
|
37
|
-
Pick<DataStoreConfig, '
|
|
37
|
+
Pick<DataStoreConfig, 'dataStoreMapSizeKb' | 'dataDirectory'> &
|
|
38
38
|
L1ReaderConfig &
|
|
39
39
|
Pick<ChainConfig, 'rollupVersion'>;
|
|
40
40
|
|
|
@@ -69,10 +69,10 @@ export const proverBrokerConfigMappings: ConfigMappingsType<ProverBrokerConfig>
|
|
|
69
69
|
description: 'The maximum number of epochs to keep results for',
|
|
70
70
|
...numberConfigHelper(1),
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
proverBrokerStoreMapSizeKb: {
|
|
73
73
|
env: 'PROVER_BROKER_STORE_MAP_SIZE_KB',
|
|
74
74
|
parseEnv: (val: string | undefined) => (val ? +val : undefined),
|
|
75
|
-
description: "The size of the prover broker's database. Will override the
|
|
75
|
+
description: "The size of the prover broker's database. Will override the dataStoreMapSizeKb if set.",
|
|
76
76
|
},
|
|
77
77
|
...dataConfigMappings,
|
|
78
78
|
...l1ReaderConfigMappings,
|
|
@@ -111,7 +111,7 @@ export const proverAgentConfigMappings: ConfigMappingsType<ProverAgentConfig> =
|
|
|
111
111
|
proverAgentPollIntervalMs: {
|
|
112
112
|
env: 'PROVER_AGENT_POLL_INTERVAL_MS',
|
|
113
113
|
description: 'The interval agents poll for jobs at',
|
|
114
|
-
...numberConfigHelper(
|
|
114
|
+
...numberConfigHelper(1000),
|
|
115
115
|
},
|
|
116
116
|
proverAgentProofTypes: {
|
|
117
117
|
env: 'PROVER_AGENT_PROOF_TYPES',
|