@aztec/prover-client 0.0.1-commit.2448fdb → 0.0.1-commit.2606882
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 +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +16 -2
- package/dest/light/lightweight_checkpoint_builder.d.ts +5 -2
- package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -1
- package/dest/light/lightweight_checkpoint_builder.js +33 -11
- package/dest/mocks/test_context.d.ts +3 -1
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +13 -7
- package/dest/orchestrator/block-building-helpers.d.ts +1 -1
- package/dest/orchestrator/checkpoint-proving-state.d.ts +8 -1
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +10 -1
- package/dest/orchestrator/checkpoint-sub-tree-orchestrator.d.ts +107 -0
- package/dest/orchestrator/checkpoint-sub-tree-orchestrator.d.ts.map +1 -0
- package/dest/orchestrator/checkpoint-sub-tree-orchestrator.js +151 -0
- package/dest/orchestrator/epoch-proving-context.d.ts +51 -0
- package/dest/orchestrator/epoch-proving-context.d.ts.map +1 -0
- package/dest/orchestrator/epoch-proving-context.js +81 -0
- package/dest/orchestrator/epoch-proving-state.d.ts +1 -1
- package/dest/orchestrator/index.d.ts +4 -1
- package/dest/orchestrator/index.d.ts.map +1 -1
- package/dest/orchestrator/index.js +3 -0
- package/dest/orchestrator/orchestrator.d.ts +14 -26
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +32 -169
- package/dest/orchestrator/proving-scheduler.d.ts +72 -0
- package/dest/orchestrator/proving-scheduler.d.ts.map +1 -0
- package/dest/orchestrator/proving-scheduler.js +117 -0
- package/dest/orchestrator/top-tree-orchestrator.d.ts +83 -0
- package/dest/orchestrator/top-tree-orchestrator.d.ts.map +1 -0
- package/dest/orchestrator/top-tree-orchestrator.js +182 -0
- package/dest/orchestrator/top-tree-proving-scheduler.d.ts +62 -0
- package/dest/orchestrator/top-tree-proving-scheduler.d.ts.map +1 -0
- package/dest/orchestrator/top-tree-proving-scheduler.js +73 -0
- package/dest/orchestrator/top-tree-proving-state.d.ts +61 -0
- package/dest/orchestrator/top-tree-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/top-tree-proving-state.js +185 -0
- package/dest/prover-client/prover-client.d.ts +61 -2
- package/dest/prover-client/prover-client.d.ts.map +1 -1
- package/dest/prover-client/prover-client.js +49 -1
- package/dest/proving_broker/broker_prover_facade.d.ts +1 -1
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +10 -16
- package/dest/proving_broker/config.d.ts +9 -73
- package/dest/proving_broker/config.d.ts.map +1 -1
- package/dest/proving_broker/config.js +3 -3
- package/dest/proving_broker/index.d.ts +2 -1
- package/dest/proving_broker/index.d.ts.map +1 -1
- package/dest/proving_broker/index.js +1 -0
- package/dest/proving_broker/proving_broker.d.ts +2 -2
- package/dest/proving_broker/proving_broker.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +32 -7
- package/dest/proving_broker/proving_broker_database/persisted.js +2 -2
- package/dest/proving_broker/rpc.d.ts +1 -1
- package/dest/proving_broker/rpc.d.ts.map +1 -1
- package/dest/proving_broker/rpc.js +64 -9
- package/dest/test/mock_prover.d.ts +3 -3
- package/package.json +18 -18
- package/src/config.ts +18 -2
- package/src/light/lightweight_checkpoint_builder.ts +35 -20
- package/src/mocks/test_context.ts +11 -8
- package/src/orchestrator/checkpoint-proving-state.ts +14 -1
- package/src/orchestrator/checkpoint-sub-tree-orchestrator.ts +271 -0
- package/src/orchestrator/epoch-proving-context.ts +101 -0
- package/src/orchestrator/index.ts +8 -0
- package/src/orchestrator/orchestrator.ts +46 -225
- package/src/orchestrator/proving-scheduler.ts +156 -0
- package/src/orchestrator/top-tree-orchestrator.ts +314 -0
- package/src/orchestrator/top-tree-proving-scheduler.ts +154 -0
- package/src/orchestrator/top-tree-proving-state.ts +220 -0
- package/src/prover-client/prover-client.ts +125 -1
- package/src/proving_broker/broker_prover_facade.ts +8 -16
- package/src/proving_broker/config.ts +3 -2
- package/src/proving_broker/index.ts +1 -0
- package/src/proving_broker/proving_broker.ts +27 -5
- package/src/proving_broker/proving_broker_database/persisted.ts +2 -2
- package/src/proving_broker/rpc.ts +24 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/proving_broker/rpc.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAEvB,KAAK,kBAAkB,EAExB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,KAAK,kBAAkB,EAAgC,MAAM,0BAA0B,CAAC;AAKjG,qFAAqF;AACrF,wBAAiB,mBAAmB,qCAMnC;AAWD,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,kBAAkB,CAKrE,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/proving_broker/rpc.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAEvB,KAAK,kBAAkB,EAExB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,KAAK,kBAAkB,EAAgC,MAAM,0BAA0B,CAAC;AAKjG,qFAAqF;AACrF,wBAAiB,mBAAmB,qCAMnC;AAWD,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,kBAAkB,CAKrE,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,kBAAkB,CAiBrE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,gBAAgB,CAGjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,qBAAqB,CAK3E,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,YAAY,CAAC,gBAAgB,GAAG,qBAAqB,CAGlG,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACrC,KAAK;;;;;EAA8C,GAClD,gBAAgB,CAMlB;AAED,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACrC,KAAK;;;;;EAA8C,GAClD,kBAAkB,CAMpB;AAED,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACrC,KAAK;;;;;EAA8C,GAClD,kBAAkB,CAMpB"}
|
|
@@ -27,23 +27,78 @@ const GetProvingJobResponse = z.object({
|
|
|
27
27
|
time: z.number()
|
|
28
28
|
});
|
|
29
29
|
export const ProvingJobProducerSchema = {
|
|
30
|
-
enqueueProvingJob: z.function(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
enqueueProvingJob: z.function({
|
|
31
|
+
input: z.tuple([
|
|
32
|
+
ProvingJob
|
|
33
|
+
]),
|
|
34
|
+
output: ProvingJobStatus
|
|
35
|
+
}),
|
|
36
|
+
getProvingJobStatus: z.function({
|
|
37
|
+
input: z.tuple([
|
|
38
|
+
ProvingJobId
|
|
39
|
+
]),
|
|
40
|
+
output: ProvingJobStatus
|
|
41
|
+
}),
|
|
42
|
+
cancelProvingJob: z.function({
|
|
43
|
+
input: z.tuple([
|
|
44
|
+
ProvingJobId
|
|
45
|
+
]),
|
|
46
|
+
output: z.void()
|
|
47
|
+
}),
|
|
48
|
+
getCompletedJobs: z.function({
|
|
49
|
+
input: z.tuple([
|
|
50
|
+
z.array(ProvingJobId)
|
|
51
|
+
]),
|
|
52
|
+
output: z.array(ProvingJobId)
|
|
53
|
+
})
|
|
34
54
|
};
|
|
35
55
|
export const ProvingJobConsumerSchema = {
|
|
36
|
-
getProvingJob: z.function(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
getProvingJob: z.function({
|
|
57
|
+
input: z.tuple([
|
|
58
|
+
optional(ProvingJobFilterSchema)
|
|
59
|
+
]),
|
|
60
|
+
output: GetProvingJobResponse.optional()
|
|
61
|
+
}),
|
|
62
|
+
reportProvingJobError: z.function({
|
|
63
|
+
input: z.tuple([
|
|
64
|
+
ProvingJobId,
|
|
65
|
+
z.string(),
|
|
66
|
+
optional(z.boolean()),
|
|
67
|
+
optional(ProvingJobFilterSchema)
|
|
68
|
+
]),
|
|
69
|
+
output: GetProvingJobResponse.optional()
|
|
70
|
+
}),
|
|
71
|
+
reportProvingJobProgress: z.function({
|
|
72
|
+
input: z.tuple([
|
|
73
|
+
ProvingJobId,
|
|
74
|
+
z.number(),
|
|
75
|
+
optional(ProvingJobFilterSchema)
|
|
76
|
+
]),
|
|
77
|
+
output: GetProvingJobResponse.optional()
|
|
78
|
+
}),
|
|
79
|
+
reportProvingJobSuccess: z.function({
|
|
80
|
+
input: z.tuple([
|
|
81
|
+
ProvingJobId,
|
|
82
|
+
ProofUri,
|
|
83
|
+
optional(ProvingJobFilterSchema)
|
|
84
|
+
]),
|
|
85
|
+
output: GetProvingJobResponse.optional()
|
|
86
|
+
})
|
|
40
87
|
};
|
|
41
88
|
export const ProvingJobBrokerSchema = {
|
|
42
89
|
...ProvingJobConsumerSchema,
|
|
43
90
|
...ProvingJobProducerSchema
|
|
44
91
|
};
|
|
45
92
|
export const ProvingJobBrokerDebugSchema = {
|
|
46
|
-
replayProvingJob: z.function(
|
|
93
|
+
replayProvingJob: z.function({
|
|
94
|
+
input: z.tuple([
|
|
95
|
+
ProvingJobId,
|
|
96
|
+
z.nativeEnum(ProvingRequestType),
|
|
97
|
+
EpochNumberSchema,
|
|
98
|
+
ProofUri
|
|
99
|
+
]),
|
|
100
|
+
output: ProvingJobStatus
|
|
101
|
+
})
|
|
47
102
|
};
|
|
48
103
|
export const ProvingJobBrokerSchemaWithDebug = {
|
|
49
104
|
...ProvingJobBrokerSchema,
|
|
@@ -20,8 +20,8 @@ export declare class TestBroker implements ProvingJobProducer {
|
|
|
20
20
|
export declare class MockProver implements ServerCircuitProver {
|
|
21
21
|
constructor();
|
|
22
22
|
getAvmProof(_inputs: AvmCircuitInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<import("@aztec/stdlib/proofs").RecursiveProof<16400>>;
|
|
23
|
-
getBaseParityProof(_inputs: ParityBasePrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs,
|
|
24
|
-
getRootParityProof(_inputs: ParityRootPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs,
|
|
23
|
+
getBaseParityProof(_inputs: ParityBasePrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs, 410>>;
|
|
24
|
+
getRootParityProof(_inputs: ParityRootPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs, 410>>;
|
|
25
25
|
getPublicChonkVerifierProof(_inputs: PublicChonkVerifierPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
26
26
|
getPrivateTxBaseRollupProof(_baseRollupInput: PrivateTxBaseRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
27
27
|
getPublicTxBaseRollupProof(_inputs: PublicTxBaseRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
@@ -31,7 +31,7 @@ export declare class MockProver implements ServerCircuitProver {
|
|
|
31
31
|
getBlockRootEmptyTxFirstRollupProof(_input: BlockRootEmptyTxFirstRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
32
32
|
getBlockRootRollupProof(_input: BlockRootRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
33
33
|
getBlockRootSingleTxRollupProof(_input: BlockRootSingleTxRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
34
|
-
getBlockMergeRollupProof(_input: BlockMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs,
|
|
34
|
+
getBlockMergeRollupProof(_input: BlockMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, 480>>;
|
|
35
35
|
getCheckpointRootRollupProof(_input: CheckpointRootRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
36
36
|
getCheckpointRootSingleBlockRollupProof(_input: CheckpointRootSingleBlockRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
37
37
|
getCheckpointMergeRollupProof(_input: CheckpointMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-client",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.2606882",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
28
28
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
29
29
|
"bb": "node --no-warnings ./dest/bb/index.js",
|
|
30
|
-
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=3500000
|
|
31
|
-
"test:debug": "LOG_LEVEL
|
|
30
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=3500000",
|
|
31
|
+
"test:debug": "LOG_LEVEL=\"debug; info: json-rpc, simulator\" NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --testNamePattern prover/bb_prover/parity"
|
|
32
32
|
},
|
|
33
33
|
"jest": {
|
|
34
34
|
"moduleNameMapper": {
|
|
@@ -68,28 +68,28 @@
|
|
|
68
68
|
]
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
72
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
73
|
-
"@aztec/constants": "0.0.1-commit.
|
|
74
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
75
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
76
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
77
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
78
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
79
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
80
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
81
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
82
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
83
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
71
|
+
"@aztec/bb-prover": "0.0.1-commit.2606882",
|
|
72
|
+
"@aztec/blob-lib": "0.0.1-commit.2606882",
|
|
73
|
+
"@aztec/constants": "0.0.1-commit.2606882",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.2606882",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.2606882",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.2606882",
|
|
77
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.2606882",
|
|
78
|
+
"@aztec/noir-types": "0.0.1-commit.2606882",
|
|
79
|
+
"@aztec/protocol-contracts": "0.0.1-commit.2606882",
|
|
80
|
+
"@aztec/simulator": "0.0.1-commit.2606882",
|
|
81
|
+
"@aztec/stdlib": "0.0.1-commit.2606882",
|
|
82
|
+
"@aztec/telemetry-client": "0.0.1-commit.2606882",
|
|
83
|
+
"@aztec/world-state": "0.0.1-commit.2606882",
|
|
84
84
|
"@iarna/toml": "^2.2.5",
|
|
85
85
|
"commander": "^12.1.0",
|
|
86
86
|
"lodash.chunk": "^4.2.0",
|
|
87
87
|
"source-map-support": "^0.5.21",
|
|
88
88
|
"tslib": "^2.4.0",
|
|
89
|
-
"zod": "^
|
|
89
|
+
"zod": "^4"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
92
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.2606882",
|
|
93
93
|
"@jest/globals": "^30.0.0",
|
|
94
94
|
"@types/jest": "^30.0.0",
|
|
95
95
|
"@types/node": "^22.15.17",
|
package/src/config.ts
CHANGED
|
@@ -44,14 +44,30 @@ export const bbConfigMappings: ConfigMappingsType<BBConfig & ACVMConfig> = {
|
|
|
44
44
|
},
|
|
45
45
|
numConcurrentIVCVerifiers: {
|
|
46
46
|
env: 'BB_NUM_IVC_VERIFIERS',
|
|
47
|
-
description: 'Max
|
|
47
|
+
description: 'Max concurrent verifications for the RPC verifier (QueuedIVCVerifier).',
|
|
48
48
|
...numberConfigHelper(8),
|
|
49
49
|
},
|
|
50
50
|
bbIVCConcurrency: {
|
|
51
51
|
env: 'BB_IVC_CONCURRENCY',
|
|
52
|
-
description: '
|
|
52
|
+
description: 'Thread count for the RPC IVC verifier.',
|
|
53
53
|
...numberConfigHelper(1),
|
|
54
54
|
},
|
|
55
|
+
bbChonkVerifyMaxBatch: {
|
|
56
|
+
env: 'BB_CHONK_VERIFY_MAX_BATCH',
|
|
57
|
+
description:
|
|
58
|
+
'Upper bound on proofs per batch for the peer chonk batch verifier. Proofs are verified immediately as they arrive; this only caps how many can accumulate while a batch is already being processed.',
|
|
59
|
+
...numberConfigHelper(16),
|
|
60
|
+
},
|
|
61
|
+
bbChonkVerifyConcurrency: {
|
|
62
|
+
env: 'BB_CHONK_VERIFY_BATCH_CONCURRENCY',
|
|
63
|
+
description: 'Thread count for the peer batch verifier parallel reduce. 0 = auto.',
|
|
64
|
+
...numberConfigHelper(6),
|
|
65
|
+
},
|
|
66
|
+
bbDebugOutputDir: {
|
|
67
|
+
env: 'BB_DEBUG_OUTPUT_DIR',
|
|
68
|
+
description:
|
|
69
|
+
'When set, bb.js operations write input/output files and log equivalent CLI commands to this directory',
|
|
70
|
+
},
|
|
55
71
|
};
|
|
56
72
|
|
|
57
73
|
export const proverClientConfigMappings: ConfigMappingsType<ProverClientUserConfig> = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { SpongeBlob, computeBlobsHashFromBlobs, encodeCheckpointEndMarker, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
2
|
-
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
3
2
|
import { type CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
4
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
5
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
4
|
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
5
|
+
import { elapsed } from '@aztec/foundation/timer';
|
|
7
6
|
import { L2Block } from '@aztec/stdlib/block';
|
|
8
7
|
import { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
9
8
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
10
9
|
import {
|
|
11
10
|
accumulateCheckpointOutHashes,
|
|
11
|
+
appendL1ToL2MessagesToTree,
|
|
12
12
|
computeCheckpointOutHash,
|
|
13
13
|
computeInHashFromL1ToL2Messages,
|
|
14
14
|
} from '@aztec/stdlib/messaging';
|
|
@@ -68,10 +68,7 @@ export class LightweightCheckpointBuilder {
|
|
|
68
68
|
feeAssetPriceModifier: bigint = 0n,
|
|
69
69
|
): Promise<LightweightCheckpointBuilder> {
|
|
70
70
|
// Insert l1-to-l2 messages into the tree.
|
|
71
|
-
await db
|
|
72
|
-
MerkleTreeId.L1_TO_L2_MESSAGE_TREE,
|
|
73
|
-
padArrayEnd<Fr, number>(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP),
|
|
74
|
-
);
|
|
71
|
+
await appendL1ToL2MessagesToTree(db, l1ToL2Messages);
|
|
75
72
|
|
|
76
73
|
return new LightweightCheckpointBuilder(
|
|
77
74
|
checkpointNumber,
|
|
@@ -116,6 +113,10 @@ export class LightweightCheckpointBuilder {
|
|
|
116
113
|
blockNumbers: existingBlocks.map(b => b.header.getBlockNumber()),
|
|
117
114
|
});
|
|
118
115
|
|
|
116
|
+
if (existingBlocks.length === 0) {
|
|
117
|
+
throw new Error(`Cannot resume checkpoint ${checkpointNumber} with no existing blocks`);
|
|
118
|
+
}
|
|
119
|
+
|
|
119
120
|
// Validate block order and consistency
|
|
120
121
|
for (let i = 1; i < existingBlocks.length; i++) {
|
|
121
122
|
const prev = existingBlocks[i - 1];
|
|
@@ -165,7 +166,8 @@ export class LightweightCheckpointBuilder {
|
|
|
165
166
|
globalVariables: GlobalVariables,
|
|
166
167
|
txs: ProcessedTx[],
|
|
167
168
|
opts: { insertTxsEffects?: boolean; expectedEndState?: StateReference } = {},
|
|
168
|
-
): Promise<L2Block> {
|
|
169
|
+
): Promise<{ block: L2Block; timings: Record<string, number> }> {
|
|
170
|
+
const timings: Record<string, number> = {};
|
|
169
171
|
const isFirstBlock = this.blocks.length === 0;
|
|
170
172
|
|
|
171
173
|
// Empty blocks are only allowed as the first block in a checkpoint
|
|
@@ -174,7 +176,9 @@ export class LightweightCheckpointBuilder {
|
|
|
174
176
|
}
|
|
175
177
|
|
|
176
178
|
if (isFirstBlock) {
|
|
177
|
-
|
|
179
|
+
const [msGetInitialArchive, initialArchive] = await elapsed(() => getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db));
|
|
180
|
+
this.lastArchives.push(initialArchive);
|
|
181
|
+
timings.getInitialArchive = msGetInitialArchive;
|
|
178
182
|
}
|
|
179
183
|
|
|
180
184
|
const lastArchive = this.lastArchives.at(-1)!;
|
|
@@ -184,12 +188,17 @@ export class LightweightCheckpointBuilder {
|
|
|
184
188
|
`Inserting side effects for ${txs.length} txs for block ${globalVariables.blockNumber} into db`,
|
|
185
189
|
{ txs: txs.map(tx => tx.hash.toString()) },
|
|
186
190
|
);
|
|
191
|
+
let msInsertSideEffects = 0;
|
|
187
192
|
for (const tx of txs) {
|
|
188
|
-
await insertSideEffects(tx, this.db);
|
|
193
|
+
const [ms] = await elapsed(() => insertSideEffects(tx, this.db));
|
|
194
|
+
msInsertSideEffects += ms;
|
|
189
195
|
}
|
|
196
|
+
timings.insertSideEffects = msInsertSideEffects;
|
|
190
197
|
}
|
|
191
198
|
|
|
192
|
-
const endState = await this.db.getStateReference();
|
|
199
|
+
const [msGetEndState, endState] = await elapsed(() => this.db.getStateReference());
|
|
200
|
+
timings.getEndState = msGetEndState;
|
|
201
|
+
|
|
193
202
|
if (opts.expectedEndState && !endState.equals(opts.expectedEndState)) {
|
|
194
203
|
this.logger.error('End state after processing txs does not match expected end state', {
|
|
195
204
|
globalVariables: globalVariables.toInspect(),
|
|
@@ -199,19 +208,16 @@ export class LightweightCheckpointBuilder {
|
|
|
199
208
|
throw new Error(`End state does not match expected end state when building block ${globalVariables.blockNumber}`);
|
|
200
209
|
}
|
|
201
210
|
|
|
202
|
-
const { header, body, blockBlobFields } = await
|
|
203
|
-
txs,
|
|
204
|
-
lastArchive,
|
|
205
|
-
endState,
|
|
206
|
-
globalVariables,
|
|
207
|
-
this.spongeBlob,
|
|
208
|
-
isFirstBlock,
|
|
211
|
+
const [msBuildHeaderAndBody, { header, body, blockBlobFields }] = await elapsed(() =>
|
|
212
|
+
buildHeaderAndBodyFromTxs(txs, lastArchive, endState, globalVariables, this.spongeBlob, isFirstBlock),
|
|
209
213
|
);
|
|
214
|
+
timings.buildHeaderAndBody = msBuildHeaderAndBody;
|
|
210
215
|
|
|
211
216
|
header.state.validate();
|
|
212
217
|
|
|
213
218
|
await this.db.updateArchive(header);
|
|
214
|
-
const newArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db);
|
|
219
|
+
const [msUpdateArchive, newArchive] = await elapsed(() => getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db));
|
|
220
|
+
timings.updateArchive = msUpdateArchive;
|
|
215
221
|
this.lastArchives.push(newArchive);
|
|
216
222
|
|
|
217
223
|
const expectedNextLeafIndex = Number(globalVariables.blockNumber) + 1;
|
|
@@ -225,7 +231,8 @@ export class LightweightCheckpointBuilder {
|
|
|
225
231
|
const block = new L2Block(newArchive, header, body, this.checkpointNumber, indexWithinCheckpoint);
|
|
226
232
|
this.blocks.push(block);
|
|
227
233
|
|
|
228
|
-
await this.spongeBlob.absorb(blockBlobFields);
|
|
234
|
+
const [msSpongeAbsorb] = await elapsed(() => this.spongeBlob.absorb(blockBlobFields));
|
|
235
|
+
timings.spongeAbsorb = msSpongeAbsorb;
|
|
229
236
|
this.blobFields.push(...blockBlobFields);
|
|
230
237
|
|
|
231
238
|
this.logger.debug(`Built block ${header.getBlockNumber()}`, {
|
|
@@ -236,7 +243,7 @@ export class LightweightCheckpointBuilder {
|
|
|
236
243
|
txs: block.body.txEffects.map(tx => tx.txHash.toString()),
|
|
237
244
|
});
|
|
238
245
|
|
|
239
|
-
return block;
|
|
246
|
+
return { block, timings };
|
|
240
247
|
}
|
|
241
248
|
|
|
242
249
|
async completeCheckpoint(): Promise<Checkpoint> {
|
|
@@ -283,6 +290,14 @@ export class LightweightCheckpointBuilder {
|
|
|
283
290
|
totalManaUsed,
|
|
284
291
|
});
|
|
285
292
|
|
|
293
|
+
this.logger.debug(`Completed checkpoint ${this.checkpointNumber}`, {
|
|
294
|
+
checkpointNumber: this.checkpointNumber,
|
|
295
|
+
headerHash: header.hash().toString(),
|
|
296
|
+
checkpointOutHash: checkpointOutHash.toString(),
|
|
297
|
+
numPreviousCheckpointOutHashes: this.previousCheckpointOutHashes.length,
|
|
298
|
+
...header.toInspect(),
|
|
299
|
+
});
|
|
300
|
+
|
|
286
301
|
return new Checkpoint(newArchive, header, blocks, this.checkpointNumber, this.feeAssetPriceModifier);
|
|
287
302
|
}
|
|
288
303
|
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
StateReference,
|
|
25
25
|
TreeSnapshots,
|
|
26
26
|
} from '@aztec/stdlib/tx';
|
|
27
|
+
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
27
28
|
import type { MerkleTreeAdminDatabase } from '@aztec/world-state';
|
|
28
29
|
import { NativeWorldStateService } from '@aztec/world-state/native';
|
|
29
30
|
|
|
@@ -84,14 +85,13 @@ export class TestContext {
|
|
|
84
85
|
const feePayer = AztecAddress.fromNumber(42222);
|
|
85
86
|
const initialFeePayerBalance = new Fr(10n ** 20n);
|
|
86
87
|
const feePayerSlot = await computeFeePayerBalanceLeafSlot(feePayer);
|
|
87
|
-
const
|
|
88
|
+
const genesis: GenesisData = {
|
|
89
|
+
prefilledPublicData: [new PublicDataTreeLeaf(feePayerSlot, initialFeePayerBalance)],
|
|
90
|
+
genesisTimestamp: 0n,
|
|
91
|
+
};
|
|
88
92
|
|
|
89
93
|
// Separated dbs for public processor and prover - see public_processor for context
|
|
90
|
-
const ws = await NativeWorldStateService.tmp(
|
|
91
|
-
/*rollupAddress=*/ undefined,
|
|
92
|
-
/*cleanupTmpDir=*/ true,
|
|
93
|
-
prefilledPublicData,
|
|
94
|
-
);
|
|
94
|
+
const ws = await NativeWorldStateService.tmp(/*rollupAddress=*/ undefined, /*cleanupTmpDir=*/ true, genesis);
|
|
95
95
|
|
|
96
96
|
let localProver: ServerCircuitProver;
|
|
97
97
|
const config = await getEnvironmentConfig(logger);
|
|
@@ -104,8 +104,10 @@ export class TestContext {
|
|
|
104
104
|
bbBinaryPath: config.expectedBBPath,
|
|
105
105
|
bbWorkingDirectory: config.bbWorkingDirectory,
|
|
106
106
|
bbSkipCleanup: config.bbSkipCleanup,
|
|
107
|
-
numConcurrentIVCVerifiers:
|
|
107
|
+
numConcurrentIVCVerifiers: 8,
|
|
108
108
|
bbIVCConcurrency: 1,
|
|
109
|
+
bbChonkVerifyMaxBatch: 16,
|
|
110
|
+
bbChonkVerifyConcurrency: 6,
|
|
109
111
|
};
|
|
110
112
|
localProver = await createProver(bbConfig);
|
|
111
113
|
}
|
|
@@ -262,7 +264,7 @@ export class TestContext {
|
|
|
262
264
|
const txs = blockTxs[i];
|
|
263
265
|
const state = blockEndStates[i];
|
|
264
266
|
|
|
265
|
-
const block = await builder.addBlock(blockGlobalVariables[i], txs, {
|
|
267
|
+
const { block } = await builder.addBlock(blockGlobalVariables[i], txs, {
|
|
266
268
|
expectedEndState: state,
|
|
267
269
|
insertTxsEffects: true,
|
|
268
270
|
});
|
|
@@ -282,6 +284,7 @@ export class TestContext {
|
|
|
282
284
|
|
|
283
285
|
return {
|
|
284
286
|
constants,
|
|
287
|
+
checkpoint,
|
|
285
288
|
header: checkpoint.header,
|
|
286
289
|
blocks,
|
|
287
290
|
l1ToL2Messages,
|
|
@@ -204,7 +204,7 @@ export class CheckpointProvingState {
|
|
|
204
204
|
Fr.ZERO,
|
|
205
205
|
NUM_MSGS_PER_BASE_PARITY,
|
|
206
206
|
);
|
|
207
|
-
return new ParityBasePrivateInputs(messages, this.constants.vkTreeRoot);
|
|
207
|
+
return new ParityBasePrivateInputs(messages, this.constants.vkTreeRoot, this.constants.proverId);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
public setOutHashHint(hint: OutHashHint) {
|
|
@@ -346,4 +346,17 @@ export class CheckpointProvingState {
|
|
|
346
346
|
? [this.blockProofs.getNode(rootLocation)?.provingOutput] // If there's only 1 block, its proof will be stored at the root.
|
|
347
347
|
: this.blockProofs.getChildren(rootLocation).map(c => c?.provingOutput);
|
|
348
348
|
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Returns the block-level proof outputs that feed into the checkpoint root rollup.
|
|
352
|
+
* Used by `CheckpointSubTreeOrchestrator` to surface its sub-tree result.
|
|
353
|
+
*/
|
|
354
|
+
public getSubTreeOutputProofs() {
|
|
355
|
+
return this.#getChildProofsForRoot();
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/** Sibling path of the archive tree captured before any block in this checkpoint landed. */
|
|
359
|
+
public getLastArchiveSiblingPath() {
|
|
360
|
+
return this.lastArchiveSiblingPath;
|
|
361
|
+
}
|
|
349
362
|
}
|