@aztec/prover-client 0.56.0 → 0.58.0
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/config.d.ts +4 -5
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +11 -2
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/mocks/fixtures.d.ts +6 -6
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +8 -4
- package/dest/mocks/test_context.d.ts +7 -7
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +15 -18
- package/dest/orchestrator/block-building-helpers.d.ts +12 -12
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +4 -2
- package/dest/orchestrator/block-proving-state.d.ts +7 -7
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +11 -33
- package/dest/orchestrator/epoch-proving-state.d.ts +8 -2
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +8 -16
- package/dest/orchestrator/orchestrator.d.ts +15 -19
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +161 -106
- package/dest/prover-agent/memory-proving-queue.d.ts +5 -8
- package/dest/prover-agent/memory-proving-queue.d.ts.map +1 -1
- package/dest/prover-agent/memory-proving-queue.js +3 -3
- package/dest/prover-agent/prover-agent.js +4 -4
- package/dest/prover-agent/rpc.js +4 -4
- package/dest/test/mock_prover.d.ts +10 -16
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +18 -24
- package/dest/tx-prover/tx-prover.d.ts +3 -4
- package/dest/tx-prover/tx-prover.d.ts.map +1 -1
- package/dest/tx-prover/tx-prover.js +2 -2
- package/package.json +14 -10
- package/src/config.ts +20 -11
- package/src/index.ts +1 -1
- package/src/mocks/fixtures.ts +21 -7
- package/src/mocks/test_context.ts +26 -22
- package/src/orchestrator/block-building-helpers.ts +21 -12
- package/src/orchestrator/block-proving-state.ts +11 -35
- package/src/orchestrator/epoch-proving-state.ts +9 -20
- package/src/orchestrator/orchestrator.ts +205 -140
- package/src/prover-agent/memory-proving-queue.ts +8 -7
- package/src/prover-agent/prover-agent.ts +4 -4
- package/src/prover-agent/rpc.ts +3 -3
- package/src/test/mock_prover.ts +26 -28
- package/src/tx-prover/tx-prover.ts +5 -5
package/src/prover-agent/rpc.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ProvingJobSource } from '@aztec/circuit-types';
|
|
2
2
|
import {
|
|
3
3
|
AvmCircuitInputs,
|
|
4
|
-
AvmVerificationKeyData,
|
|
5
4
|
AztecAddress,
|
|
6
5
|
BaseOrMergeRollupPublicInputs,
|
|
7
6
|
BaseParityInputs,
|
|
@@ -9,6 +8,7 @@ import {
|
|
|
9
8
|
BlockMergeRollupInputs,
|
|
10
9
|
BlockRootOrBlockMergePublicInputs,
|
|
11
10
|
BlockRootRollupInputs,
|
|
11
|
+
EmptyBlockRootRollupInputs,
|
|
12
12
|
EthAddress,
|
|
13
13
|
Fr,
|
|
14
14
|
Header,
|
|
@@ -40,7 +40,6 @@ export function createProvingJobSourceServer(queue: ProvingJobSource): JsonRpcSe
|
|
|
40
40
|
return new JsonRpcServer(
|
|
41
41
|
queue,
|
|
42
42
|
{
|
|
43
|
-
AvmVerificationKeyData,
|
|
44
43
|
AvmCircuitInputs,
|
|
45
44
|
BaseOrMergeRollupPublicInputs,
|
|
46
45
|
BaseParityInputs,
|
|
@@ -68,6 +67,7 @@ export function createProvingJobSourceServer(queue: ProvingJobSource): JsonRpcSe
|
|
|
68
67
|
BlockRootOrBlockMergePublicInputs,
|
|
69
68
|
BlockMergeRollupInputs,
|
|
70
69
|
BlockRootRollupInputs,
|
|
70
|
+
EmptyBlockRootRollupInputs,
|
|
71
71
|
},
|
|
72
72
|
{},
|
|
73
73
|
);
|
|
@@ -81,7 +81,6 @@ export function createProvingJobSourceClient(
|
|
|
81
81
|
return createJsonRpcClient(
|
|
82
82
|
url,
|
|
83
83
|
{
|
|
84
|
-
AvmVerificationKeyData,
|
|
85
84
|
AvmCircuitInputs,
|
|
86
85
|
BaseOrMergeRollupPublicInputs,
|
|
87
86
|
BaseParityInputs,
|
|
@@ -109,6 +108,7 @@ export function createProvingJobSourceClient(
|
|
|
109
108
|
BlockRootOrBlockMergePublicInputs,
|
|
110
109
|
BlockMergeRollupInputs,
|
|
111
110
|
BlockRootRollupInputs,
|
|
111
|
+
EmptyBlockRootRollupInputs,
|
|
112
112
|
},
|
|
113
113
|
{},
|
|
114
114
|
false,
|
package/src/test/mock_prover.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type ProofAndVerificationKey,
|
|
2
3
|
type PublicInputsAndRecursiveProof,
|
|
3
|
-
type PublicInputsAndTubeProof,
|
|
4
4
|
type ServerCircuitProver,
|
|
5
|
+
makeProofAndVerificationKey,
|
|
5
6
|
makePublicInputsAndRecursiveProof,
|
|
6
7
|
} from '@aztec/circuit-types';
|
|
7
8
|
import {
|
|
8
|
-
|
|
9
|
+
AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS,
|
|
9
10
|
type BaseOrMergeRollupPublicInputs,
|
|
10
11
|
type BlockRootOrBlockMergePublicInputs,
|
|
11
12
|
type KernelCircuitPublicInputs,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
RECURSIVE_PROOF_LENGTH,
|
|
14
15
|
type RecursiveProof,
|
|
15
16
|
type RootRollupPublicInputs,
|
|
17
|
+
TUBE_PROOF_LENGTH,
|
|
16
18
|
type VMCircuitPublicInputs,
|
|
17
19
|
VerificationKeyData,
|
|
18
20
|
makeEmptyProof,
|
|
@@ -33,10 +35,10 @@ export class MockProver implements ServerCircuitProver {
|
|
|
33
35
|
|
|
34
36
|
getAvmProof() {
|
|
35
37
|
return Promise.resolve(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
makeProofAndVerificationKey(
|
|
39
|
+
makeEmptyProof(),
|
|
40
|
+
VerificationKeyData.makeFake(AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS),
|
|
41
|
+
),
|
|
40
42
|
);
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -53,7 +55,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
53
55
|
makePublicInputsAndRecursiveProof(
|
|
54
56
|
makeBaseOrMergeRollupPublicInputs(),
|
|
55
57
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
56
|
-
VerificationKeyData.
|
|
58
|
+
VerificationKeyData.makeFakeHonk(),
|
|
57
59
|
),
|
|
58
60
|
);
|
|
59
61
|
}
|
|
@@ -63,7 +65,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
63
65
|
makePublicInputsAndRecursiveProof(
|
|
64
66
|
makeBaseOrMergeRollupPublicInputs(),
|
|
65
67
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
66
|
-
VerificationKeyData.
|
|
68
|
+
VerificationKeyData.makeFakeHonk(),
|
|
67
69
|
),
|
|
68
70
|
);
|
|
69
71
|
}
|
|
@@ -73,27 +75,27 @@ export class MockProver implements ServerCircuitProver {
|
|
|
73
75
|
makePublicInputsAndRecursiveProof(
|
|
74
76
|
makeBlockRootOrBlockMergeRollupPublicInputs(),
|
|
75
77
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
76
|
-
VerificationKeyData.
|
|
78
|
+
VerificationKeyData.makeFakeHonk(),
|
|
77
79
|
),
|
|
78
80
|
);
|
|
79
81
|
}
|
|
80
82
|
|
|
81
|
-
|
|
83
|
+
getEmptyBlockRootRollupProof(): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs>> {
|
|
82
84
|
return Promise.resolve(
|
|
83
85
|
makePublicInputsAndRecursiveProof(
|
|
84
86
|
makeBlockRootOrBlockMergeRollupPublicInputs(),
|
|
85
87
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
86
|
-
VerificationKeyData.
|
|
88
|
+
VerificationKeyData.makeFakeHonk(),
|
|
87
89
|
),
|
|
88
90
|
);
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
getBlockRootRollupProof(): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs>> {
|
|
92
94
|
return Promise.resolve(
|
|
93
95
|
makePublicInputsAndRecursiveProof(
|
|
94
96
|
makeBlockRootOrBlockMergeRollupPublicInputs(),
|
|
95
97
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
96
|
-
VerificationKeyData.
|
|
98
|
+
VerificationKeyData.makeFakeHonk(),
|
|
97
99
|
),
|
|
98
100
|
);
|
|
99
101
|
}
|
|
@@ -103,17 +105,17 @@ export class MockProver implements ServerCircuitProver {
|
|
|
103
105
|
makePublicInputsAndRecursiveProof(
|
|
104
106
|
makeKernelCircuitPublicInputs(),
|
|
105
107
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
106
|
-
VerificationKeyData.
|
|
108
|
+
VerificationKeyData.makeFakeHonk(),
|
|
107
109
|
),
|
|
108
110
|
);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
|
-
getEmptyTubeProof(): Promise<
|
|
113
|
+
getEmptyTubeProof(): Promise<PublicInputsAndRecursiveProof<KernelCircuitPublicInputs>> {
|
|
112
114
|
return Promise.resolve(
|
|
113
115
|
makePublicInputsAndRecursiveProof(
|
|
114
116
|
makeKernelCircuitPublicInputs(),
|
|
115
117
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
116
|
-
VerificationKeyData.
|
|
118
|
+
VerificationKeyData.makeFakeHonk(),
|
|
117
119
|
),
|
|
118
120
|
);
|
|
119
121
|
}
|
|
@@ -123,7 +125,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
123
125
|
makePublicInputsAndRecursiveProof(
|
|
124
126
|
makeVMCircuitPublicInputs(),
|
|
125
127
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
126
|
-
VerificationKeyData.
|
|
128
|
+
VerificationKeyData.makeFakeHonk(),
|
|
127
129
|
),
|
|
128
130
|
);
|
|
129
131
|
}
|
|
@@ -133,7 +135,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
133
135
|
makePublicInputsAndRecursiveProof(
|
|
134
136
|
makePublicKernelCircuitPublicInputs(),
|
|
135
137
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
136
|
-
VerificationKeyData.
|
|
138
|
+
VerificationKeyData.makeFakeHonk(),
|
|
137
139
|
),
|
|
138
140
|
);
|
|
139
141
|
}
|
|
@@ -143,7 +145,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
143
145
|
makePublicInputsAndRecursiveProof(
|
|
144
146
|
makeKernelCircuitPublicInputs(),
|
|
145
147
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
146
|
-
VerificationKeyData.
|
|
148
|
+
VerificationKeyData.makeFakeHonk(),
|
|
147
149
|
),
|
|
148
150
|
);
|
|
149
151
|
}
|
|
@@ -153,18 +155,14 @@ export class MockProver implements ServerCircuitProver {
|
|
|
153
155
|
makePublicInputsAndRecursiveProof(
|
|
154
156
|
makeRootRollupPublicInputs(),
|
|
155
157
|
makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
156
|
-
VerificationKeyData.
|
|
158
|
+
VerificationKeyData.makeFakeHonk(),
|
|
157
159
|
),
|
|
158
160
|
);
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
getTubeProof(): Promise<{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return Promise.resolve({
|
|
166
|
-
tubeVK: VerificationKeyData.makeFake(),
|
|
167
|
-
tubeProof: makeRecursiveProof(RECURSIVE_PROOF_LENGTH),
|
|
168
|
-
});
|
|
163
|
+
getTubeProof(): Promise<ProofAndVerificationKey<RecursiveProof<typeof TUBE_PROOF_LENGTH>>> {
|
|
164
|
+
return Promise.resolve(
|
|
165
|
+
makeProofAndVerificationKey(makeRecursiveProof(TUBE_PROOF_LENGTH), VerificationKeyData.makeFake()),
|
|
166
|
+
);
|
|
169
167
|
}
|
|
170
168
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BBNativeRollupProver, TestCircuitProver } from '@aztec/bb-prover';
|
|
2
2
|
import {
|
|
3
|
-
type
|
|
4
|
-
type
|
|
3
|
+
type EpochProver,
|
|
4
|
+
type EpochProverManager,
|
|
5
|
+
type MerkleTreeWriteOperations,
|
|
5
6
|
type ProvingJobSource,
|
|
6
7
|
type ServerCircuitProver,
|
|
7
8
|
} from '@aztec/circuit-types/interfaces';
|
|
8
9
|
import { Fr } from '@aztec/circuits.js';
|
|
9
10
|
import { NativeACVMSimulator } from '@aztec/simulator';
|
|
10
11
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
11
|
-
import { type MerkleTreeOperations } from '@aztec/world-state';
|
|
12
12
|
|
|
13
13
|
import { type ProverClientConfig } from '../config.js';
|
|
14
14
|
import { ProvingOrchestrator } from '../orchestrator/orchestrator.js';
|
|
@@ -19,7 +19,7 @@ import { ProverAgent } from '../prover-agent/prover-agent.js';
|
|
|
19
19
|
* A prover factory.
|
|
20
20
|
* TODO(palla/prover-node): Rename this class
|
|
21
21
|
*/
|
|
22
|
-
export class TxProver implements
|
|
22
|
+
export class TxProver implements EpochProverManager {
|
|
23
23
|
private queue: MemoryProvingQueue;
|
|
24
24
|
private running = false;
|
|
25
25
|
|
|
@@ -33,7 +33,7 @@ export class TxProver implements ProverClient {
|
|
|
33
33
|
this.queue = new MemoryProvingQueue(telemetry, config.proverJobTimeoutMs, config.proverJobPollIntervalMs);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
public
|
|
36
|
+
public createEpochProver(db: MerkleTreeWriteOperations): EpochProver {
|
|
37
37
|
return new ProvingOrchestrator(db, this.queue, this.telemetry, this.config.proverId);
|
|
38
38
|
}
|
|
39
39
|
|