@aztec/prover-client 3.0.0-canary.a9708bd → 3.0.0-devnet.2
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/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 +125 -81
- package/dest/orchestrator/orchestrator.d.ts +26 -25
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +350 -218
- 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 +8 -7
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +7 -7
- 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/mocks/fixtures.ts +39 -11
- package/src/mocks/test_context.ts +137 -31
- package/src/orchestrator/block-building-helpers.ts +213 -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 +169 -126
- package/src/orchestrator/orchestrator.ts +519 -286
- package/src/orchestrator/tx-proving-state.ts +45 -43
- package/src/prover-client/server-epoch-prover.ts +26 -16
- package/src/proving_broker/broker_prover_facade.ts +157 -88
- 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 -62
- 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,46 @@
|
|
|
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
|
+
PublicTubePublicInputs,
|
|
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 { getCivcProofFromTx, getPublicTubePrivateInputsFromTx, toProofData } from './block-building-helpers.js';
|
|
26
|
+
|
|
27
27
|
/**
|
|
28
28
|
* Helper class to manage the proving cycle of a transaction
|
|
29
29
|
* This includes the public VMs and the public kernels
|
|
30
30
|
* Also stores the inputs to the base rollup for this transaction and the tree snapshots
|
|
31
31
|
*/
|
|
32
32
|
export class TxProvingState {
|
|
33
|
-
private
|
|
33
|
+
private publicTube?: PublicInputsAndRecursiveProof<
|
|
34
|
+
PublicTubePublicInputs,
|
|
35
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
36
|
+
>;
|
|
34
37
|
private avm?: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>;
|
|
35
38
|
|
|
36
39
|
constructor(
|
|
37
40
|
public readonly processedTx: ProcessedTx,
|
|
38
41
|
private readonly baseRollupHints: BaseRollupHints,
|
|
39
42
|
public readonly treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot>,
|
|
43
|
+
private readonly proverId: Fr,
|
|
40
44
|
) {}
|
|
41
45
|
|
|
42
46
|
get requireAvmProof() {
|
|
@@ -44,33 +48,38 @@ export class TxProvingState {
|
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
public ready() {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public getTubeInputs() {
|
|
51
|
-
return new TubeInputs(!!this.processedTx.data.forPublic, this.processedTx.clientIvcProof);
|
|
51
|
+
return !this.requireAvmProof || (!!this.avm && !!this.publicTube);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
public getAvmInputs(): AvmCircuitInputs {
|
|
55
55
|
return this.processedTx.avmProvingRequest!.inputs;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
public getPublicTubePrivateInputs() {
|
|
59
|
+
return getPublicTubePrivateInputsFromTx(this.processedTx, this.proverId);
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
public getBaseRollupTypeAndInputs() {
|
|
59
63
|
if (this.requireAvmProof) {
|
|
60
64
|
return {
|
|
61
|
-
rollupType: '
|
|
65
|
+
rollupType: 'rollup-tx-base-public' satisfies CircuitName,
|
|
62
66
|
inputs: this.#getPublicBaseInputs(),
|
|
63
67
|
};
|
|
64
68
|
} else {
|
|
65
69
|
return {
|
|
66
|
-
rollupType: '
|
|
70
|
+
rollupType: 'rollup-tx-base-private' satisfies CircuitName,
|
|
67
71
|
inputs: this.#getPrivateBaseInputs(),
|
|
68
72
|
};
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
75
|
|
|
72
|
-
public
|
|
73
|
-
|
|
76
|
+
public setPublicTubeProof(
|
|
77
|
+
publicTubeProofAndVk: PublicInputsAndRecursiveProof<
|
|
78
|
+
PublicTubePublicInputs,
|
|
79
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
80
|
+
>,
|
|
81
|
+
) {
|
|
82
|
+
this.publicTube = publicTubeProofAndVk;
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
public setAvmProof(avmProofAndVk: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>) {
|
|
@@ -78,54 +87,47 @@ export class TxProvingState {
|
|
|
78
87
|
}
|
|
79
88
|
|
|
80
89
|
#getPrivateBaseInputs() {
|
|
81
|
-
if (!this.
|
|
82
|
-
throw new Error('
|
|
90
|
+
if (!(this.baseRollupHints instanceof PrivateBaseRollupHints)) {
|
|
91
|
+
throw new Error('Mismatched base rollup hints, expected private base rollup hints');
|
|
83
92
|
}
|
|
84
93
|
|
|
85
|
-
const
|
|
86
|
-
const tubeData = new PrivateTubeData(
|
|
94
|
+
const privateTailProofData = new ProofData(
|
|
87
95
|
this.processedTx.data.toPrivateToRollupKernelCircuitPublicInputs(),
|
|
88
|
-
this.
|
|
89
|
-
|
|
96
|
+
getCivcProofFromTx(this.processedTx),
|
|
97
|
+
getVkData('HidingKernelToRollup'),
|
|
90
98
|
);
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
throw new Error('Mismatched base rollup hints, expected private base rollup hints');
|
|
94
|
-
}
|
|
95
|
-
return new PrivateBaseRollupInputs(tubeData, this.baseRollupHints);
|
|
100
|
+
return new PrivateTxBaseRollupPrivateInputs(privateTailProofData, this.baseRollupHints);
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
#getPublicBaseInputs() {
|
|
99
104
|
if (!this.processedTx.avmProvingRequest) {
|
|
100
105
|
throw new Error('Should create private base rollup for a tx not requiring avm proof.');
|
|
101
106
|
}
|
|
102
|
-
if (!this.
|
|
103
|
-
throw new Error('Tx not ready for proving base rollup: tube proof undefined');
|
|
107
|
+
if (!this.publicTube) {
|
|
108
|
+
throw new Error('Tx not ready for proving base rollup: public tube proof undefined');
|
|
104
109
|
}
|
|
105
110
|
if (!this.avm) {
|
|
106
111
|
throw new Error('Tx not ready for proving base rollup: avm proof undefined');
|
|
107
112
|
}
|
|
113
|
+
if (!(this.baseRollupHints instanceof PublicBaseRollupHints)) {
|
|
114
|
+
throw new Error('Mismatched base rollup hints, expected public base rollup hints');
|
|
115
|
+
}
|
|
108
116
|
|
|
109
|
-
const
|
|
110
|
-
this.processedTx.data.toPrivateToPublicKernelCircuitPublicInputs(),
|
|
111
|
-
this.tube.proof,
|
|
112
|
-
this.#getVkData(this.tube!.verificationKey, PUBLIC_TUBE_VK_INDEX),
|
|
113
|
-
);
|
|
117
|
+
const publicTubeProofData = toProofData(this.publicTube);
|
|
114
118
|
|
|
115
|
-
const avmProofData = new
|
|
119
|
+
const avmProofData = new ProofData(
|
|
116
120
|
this.processedTx.avmProvingRequest.inputs.publicInputs,
|
|
117
121
|
this.avm.proof,
|
|
118
122
|
this.#getVkData(this.avm!.verificationKey, AVM_VK_INDEX),
|
|
119
123
|
);
|
|
120
124
|
|
|
121
|
-
|
|
122
|
-
throw new Error('Mismatched base rollup hints, expected public base rollup hints');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return new PublicBaseRollupInputs(tubeData, avmProofData, this.baseRollupHints);
|
|
125
|
+
return new PublicTxBaseRollupPrivateInputs(publicTubeProofData, avmProofData, this.baseRollupHints);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
#getVkData(verificationKey: VerificationKeyData, vkIndex: number) {
|
|
129
|
+
// TODO(#17162): Add avm vk hash to the tree and call `getVkData('AVM')` instead.
|
|
130
|
+
// Below will return a path to an empty leaf.
|
|
129
131
|
const vkPath = getVKSiblingPath(vkIndex);
|
|
130
132
|
return new VkData(verificationKey, vkIndex, vkPath);
|
|
131
133
|
}
|
|
@@ -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
|
+
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
|
+
}
|
|
28
45
|
startTubeCircuits(txs: Tx[]): Promise<void> {
|
|
29
46
|
return this.orchestrator.startTubeCircuits(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
|
+
PublicTubePrivateInputs,
|
|
42
|
+
PublicTubePublicInputs,
|
|
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,246 @@ 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
|
+
getPublicTubeProof(
|
|
449
|
+
inputs: PublicTubePrivateInputs,
|
|
446
450
|
signal?: AbortSignal,
|
|
447
451
|
epochNumber?: number,
|
|
448
|
-
): Promise<
|
|
449
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
450
|
-
> {
|
|
452
|
+
): Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
451
453
|
return this.enqueueJob(
|
|
452
|
-
this.generateId(ProvingRequestType.
|
|
453
|
-
ProvingRequestType.
|
|
454
|
+
this.generateId(ProvingRequestType.PUBLIC_TUBE, inputs, epochNumber),
|
|
455
|
+
ProvingRequestType.PUBLIC_TUBE,
|
|
456
|
+
inputs,
|
|
457
|
+
epochNumber,
|
|
458
|
+
signal,
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
getPrivateTxBaseRollupProof(
|
|
463
|
+
baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
464
|
+
signal?: AbortSignal,
|
|
465
|
+
epochNumber?: number,
|
|
466
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
467
|
+
return this.enqueueJob(
|
|
468
|
+
this.generateId(ProvingRequestType.PRIVATE_TX_BASE_ROLLUP, baseRollupInput, epochNumber),
|
|
469
|
+
ProvingRequestType.PRIVATE_TX_BASE_ROLLUP,
|
|
470
|
+
baseRollupInput,
|
|
471
|
+
epochNumber,
|
|
472
|
+
signal,
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
getPublicTxBaseRollupProof(
|
|
477
|
+
inputs: PublicTxBaseRollupPrivateInputs,
|
|
478
|
+
signal?: AbortSignal,
|
|
479
|
+
epochNumber?: number,
|
|
480
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
481
|
+
return this.enqueueJob(
|
|
482
|
+
this.generateId(ProvingRequestType.PUBLIC_TX_BASE_ROLLUP, inputs, epochNumber),
|
|
483
|
+
ProvingRequestType.PUBLIC_TX_BASE_ROLLUP,
|
|
484
|
+
inputs,
|
|
485
|
+
epochNumber,
|
|
486
|
+
signal,
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
getRootParityProof(
|
|
491
|
+
inputs: ParityRootPrivateInputs,
|
|
492
|
+
signal?: AbortSignal,
|
|
493
|
+
epochNumber?: number,
|
|
494
|
+
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>> {
|
|
495
|
+
return this.enqueueJob(
|
|
496
|
+
this.generateId(ProvingRequestType.PARITY_ROOT, inputs, epochNumber),
|
|
497
|
+
ProvingRequestType.PARITY_ROOT,
|
|
498
|
+
inputs,
|
|
499
|
+
epochNumber,
|
|
500
|
+
signal,
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
getBlockRootFirstRollupProof(
|
|
505
|
+
input: BlockRootFirstRollupPrivateInputs,
|
|
506
|
+
signal?: AbortSignal,
|
|
507
|
+
epochNumber?: number,
|
|
508
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
509
|
+
return this.enqueueJob(
|
|
510
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP, input, epochNumber),
|
|
511
|
+
ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP,
|
|
454
512
|
input,
|
|
455
513
|
epochNumber,
|
|
456
514
|
signal,
|
|
457
515
|
);
|
|
458
516
|
}
|
|
459
517
|
|
|
460
|
-
|
|
461
|
-
input:
|
|
518
|
+
getBlockRootSingleTxFirstRollupProof(
|
|
519
|
+
input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
462
520
|
signal?: AbortSignal,
|
|
463
521
|
epochNumber?: number,
|
|
464
|
-
): Promise<
|
|
465
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
466
|
-
> {
|
|
522
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
467
523
|
return this.enqueueJob(
|
|
468
|
-
this.generateId(ProvingRequestType.
|
|
469
|
-
ProvingRequestType.
|
|
524
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP, input, epochNumber),
|
|
525
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP,
|
|
470
526
|
input,
|
|
471
527
|
epochNumber,
|
|
472
528
|
signal,
|
|
473
529
|
);
|
|
474
530
|
}
|
|
475
531
|
|
|
476
|
-
|
|
477
|
-
input:
|
|
532
|
+
getBlockRootEmptyTxFirstRollupProof(
|
|
533
|
+
input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
478
534
|
signal?: AbortSignal,
|
|
479
535
|
epochNumber?: number,
|
|
480
|
-
): Promise<
|
|
481
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
482
|
-
> {
|
|
536
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
483
537
|
return this.enqueueJob(
|
|
484
|
-
this.generateId(ProvingRequestType.
|
|
485
|
-
ProvingRequestType.
|
|
538
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP, input, epochNumber),
|
|
539
|
+
ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP,
|
|
486
540
|
input,
|
|
487
541
|
epochNumber,
|
|
488
542
|
signal,
|
|
489
543
|
);
|
|
490
544
|
}
|
|
491
545
|
|
|
492
|
-
|
|
493
|
-
input:
|
|
546
|
+
getBlockRootRollupProof(
|
|
547
|
+
input: BlockRootRollupPrivateInputs,
|
|
494
548
|
signal?: AbortSignal,
|
|
495
549
|
epochNumber?: number,
|
|
496
|
-
): Promise<
|
|
497
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
498
|
-
> {
|
|
550
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
499
551
|
return this.enqueueJob(
|
|
500
|
-
this.generateId(ProvingRequestType.
|
|
501
|
-
ProvingRequestType.
|
|
552
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_ROLLUP, input, epochNumber),
|
|
553
|
+
ProvingRequestType.BLOCK_ROOT_ROLLUP,
|
|
502
554
|
input,
|
|
503
555
|
epochNumber,
|
|
504
556
|
signal,
|
|
505
557
|
);
|
|
506
558
|
}
|
|
507
559
|
|
|
508
|
-
|
|
509
|
-
input:
|
|
560
|
+
getBlockRootSingleTxRollupProof(
|
|
561
|
+
input: BlockRootSingleTxRollupPrivateInputs,
|
|
510
562
|
signal?: AbortSignal,
|
|
511
563
|
epochNumber?: number,
|
|
512
|
-
): Promise<
|
|
513
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
514
|
-
> {
|
|
564
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
515
565
|
return this.enqueueJob(
|
|
516
|
-
this.generateId(ProvingRequestType.
|
|
517
|
-
ProvingRequestType.
|
|
566
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP, input, epochNumber),
|
|
567
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP,
|
|
518
568
|
input,
|
|
519
569
|
epochNumber,
|
|
520
570
|
signal,
|
|
521
571
|
);
|
|
522
572
|
}
|
|
523
|
-
|
|
524
|
-
|
|
573
|
+
|
|
574
|
+
getBlockMergeRollupProof(
|
|
575
|
+
input: BlockMergeRollupPrivateInputs,
|
|
576
|
+
signal?: AbortSignal,
|
|
577
|
+
epochNumber?: number,
|
|
578
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
579
|
+
return this.enqueueJob(
|
|
580
|
+
this.generateId(ProvingRequestType.BLOCK_MERGE_ROLLUP, input, epochNumber),
|
|
581
|
+
ProvingRequestType.BLOCK_MERGE_ROLLUP,
|
|
582
|
+
input,
|
|
583
|
+
epochNumber,
|
|
584
|
+
signal,
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
getCheckpointRootRollupProof(
|
|
589
|
+
input: CheckpointRootRollupPrivateInputs,
|
|
525
590
|
signal?: AbortSignal,
|
|
526
591
|
epochNumber?: number,
|
|
527
592
|
): Promise<
|
|
528
|
-
PublicInputsAndRecursiveProof<
|
|
593
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
529
594
|
> {
|
|
530
595
|
return this.enqueueJob(
|
|
531
|
-
this.generateId(ProvingRequestType.
|
|
532
|
-
ProvingRequestType.
|
|
533
|
-
|
|
596
|
+
this.generateId(ProvingRequestType.CHECKPOINT_ROOT_ROLLUP, input, epochNumber),
|
|
597
|
+
ProvingRequestType.CHECKPOINT_ROOT_ROLLUP,
|
|
598
|
+
input,
|
|
534
599
|
epochNumber,
|
|
535
600
|
signal,
|
|
536
601
|
);
|
|
537
602
|
}
|
|
538
603
|
|
|
539
|
-
|
|
540
|
-
|
|
604
|
+
getCheckpointRootSingleBlockRollupProof(
|
|
605
|
+
input: CheckpointRootSingleBlockRollupPrivateInputs,
|
|
541
606
|
signal?: AbortSignal,
|
|
542
607
|
epochNumber?: number,
|
|
543
608
|
): Promise<
|
|
544
|
-
PublicInputsAndRecursiveProof<
|
|
609
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
545
610
|
> {
|
|
546
611
|
return this.enqueueJob(
|
|
547
|
-
this.generateId(ProvingRequestType.
|
|
548
|
-
ProvingRequestType.
|
|
549
|
-
|
|
612
|
+
this.generateId(ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP, input, epochNumber),
|
|
613
|
+
ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP,
|
|
614
|
+
input,
|
|
550
615
|
epochNumber,
|
|
551
616
|
signal,
|
|
552
617
|
);
|
|
553
618
|
}
|
|
554
619
|
|
|
555
|
-
|
|
556
|
-
|
|
620
|
+
getCheckpointPaddingRollupProof(
|
|
621
|
+
input: CheckpointPaddingRollupPrivateInputs,
|
|
557
622
|
signal?: AbortSignal,
|
|
558
623
|
epochNumber?: number,
|
|
559
|
-
): Promise<
|
|
624
|
+
): Promise<
|
|
625
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
626
|
+
> {
|
|
560
627
|
return this.enqueueJob(
|
|
561
|
-
this.generateId(ProvingRequestType.
|
|
562
|
-
ProvingRequestType.
|
|
563
|
-
|
|
628
|
+
this.generateId(ProvingRequestType.CHECKPOINT_PADDING_ROLLUP, input, epochNumber),
|
|
629
|
+
ProvingRequestType.CHECKPOINT_PADDING_ROLLUP,
|
|
630
|
+
input,
|
|
564
631
|
epochNumber,
|
|
565
632
|
signal,
|
|
566
633
|
);
|
|
567
634
|
}
|
|
568
635
|
|
|
569
|
-
|
|
570
|
-
input:
|
|
636
|
+
getCheckpointMergeRollupProof(
|
|
637
|
+
input: CheckpointMergeRollupPrivateInputs,
|
|
571
638
|
signal?: AbortSignal,
|
|
572
639
|
epochNumber?: number,
|
|
573
|
-
): Promise<
|
|
640
|
+
): Promise<
|
|
641
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
642
|
+
> {
|
|
574
643
|
return this.enqueueJob(
|
|
575
|
-
this.generateId(ProvingRequestType.
|
|
576
|
-
ProvingRequestType.
|
|
644
|
+
this.generateId(ProvingRequestType.CHECKPOINT_MERGE_ROLLUP, input, epochNumber),
|
|
645
|
+
ProvingRequestType.CHECKPOINT_MERGE_ROLLUP,
|
|
577
646
|
input,
|
|
578
647
|
epochNumber,
|
|
579
648
|
signal,
|
|
580
649
|
);
|
|
581
650
|
}
|
|
582
651
|
|
|
583
|
-
|
|
584
|
-
|
|
652
|
+
getRootRollupProof(
|
|
653
|
+
input: RootRollupPrivateInputs,
|
|
585
654
|
signal?: AbortSignal,
|
|
586
655
|
epochNumber?: number,
|
|
587
|
-
): Promise<
|
|
656
|
+
): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs, typeof RECURSIVE_PROOF_LENGTH>> {
|
|
588
657
|
return this.enqueueJob(
|
|
589
|
-
this.generateId(ProvingRequestType.
|
|
590
|
-
ProvingRequestType.
|
|
591
|
-
|
|
658
|
+
this.generateId(ProvingRequestType.ROOT_ROLLUP, input, epochNumber),
|
|
659
|
+
ProvingRequestType.ROOT_ROLLUP,
|
|
660
|
+
input,
|
|
592
661
|
epochNumber,
|
|
593
662
|
signal,
|
|
594
663
|
);
|
|
@@ -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',
|