@aztec/prover-client 0.77.0-testnet-ignition.29 → 0.77.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/orchestrator/block-building-helpers.js +1 -1
- package/dest/proving_broker/config.d.ts +2 -1
- package/dest/proving_broker/config.d.ts.map +1 -1
- package/dest/proving_broker/config.js +9 -7
- package/dest/proving_broker/proving_broker_database/persisted.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker_database/persisted.js +4 -3
- package/package.json +15 -14
- package/src/orchestrator/block-building-helpers.ts +1 -1
- package/src/proving_broker/config.ts +11 -8
- package/src/proving_broker/proving_broker_database/persisted.ts +15 -3
|
@@ -48,7 +48,7 @@ export const buildBaseRollupHints = runInSpan('BlockBuilderHelpers', 'buildBaseR
|
|
|
48
48
|
// Append new data to startSpongeBlob
|
|
49
49
|
const inputSpongeBlob = startSpongeBlob.clone();
|
|
50
50
|
await startSpongeBlob.absorb(tx.txEffect.toBlobFields());
|
|
51
|
-
const contractClassLogsPreimages = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, (i)=>tx.txEffect.contractClassLogs[i] || ContractClassLog.empty());
|
|
51
|
+
const contractClassLogsPreimages = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, (i)=>tx.txEffect.contractClassLogs[i]?.toUnsiloed() || ContractClassLog.empty());
|
|
52
52
|
if (tx.avmProvingRequest) {
|
|
53
53
|
const blockHash = await tx.constants.historicalHeader.hash();
|
|
54
54
|
const archiveRootMembershipWitness = await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type L1ContractAddresses } from '@aztec/ethereum';
|
|
1
2
|
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
2
3
|
import { type DataStoreConfig } from '@aztec/kv-store/config';
|
|
3
4
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
@@ -38,7 +39,7 @@ export declare const ProverBrokerConfig: z.ZodObject<{
|
|
|
38
39
|
proverBrokerMaxEpochsToKeepResultsFor: number;
|
|
39
40
|
dataDirectory?: string | undefined;
|
|
40
41
|
}>;
|
|
41
|
-
export type ProverBrokerConfig = z.infer<typeof ProverBrokerConfig> & Pick<DataStoreConfig, 'dataStoreMapSizeKB' | 'dataDirectory'>;
|
|
42
|
+
export type ProverBrokerConfig = z.infer<typeof ProverBrokerConfig> & Pick<DataStoreConfig, 'dataStoreMapSizeKB' | 'dataDirectory'> & Pick<L1ContractAddresses, 'rollupAddress'>;
|
|
42
43
|
export declare const proverBrokerConfigMappings: ConfigMappingsType<ProverBrokerConfig>;
|
|
43
44
|
export declare const defaultProverBrokerConfig: ProverBrokerConfig;
|
|
44
45
|
export declare const ProverAgentConfig: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/proving_broker/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;IAC7B,qFAAqF;;IAErF,uHAAuH;;IAEvH,6FAA6F;;IAE7F,8EAA8E;;IAE9E,qCAAqC;;IAErC,+EAA+E;;IAE/E,4CAA4C;;IAE5C,uDAAuD;;;;;;;;;;;;;;;;;;;;EAEvD,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GACjE,IAAI,CAAC,eAAe,EAAE,oBAAoB,GAAG,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/proving_broker/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAA8B,MAAM,iBAAiB,CAAC;AACvF,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;IAC7B,qFAAqF;;IAErF,uHAAuH;;IAEvH,6FAA6F;;IAE7F,8EAA8E;;IAE9E,qCAAqC;;IAErC,+EAA+E;;IAE/E,4CAA4C;;IAE5C,uDAAuD;;;;;;;;;;;;;;;;;;;;EAEvD,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GACjE,IAAI,CAAC,eAAe,EAAE,oBAAoB,GAAG,eAAe,CAAC,GAC7D,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;AAE7C,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CAAC,kBAAkB,CAiC7E,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,kBAAiE,CAAC;AAE1G,eAAO,MAAM,iBAAiB;IAC5B,2CAA2C;;IAE3C,wDAAwD;;IAExD,gDAAgD;;IAEhD,+CAA+C;;IAE/C,uCAAuC;;IAEvC,gDAAgD;;IAEhD,2DAA2D;;IAE3D,8EAA8E;;;;;;;;;;;;;;;;;;;;EAE9E,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,iBAAiB,CA4C3E,CAAC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { l1ContractAddressesMapping } from '@aztec/ethereum';
|
|
1
2
|
import { booleanConfigHelper, getDefaultConfig, numberConfigHelper } from '@aztec/foundation/config';
|
|
2
3
|
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
3
4
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
export const ProverBrokerConfig = z.object({
|
|
6
|
-
/** If starting a prover broker locally, the max number of retries per proving job */ proverBrokerJobMaxRetries: z.number(),
|
|
7
|
-
/** If starting a prover broker locally, the time after which a job times out and gets assigned to a different agent */ proverBrokerJobTimeoutMs: z.number(),
|
|
8
|
-
/** If starting a prover broker locally, the interval the broker checks for timed out jobs */ proverBrokerPollIntervalMs: z.number(),
|
|
7
|
+
/** If starting a prover broker locally, the max number of retries per proving job */ proverBrokerJobMaxRetries: z.number().int().nonnegative(),
|
|
8
|
+
/** If starting a prover broker locally, the time after which a job times out and gets assigned to a different agent */ proverBrokerJobTimeoutMs: z.number().int().nonnegative(),
|
|
9
|
+
/** If starting a prover broker locally, the interval the broker checks for timed out jobs */ proverBrokerPollIntervalMs: z.number().int().nonnegative(),
|
|
9
10
|
/** If starting a prover broker locally, the directory to store broker data */ dataDirectory: z.string().optional(),
|
|
10
|
-
/** The size of the data store map */ dataStoreMapSizeKB: z.number(),
|
|
11
|
-
/** The prover broker may batch jobs together before writing to the database */ proverBrokerBatchSize: z.number(),
|
|
12
|
-
/** How often the job batches get flushed */ proverBrokerBatchIntervalMs: z.number(),
|
|
13
|
-
/** The maximum number of epochs to keep results for */ proverBrokerMaxEpochsToKeepResultsFor: z.number()
|
|
11
|
+
/** The size of the data store map */ dataStoreMapSizeKB: z.number().int().nonnegative(),
|
|
12
|
+
/** The prover broker may batch jobs together before writing to the database */ proverBrokerBatchSize: z.number().int().nonnegative(),
|
|
13
|
+
/** How often the job batches get flushed */ proverBrokerBatchIntervalMs: z.number().int().nonnegative(),
|
|
14
|
+
/** The maximum number of epochs to keep results for */ proverBrokerMaxEpochsToKeepResultsFor: z.number().int().nonnegative()
|
|
14
15
|
});
|
|
15
16
|
export const proverBrokerConfigMappings = {
|
|
16
17
|
proverBrokerJobTimeoutMs: {
|
|
@@ -43,6 +44,7 @@ export const proverBrokerConfigMappings = {
|
|
|
43
44
|
description: 'The maximum number of epochs to keep results for',
|
|
44
45
|
...numberConfigHelper(1)
|
|
45
46
|
},
|
|
47
|
+
rollupAddress: l1ContractAddressesMapping.rollupAddress,
|
|
46
48
|
...dataConfigMappings
|
|
47
49
|
};
|
|
48
50
|
export const defaultProverBrokerConfig = getDefaultConfig(proverBrokerConfigMappings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persisted.d.ts","sourceRoot":"","sources":["../../../src/proving_broker/proving_broker_database/persisted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EACL,KAAK,QAAQ,EACb,UAAU,EACV,KAAK,YAAY,EACjB,uBAAuB,EAExB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAA2B,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAK5G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"persisted.d.ts","sourceRoot":"","sources":["../../../src/proving_broker/proving_broker_database/persisted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EACL,KAAK,QAAQ,EACb,UAAU,EACV,KAAK,YAAY,EACjB,uBAAuB,EAExB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAA2B,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAK5G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAwD3E,qBAAa,gBAAiB,YAAW,qBAAqB;IAM1D,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IAEd,OAAO,CAAC,MAAM;IARhB,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,UAAU,CAA2E;IAE7F,OAAO;IAuBM,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM;YAQnG,YAAY;WASN,GAAG,CACrB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,GAAE,eAAsC,EAC9C,MAAM,SAAwD;IAgChE,OAAO,CAAC,KAAK;IAIP,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,kCAAkC,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAa5E,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,cAAc,IAAI,qBAAqB,CAAC,CAAC,UAAU,EAAE,uBAAuB,GAAG,SAAS,CAAC,CAAC;IAOjG,kBAAkB,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,mBAAmB,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;YAIvD,gBAAgB;CAoB/B"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { BatchQueue } from '@aztec/foundation/queue';
|
|
4
|
-
import {
|
|
4
|
+
import { openVersionedStoreAt } from '@aztec/kv-store/lmdb-v2';
|
|
5
5
|
import { ProvingJob, ProvingJobSettledResult, getEpochFromProvingJobId } from '@aztec/stdlib/interfaces/server';
|
|
6
6
|
import { Attributes, LmdbMetrics, getTelemetryClient } from '@aztec/telemetry-client';
|
|
7
7
|
import { mkdir, readdir } from 'fs/promises';
|
|
8
8
|
import { join } from 'path';
|
|
9
9
|
class SingleEpochDatabase {
|
|
10
10
|
store;
|
|
11
|
+
static SCHEMA_VERSION = 1;
|
|
11
12
|
jobs;
|
|
12
13
|
jobResults;
|
|
13
14
|
constructor(store){
|
|
@@ -108,7 +109,7 @@ export class KVBrokerDatabase {
|
|
|
108
109
|
continue;
|
|
109
110
|
}
|
|
110
111
|
logger.info(`Loading broker database for epoch ${epochNumber} from ${fullDirectory} with map size ${config.dataStoreMapSizeKB}KB`);
|
|
111
|
-
const db = await
|
|
112
|
+
const db = await openVersionedStoreAt(fullDirectory, SingleEpochDatabase.SCHEMA_VERSION, config.rollupAddress, config.dataStoreMapSizeKB);
|
|
112
113
|
const epochDb = new SingleEpochDatabase(db);
|
|
113
114
|
epochs.set(epochNumber, epochDb);
|
|
114
115
|
}
|
|
@@ -172,7 +173,7 @@ export class KVBrokerDatabase {
|
|
|
172
173
|
recursive: true
|
|
173
174
|
});
|
|
174
175
|
this.logger.info(`Creating broker database for epoch ${epochNumber} at ${newEpochDirectory} with map size ${this.config.dataStoreMapSizeKB}`);
|
|
175
|
-
const db = await
|
|
176
|
+
const db = await openVersionedStoreAt(newEpochDirectory, SingleEpochDatabase.SCHEMA_VERSION, this.config.rollupAddress, this.config.dataStoreMapSizeKB);
|
|
176
177
|
epochDb = new SingleEpochDatabase(db);
|
|
177
178
|
this.epochs.set(epochNumber, epochDb);
|
|
178
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-client",
|
|
3
|
-
"version": "0.77.0
|
|
3
|
+
"version": "0.77.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -66,17 +66,18 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/bb-prover": "0.77.0
|
|
70
|
-
"@aztec/blob-lib": "0.77.0
|
|
71
|
-
"@aztec/constants": "0.77.0
|
|
72
|
-
"@aztec/
|
|
73
|
-
"@aztec/
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/protocol-
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/
|
|
69
|
+
"@aztec/bb-prover": "0.77.0",
|
|
70
|
+
"@aztec/blob-lib": "0.77.0",
|
|
71
|
+
"@aztec/constants": "0.77.0",
|
|
72
|
+
"@aztec/ethereum": "0.77.0",
|
|
73
|
+
"@aztec/foundation": "0.77.0",
|
|
74
|
+
"@aztec/kv-store": "0.77.0",
|
|
75
|
+
"@aztec/noir-protocol-circuits-types": "0.77.0",
|
|
76
|
+
"@aztec/protocol-contracts": "0.77.0",
|
|
77
|
+
"@aztec/simulator": "0.77.0",
|
|
78
|
+
"@aztec/stdlib": "0.77.0",
|
|
79
|
+
"@aztec/telemetry-client": "0.77.0",
|
|
80
|
+
"@aztec/world-state": "0.77.0",
|
|
80
81
|
"@google-cloud/storage": "^7.15.0",
|
|
81
82
|
"@iarna/toml": "^2.2.5",
|
|
82
83
|
"commander": "^12.1.0",
|
|
@@ -84,10 +85,10 @@
|
|
|
84
85
|
"source-map-support": "^0.5.21",
|
|
85
86
|
"tslib": "^2.4.0",
|
|
86
87
|
"zod": "^3.23.8",
|
|
87
|
-
"@aztec/noir-types": "0.77.0
|
|
88
|
+
"@aztec/noir-types": "0.77.0"
|
|
88
89
|
},
|
|
89
90
|
"devDependencies": {
|
|
90
|
-
"@aztec/noir-contracts.js": "0.77.0
|
|
91
|
+
"@aztec/noir-contracts.js": "0.77.0",
|
|
91
92
|
"@jest/globals": "^29.5.0",
|
|
92
93
|
"@types/jest": "^29.5.0",
|
|
93
94
|
"@types/memdown": "^3.0.0",
|
|
@@ -143,7 +143,7 @@ export const buildBaseRollupHints = runInSpan(
|
|
|
143
143
|
|
|
144
144
|
const contractClassLogsPreimages = makeTuple(
|
|
145
145
|
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
146
|
-
i => tx.txEffect.contractClassLogs[i] || ContractClassLog.empty(),
|
|
146
|
+
i => tx.txEffect.contractClassLogs[i]?.toUnsiloed() || ContractClassLog.empty(),
|
|
147
147
|
);
|
|
148
148
|
|
|
149
149
|
if (tx.avmProvingRequest) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type L1ContractAddresses, l1ContractAddressesMapping } from '@aztec/ethereum';
|
|
1
2
|
import {
|
|
2
3
|
type ConfigMappingsType,
|
|
3
4
|
booleanConfigHelper,
|
|
@@ -11,25 +12,26 @@ import { z } from 'zod';
|
|
|
11
12
|
|
|
12
13
|
export const ProverBrokerConfig = z.object({
|
|
13
14
|
/** If starting a prover broker locally, the max number of retries per proving job */
|
|
14
|
-
proverBrokerJobMaxRetries: z.number(),
|
|
15
|
+
proverBrokerJobMaxRetries: z.number().int().nonnegative(),
|
|
15
16
|
/** If starting a prover broker locally, the time after which a job times out and gets assigned to a different agent */
|
|
16
|
-
proverBrokerJobTimeoutMs: z.number(),
|
|
17
|
+
proverBrokerJobTimeoutMs: z.number().int().nonnegative(),
|
|
17
18
|
/** If starting a prover broker locally, the interval the broker checks for timed out jobs */
|
|
18
|
-
proverBrokerPollIntervalMs: z.number(),
|
|
19
|
+
proverBrokerPollIntervalMs: z.number().int().nonnegative(),
|
|
19
20
|
/** If starting a prover broker locally, the directory to store broker data */
|
|
20
21
|
dataDirectory: z.string().optional(),
|
|
21
22
|
/** The size of the data store map */
|
|
22
|
-
dataStoreMapSizeKB: z.number(),
|
|
23
|
+
dataStoreMapSizeKB: z.number().int().nonnegative(),
|
|
23
24
|
/** The prover broker may batch jobs together before writing to the database */
|
|
24
|
-
proverBrokerBatchSize: z.number(),
|
|
25
|
+
proverBrokerBatchSize: z.number().int().nonnegative(),
|
|
25
26
|
/** How often the job batches get flushed */
|
|
26
|
-
proverBrokerBatchIntervalMs: z.number(),
|
|
27
|
+
proverBrokerBatchIntervalMs: z.number().int().nonnegative(),
|
|
27
28
|
/** The maximum number of epochs to keep results for */
|
|
28
|
-
proverBrokerMaxEpochsToKeepResultsFor: z.number(),
|
|
29
|
+
proverBrokerMaxEpochsToKeepResultsFor: z.number().int().nonnegative(),
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
export type ProverBrokerConfig = z.infer<typeof ProverBrokerConfig> &
|
|
32
|
-
Pick<DataStoreConfig, 'dataStoreMapSizeKB' | 'dataDirectory'
|
|
33
|
+
Pick<DataStoreConfig, 'dataStoreMapSizeKB' | 'dataDirectory'> &
|
|
34
|
+
Pick<L1ContractAddresses, 'rollupAddress'>;
|
|
33
35
|
|
|
34
36
|
export const proverBrokerConfigMappings: ConfigMappingsType<ProverBrokerConfig> = {
|
|
35
37
|
proverBrokerJobTimeoutMs: {
|
|
@@ -62,6 +64,7 @@ export const proverBrokerConfigMappings: ConfigMappingsType<ProverBrokerConfig>
|
|
|
62
64
|
description: 'The maximum number of epochs to keep results for',
|
|
63
65
|
...numberConfigHelper(1),
|
|
64
66
|
},
|
|
67
|
+
rollupAddress: l1ContractAddressesMapping.rollupAddress,
|
|
65
68
|
...dataConfigMappings,
|
|
66
69
|
};
|
|
67
70
|
|
|
@@ -2,7 +2,7 @@ import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
|
2
2
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { BatchQueue } from '@aztec/foundation/queue';
|
|
4
4
|
import type { AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store';
|
|
5
|
-
import {
|
|
5
|
+
import { openVersionedStoreAt } from '@aztec/kv-store/lmdb-v2';
|
|
6
6
|
import {
|
|
7
7
|
type ProofUri,
|
|
8
8
|
ProvingJob,
|
|
@@ -19,6 +19,8 @@ import type { ProverBrokerConfig } from '../config.js';
|
|
|
19
19
|
import type { ProvingBrokerDatabase } from '../proving_broker_database.js';
|
|
20
20
|
|
|
21
21
|
class SingleEpochDatabase {
|
|
22
|
+
public static readonly SCHEMA_VERSION = 1;
|
|
23
|
+
|
|
22
24
|
private jobs: AztecAsyncMap<ProvingJobId, string>;
|
|
23
25
|
private jobResults: AztecAsyncMap<ProvingJobId, string>;
|
|
24
26
|
|
|
@@ -136,7 +138,12 @@ export class KVBrokerDatabase implements ProvingBrokerDatabase {
|
|
|
136
138
|
logger.info(
|
|
137
139
|
`Loading broker database for epoch ${epochNumber} from ${fullDirectory} with map size ${config.dataStoreMapSizeKB}KB`,
|
|
138
140
|
);
|
|
139
|
-
const db = await
|
|
141
|
+
const db = await openVersionedStoreAt(
|
|
142
|
+
fullDirectory,
|
|
143
|
+
SingleEpochDatabase.SCHEMA_VERSION,
|
|
144
|
+
config.rollupAddress,
|
|
145
|
+
config.dataStoreMapSizeKB,
|
|
146
|
+
);
|
|
140
147
|
const epochDb = new SingleEpochDatabase(db);
|
|
141
148
|
epochs.set(epochNumber, epochDb);
|
|
142
149
|
}
|
|
@@ -196,7 +203,12 @@ export class KVBrokerDatabase implements ProvingBrokerDatabase {
|
|
|
196
203
|
this.logger.info(
|
|
197
204
|
`Creating broker database for epoch ${epochNumber} at ${newEpochDirectory} with map size ${this.config.dataStoreMapSizeKB}`,
|
|
198
205
|
);
|
|
199
|
-
const db = await
|
|
206
|
+
const db = await openVersionedStoreAt(
|
|
207
|
+
newEpochDirectory,
|
|
208
|
+
SingleEpochDatabase.SCHEMA_VERSION,
|
|
209
|
+
this.config.rollupAddress,
|
|
210
|
+
this.config.dataStoreMapSizeKB,
|
|
211
|
+
);
|
|
200
212
|
epochDb = new SingleEpochDatabase(db);
|
|
201
213
|
this.epochs.set(epochNumber, epochDb);
|
|
202
214
|
}
|