@aztec/prover-client 0.83.1 → 0.84.0-alpha-testnet.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broker_prover_facade.d.ts","sourceRoot":"","sources":["../../src/proving_broker/broker_prover_facade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,6BAA6B,EAC7B,yCAAyC,EACzC,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,KAAK,uBAAuB,EAI5B,KAAK,kBAAkB,EAGvB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEnG,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBAAsB,EACtB,iCAAiC,EACjC,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,UAAU,EACX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAiB3E,qBAAa,yBAA0B,YAAW,mBAAmB;IAOjE,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,gBAAgB,CAAC;IACzB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,GAAG;IAVb,OAAO,CAAC,IAAI,CAA4C;IACxD,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,sBAAsB,CAAc;IAC5C,OAAO,CAAC,cAAc,CAAgC;gBAG5C,MAAM,EAAE,kBAAkB,EAC1B,UAAU,GAAE,UAAmC,EAC/C,gBAAgB,CAAC,wBAAY,EAC7B,cAAc,SAAO,EACrB,GAAG,yCAA6D;IAG1E;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;
|
|
1
|
+
{"version":3,"file":"broker_prover_facade.d.ts","sourceRoot":"","sources":["../../src/proving_broker/broker_prover_facade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,6BAA6B,EAC7B,yCAAyC,EACzC,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,KAAK,uBAAuB,EAI5B,KAAK,kBAAkB,EAGvB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEnG,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBAAsB,EACtB,iCAAiC,EACjC,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,UAAU,EACX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAiB3E,qBAAa,yBAA0B,YAAW,mBAAmB;IAOjE,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,gBAAgB,CAAC;IACzB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,GAAG;IAVb,OAAO,CAAC,IAAI,CAA4C;IACxD,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,sBAAsB,CAAc;IAC5C,OAAO,CAAC,cAAc,CAAgC;gBAG5C,MAAM,EAAE,kB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less of whether it was enqueued at the broker
|
|
51
51
|
// The running promise will monitor for the job to be completed and resolve it either way
|
|
52
|
+
// We install an error handler to prevent unhandled rejections in the process before the
|
|
53
|
+
// job promise is awaited by the caller (see #13166)
|
|
52
54
|
const promise = promiseWithResolvers();
|
|
55
|
+
promise.promise.catch((err)=>this.log.error(`Job errored with '${err.message ?? err}' id=${id} type=${ProvingRequestType[type]}`, {
|
|
56
|
+
provingJobId: id,
|
|
57
|
+
provingJobType: ProvingRequestType[type]
|
|
58
|
+
}));
|
|
53
59
|
const abortFn = ()=>{
|
|
54
60
|
signal?.removeEventListener('abort', abortFn);
|
|
55
61
|
void this.broker.cancelProvingJob(id).catch((err)=>this.log.warn(`Error cancelling job id=${id}`, err));
|
|
@@ -75,23 +81,28 @@ export class BrokerCircuitProverFacade {
|
|
|
75
81
|
try {
|
|
76
82
|
const inputsUri = await this.proofStore.saveProofInput(id, type, inputs);
|
|
77
83
|
job.inputsUri = inputsUri;
|
|
84
|
+
// Send the job to the broker
|
|
78
85
|
const jobStatus = await this.broker.enqueueProvingJob({
|
|
79
86
|
id,
|
|
80
87
|
type,
|
|
81
88
|
inputsUri,
|
|
82
89
|
epochNumber
|
|
83
90
|
});
|
|
91
|
+
const jobLogText = `id=${id} type=${ProvingRequestType[type]} epochNumber=${epochNumber}`;
|
|
92
|
+
const jobLogData = {
|
|
93
|
+
provingJobId: id,
|
|
94
|
+
provingJobType: ProvingRequestType[type],
|
|
95
|
+
epochNumber,
|
|
96
|
+
inputsUri: truncate(inputsUri),
|
|
97
|
+
status: jobStatus.status,
|
|
98
|
+
numOutstandingJobs: this.jobs.size
|
|
99
|
+
};
|
|
84
100
|
// If we are here then the job was successfully accepted by the broker
|
|
85
101
|
// the returned status is for before any action was performed
|
|
86
102
|
if (jobStatus.status === 'fulfilled' || jobStatus.status === 'rejected') {
|
|
87
103
|
// Job was already completed by the broker
|
|
88
104
|
// No need to notify the broker on aborted job
|
|
89
|
-
this.log.verbose(`Job already completed when sent to broker
|
|
90
|
-
provingJobId: id,
|
|
91
|
-
provingJobType: ProvingRequestType[type],
|
|
92
|
-
epochNumber,
|
|
93
|
-
inputsUri: truncate(inputsUri)
|
|
94
|
-
});
|
|
105
|
+
this.log.verbose(`Job already completed when sent to broker ${jobLogText}`, jobLogData);
|
|
95
106
|
// Job was not enqueued. It must be completed already, add to our set of already completed jobs
|
|
96
107
|
this.jobsToRetrieve.add(id);
|
|
97
108
|
} else {
|
|
@@ -99,21 +110,10 @@ export class BrokerCircuitProverFacade {
|
|
|
99
110
|
signal?.addEventListener('abort', job.abortFn);
|
|
100
111
|
// Job added for the first time
|
|
101
112
|
if (jobStatus.status === 'not-found') {
|
|
102
|
-
this.log.verbose(`Job enqueued with broker
|
|
103
|
-
provingJobId: id,
|
|
104
|
-
provingJobType: ProvingRequestType[type],
|
|
105
|
-
epochNumber,
|
|
106
|
-
inputsUri: truncate(inputsUri),
|
|
107
|
-
numOutstandingJobs: this.jobs.size
|
|
108
|
-
});
|
|
113
|
+
this.log.verbose(`Job enqueued with broker ${jobLogText}`, jobLogData);
|
|
109
114
|
} else {
|
|
110
115
|
// Job was previously sent to the broker but is not completed
|
|
111
|
-
this.log.verbose(`Job already in queue or in progress when sent to broker
|
|
112
|
-
provingJobId: id,
|
|
113
|
-
provingJobType: ProvingRequestType[type],
|
|
114
|
-
epochNumber,
|
|
115
|
-
inputsUri: truncate(inputsUri)
|
|
116
|
-
});
|
|
116
|
+
this.log.verbose(`Job already in queue or in progress when sent to broker ${jobLogText}`, jobLogData);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0-alpha-testnet.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -66,19 +66,19 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/bb-prover": "0.
|
|
70
|
-
"@aztec/blob-lib": "0.
|
|
71
|
-
"@aztec/constants": "0.
|
|
72
|
-
"@aztec/ethereum": "0.
|
|
73
|
-
"@aztec/foundation": "0.
|
|
74
|
-
"@aztec/kv-store": "0.
|
|
75
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
76
|
-
"@aztec/noir-types": "0.
|
|
77
|
-
"@aztec/protocol-contracts": "0.
|
|
78
|
-
"@aztec/simulator": "0.
|
|
79
|
-
"@aztec/stdlib": "0.
|
|
80
|
-
"@aztec/telemetry-client": "0.
|
|
81
|
-
"@aztec/world-state": "0.
|
|
69
|
+
"@aztec/bb-prover": "0.84.0-alpha-testnet.1",
|
|
70
|
+
"@aztec/blob-lib": "0.84.0-alpha-testnet.1",
|
|
71
|
+
"@aztec/constants": "0.84.0-alpha-testnet.1",
|
|
72
|
+
"@aztec/ethereum": "0.84.0-alpha-testnet.1",
|
|
73
|
+
"@aztec/foundation": "0.84.0-alpha-testnet.1",
|
|
74
|
+
"@aztec/kv-store": "0.84.0-alpha-testnet.1",
|
|
75
|
+
"@aztec/noir-protocol-circuits-types": "0.84.0-alpha-testnet.1",
|
|
76
|
+
"@aztec/noir-types": "0.84.0-alpha-testnet.1",
|
|
77
|
+
"@aztec/protocol-contracts": "0.84.0-alpha-testnet.1",
|
|
78
|
+
"@aztec/simulator": "0.84.0-alpha-testnet.1",
|
|
79
|
+
"@aztec/stdlib": "0.84.0-alpha-testnet.1",
|
|
80
|
+
"@aztec/telemetry-client": "0.84.0-alpha-testnet.1",
|
|
81
|
+
"@aztec/world-state": "0.84.0-alpha-testnet.1",
|
|
82
82
|
"@google-cloud/storage": "^7.15.0",
|
|
83
83
|
"@iarna/toml": "^2.2.5",
|
|
84
84
|
"commander": "^12.1.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"zod": "^3.23.8"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@aztec/noir-contracts.js": "0.
|
|
91
|
+
"@aztec/noir-contracts.js": "0.84.0-alpha-testnet.1",
|
|
92
92
|
"@jest/globals": "^29.5.0",
|
|
93
93
|
"@types/jest": "^29.5.0",
|
|
94
94
|
"@types/memdown": "^3.0.0",
|
|
@@ -93,7 +93,15 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
93
93
|
|
|
94
94
|
// Create a promise for this job id, regardless of whether it was enqueued at the broker
|
|
95
95
|
// The running promise will monitor for the job to be completed and resolve it either way
|
|
96
|
+
// We install an error handler to prevent unhandled rejections in the process before the
|
|
97
|
+
// job promise is awaited by the caller (see #13166)
|
|
96
98
|
const promise = promiseWithResolvers<ProvingJobResultsMap[T]>();
|
|
99
|
+
promise.promise.catch(err =>
|
|
100
|
+
this.log.error(`Job errored with '${err.message ?? err}' id=${id} type=${ProvingRequestType[type]}`, {
|
|
101
|
+
provingJobId: id,
|
|
102
|
+
provingJobType: ProvingRequestType[type],
|
|
103
|
+
}),
|
|
104
|
+
);
|
|
97
105
|
const abortFn = () => {
|
|
98
106
|
signal?.removeEventListener('abort', abortFn);
|
|
99
107
|
void this.broker.cancelProvingJob(id).catch(err => this.log.warn(`Error cancelling job id=${id}`, err));
|
|
@@ -125,27 +133,26 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
125
133
|
try {
|
|
126
134
|
const inputsUri = await this.proofStore.saveProofInput(id, type, inputs);
|
|
127
135
|
job.inputsUri = inputsUri;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
|
|
137
|
+
// Send the job to the broker
|
|
138
|
+
const jobStatus = await this.broker.enqueueProvingJob({ id, type, inputsUri, epochNumber });
|
|
139
|
+
|
|
140
|
+
const jobLogText = `id=${id} type=${ProvingRequestType[type]} epochNumber=${epochNumber}`;
|
|
141
|
+
const jobLogData = {
|
|
142
|
+
provingJobId: id,
|
|
143
|
+
provingJobType: ProvingRequestType[type],
|
|
132
144
|
epochNumber,
|
|
133
|
-
|
|
145
|
+
inputsUri: truncate(inputsUri),
|
|
146
|
+
status: jobStatus.status,
|
|
147
|
+
numOutstandingJobs: this.jobs.size,
|
|
148
|
+
};
|
|
134
149
|
|
|
135
150
|
// If we are here then the job was successfully accepted by the broker
|
|
136
151
|
// the returned status is for before any action was performed
|
|
137
152
|
if (jobStatus.status === 'fulfilled' || jobStatus.status === 'rejected') {
|
|
138
153
|
// Job was already completed by the broker
|
|
139
154
|
// No need to notify the broker on aborted job
|
|
140
|
-
this.log.verbose(
|
|
141
|
-
`Job already completed when sent to broker id=${id} type=${ProvingRequestType[type]} epochNumber=${epochNumber}`,
|
|
142
|
-
{
|
|
143
|
-
provingJobId: id,
|
|
144
|
-
provingJobType: ProvingRequestType[type],
|
|
145
|
-
epochNumber,
|
|
146
|
-
inputsUri: truncate(inputsUri),
|
|
147
|
-
},
|
|
148
|
-
);
|
|
155
|
+
this.log.verbose(`Job already completed when sent to broker ${jobLogText}`, jobLogData);
|
|
149
156
|
|
|
150
157
|
// Job was not enqueued. It must be completed already, add to our set of already completed jobs
|
|
151
158
|
this.jobsToRetrieve.add(id);
|
|
@@ -155,27 +162,10 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
155
162
|
|
|
156
163
|
// Job added for the first time
|
|
157
164
|
if (jobStatus.status === 'not-found') {
|
|
158
|
-
this.log.verbose(
|
|
159
|
-
`Job enqueued with broker id=${id} type=${ProvingRequestType[type]} epochNumber=${epochNumber}`,
|
|
160
|
-
{
|
|
161
|
-
provingJobId: id,
|
|
162
|
-
provingJobType: ProvingRequestType[type],
|
|
163
|
-
epochNumber,
|
|
164
|
-
inputsUri: truncate(inputsUri),
|
|
165
|
-
numOutstandingJobs: this.jobs.size,
|
|
166
|
-
},
|
|
167
|
-
);
|
|
165
|
+
this.log.verbose(`Job enqueued with broker ${jobLogText}`, jobLogData);
|
|
168
166
|
} else {
|
|
169
167
|
// Job was previously sent to the broker but is not completed
|
|
170
|
-
this.log.verbose(
|
|
171
|
-
`Job already in queue or in progress when sent to broker id=${id} type=${ProvingRequestType[type]} epochNumber=${epochNumber}`,
|
|
172
|
-
{
|
|
173
|
-
provingJobId: id,
|
|
174
|
-
provingJobType: ProvingRequestType[type],
|
|
175
|
-
epochNumber,
|
|
176
|
-
inputsUri: truncate(inputsUri),
|
|
177
|
-
},
|
|
178
|
-
);
|
|
168
|
+
this.log.verbose(`Job already in queue or in progress when sent to broker ${jobLogText}`, jobLogData);
|
|
179
169
|
}
|
|
180
170
|
}
|
|
181
171
|
} catch (err) {
|