@aztec-labs/simulator 6.0.0-rc.1 → 6.0.0-rc.3
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/public/avm_simulator_pool.js +2 -2
- package/dest/public/public_processor/public_processor.d.ts +1 -1
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +12 -7
- package/package.json +16 -16
- package/src/public/avm_simulator_pool.ts +2 -2
- package/src/public/public_processor/public_processor.ts +13 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _computedKey;
|
|
2
2
|
import { AvmService } from '@aztec-foundation/bb-avm-sim';
|
|
3
|
-
import { AbortError } from '@aztec-labs/foundation/error';
|
|
3
|
+
import { AbortError, isRetryableError } from '@aztec-labs/foundation/error';
|
|
4
4
|
import { createLogger } from '@aztec-labs/foundation/log';
|
|
5
5
|
import { sleep } from '@aztec-labs/foundation/sleep';
|
|
6
6
|
import { CdbIpcServer } from './cdb_ipc_server.js';
|
|
@@ -9,7 +9,7 @@ import { CdbIpcServer } from './cdb_ipc_server.js';
|
|
|
9
9
|
* request itself) with `retry: true`. That distinction is interpreted here and goes no further: process
|
|
10
10
|
* lifecycle is invisible to the pool's callers.
|
|
11
11
|
*/ function isProcessFailure(err) {
|
|
12
|
-
return err
|
|
12
|
+
return isRetryableError(err);
|
|
13
13
|
}
|
|
14
14
|
/** Sleep that wakes early (without throwing) when the signal aborts; callers re-check the signal. */ async function abortableSleep(ms, signal) {
|
|
15
15
|
if (!signal) {
|
|
@@ -68,4 +68,4 @@ export declare class PublicProcessor implements Traceable {
|
|
|
68
68
|
*/
|
|
69
69
|
private static generateProvingRequest;
|
|
70
70
|
}
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3Byb2Nlc3Nvci5kLnRzIiwic291cmNlUm9vdCI6I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CxPQUFPLENBQUMsTUFBTSxDQUFDLHNCQUFzQjtDQVN0QyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_processor.d.ts","sourceRoot":"","sources":["../../../src/public/public_processor/public_processor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAgB,MAAM,4BAA4B,CAAC;AAE5F,OAAO,EAAE,YAAY,EAAkC,MAAM,8BAA8B,CAAC;AAO5F,OAAO,EAML,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAqB,MAAM,yBAAyB,CAAC;AAG/F,OAAO,EACL,KAAK,QAAQ,EACb,eAAe,EACf,yBAAyB,EACzB,KAAK,WAAW,EAEhB,EAAE,EAGH,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,MAAM,EAGZ,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAiB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAEhC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAGvE;;GAEG;AACH,qBAAa,sBAAsB;IAG/B,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,YAAY;IACpB,SAAS,CAAC,eAAe,EAAE,eAAe;IAL5C,OAAO,CAAC,GAAG,CAAS;IACpB,YACU,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BAA0B,EAClC,SAAS,GAAE,wBAA6B,GACvC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,yBAAyB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"public_processor.d.ts","sourceRoot":"","sources":["../../../src/public/public_processor/public_processor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAgB,MAAM,4BAA4B,CAAC;AAE5F,OAAO,EAAE,YAAY,EAAkC,MAAM,8BAA8B,CAAC;AAO5F,OAAO,EAML,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAqB,MAAM,yBAAyB,CAAC;AAG/F,OAAO,EACL,KAAK,QAAQ,EACb,eAAe,EACf,yBAAyB,EACzB,KAAK,WAAW,EAEhB,EAAE,EAGH,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,MAAM,EAGZ,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAiB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAEhC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAGvE;;GAEG;AACH,qBAAa,sBAAsB;IAG/B,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,YAA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EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC,EACrC,MAAM,GAAE,qBAA0B,EAClC,SAAS,GAAE,wBAA6B,GACvC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,yBAAyB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CA6OrF;YAEa,wBAAwB;YAiBxB,SAAS;YAiCT,gCAAgC;YA4BhC,uBAAuB;IAiCrC,OAAO,CAAC,mBAAmB;YA0Bb,gCAAgC;YA0BhC,oBAAoB;YA+BpB,wBAAwB;IAyCtC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAStC"}
|
|
@@ -511,6 +511,7 @@ _dec = trackSpan('PublicProcessor.processTx', (tx)=>({
|
|
|
511
511
|
let totalPublicGas = new Gas(0, 0);
|
|
512
512
|
let totalBlockGas = new Gas(0, 0);
|
|
513
513
|
let totalBlobFields = 0;
|
|
514
|
+
let blockGasSkippedCount = 0;
|
|
514
515
|
let silentlySkippedCount = 0;
|
|
515
516
|
let totalSilentlySkippedDurationMs = 0;
|
|
516
517
|
for await (const tx of txs){
|
|
@@ -545,12 +546,13 @@ _dec = trackSpan('PublicProcessor.processTx', (tx)=>({
|
|
|
545
546
|
// Only done during proposal building: during re-execution we must process the exact txs from the proposal.
|
|
546
547
|
const txGasLimit = tx.data.constants.txContext.gasSettings.gasLimits;
|
|
547
548
|
if (isBuildingProposal && maxBlockGas !== undefined && totalBlockGas.add(txGasLimit).gtAny(maxBlockGas)) {
|
|
548
|
-
this.log.
|
|
549
|
+
this.log.debug(`Skipping processing of tx ${txHash} due to block gas limit`, {
|
|
549
550
|
txHash,
|
|
550
551
|
txGasLimit,
|
|
551
552
|
totalBlockGas,
|
|
552
553
|
maxBlockGas
|
|
553
554
|
});
|
|
555
|
+
blockGasSkippedCount++;
|
|
554
556
|
continue;
|
|
555
557
|
}
|
|
556
558
|
// We validate the tx before processing it, to avoid unnecessary work.
|
|
@@ -605,13 +607,13 @@ _dec = trackSpan('PublicProcessor.processTx', (tx)=>({
|
|
|
605
607
|
this.contractsDB.revertCheckpoint();
|
|
606
608
|
continue;
|
|
607
609
|
}
|
|
608
|
-
// During re-execution, check if the
|
|
610
|
+
// During re-execution, check if the billed gas of this tx would push the block over the gas limit.
|
|
609
611
|
// Unlike the proposal-building check (which uses declared gas limits pessimistically before processing),
|
|
610
|
-
// this uses
|
|
611
|
-
if (!isBuildingProposal && maxBlockGas !== undefined && totalBlockGas.add(processedTx.gasUsed.
|
|
612
|
+
// this uses billed gas and stops processing when the limit is exceeded.
|
|
613
|
+
if (!isBuildingProposal && maxBlockGas !== undefined && totalBlockGas.add(processedTx.gasUsed.billedGas).gtAny(maxBlockGas)) {
|
|
612
614
|
this.log.warn(`Stopping re-execution since tx ${txHash} would push block gas over limit`, {
|
|
613
615
|
txHash,
|
|
614
|
-
txGas: processedTx.gasUsed.
|
|
616
|
+
txGas: processedTx.gasUsed.billedGas,
|
|
615
617
|
totalBlockGas,
|
|
616
618
|
maxBlockGas
|
|
617
619
|
});
|
|
@@ -628,7 +630,9 @@ _dec = trackSpan('PublicProcessor.processTx', (tx)=>({
|
|
|
628
630
|
debugLogs.push(...txDebugLogs);
|
|
629
631
|
this.debugLogStore.storeLogs(processedTx.hash.toString(), txDebugLogs);
|
|
630
632
|
totalPublicGas = totalPublicGas.add(processedTx.gasUsed.publicGas);
|
|
631
|
-
|
|
633
|
+
// Block mana limits are enforced on billed gas (the block header's totalManaUsed), which charges the full
|
|
634
|
+
// teardown gas limit. Accumulating actual gas would treat unused teardown limits as free headroom.
|
|
635
|
+
totalBlockGas = totalBlockGas.add(processedTx.gasUsed.billedGas);
|
|
632
636
|
totalSizeInBytes += txSize;
|
|
633
637
|
totalBlobFields += txBlobFields;
|
|
634
638
|
// Commit the tx-level contracts checkpoint on success
|
|
@@ -679,7 +683,7 @@ _dec = trackSpan('PublicProcessor.processTx', (tx)=>({
|
|
|
679
683
|
const rate = duration > 0 ? totalPublicGas.l2Gas / duration : 0;
|
|
680
684
|
this.metrics.recordAllTxs(totalPublicGas, rate);
|
|
681
685
|
const silentlySkippedDurationMs = Math.round(totalSilentlySkippedDurationMs);
|
|
682
|
-
this.log.info(`Processed ${result.length} successful txs and ${failed.length} failed txs ` + `(${silentlySkippedCount} silently skipped, ${silentlySkippedDurationMs}ms wasted) ` + `in ${duration}s`, {
|
|
686
|
+
this.log.info(`Processed ${result.length} successful txs and ${failed.length} failed txs ` + `(${blockGasSkippedCount} skipped due to block gas limit, ` + `${silentlySkippedCount} silently skipped, ${silentlySkippedDurationMs}ms wasted) ` + `in ${duration}s`, {
|
|
683
687
|
blockNumber: this.globalVariables.blockNumber,
|
|
684
688
|
successfulCount: result.length,
|
|
685
689
|
failedCount: failed.length,
|
|
@@ -688,6 +692,7 @@ _dec = trackSpan('PublicProcessor.processTx', (tx)=>({
|
|
|
688
692
|
totalPublicGas,
|
|
689
693
|
totalBlockGas,
|
|
690
694
|
totalSizeInBytes,
|
|
695
|
+
blockGasSkippedCount,
|
|
691
696
|
silentlySkippedCount,
|
|
692
697
|
silentlySkippedDurationMs
|
|
693
698
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec-labs/simulator",
|
|
3
|
-
"version": "6.0.0-rc.
|
|
3
|
+
"version": "6.0.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/server.js",
|
|
@@ -62,27 +62,27 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aztec-foundation/bb-avm-sim": "6.0.0-rc.
|
|
66
|
-
"@aztec-foundation/cdb": "6.0.0-rc.
|
|
67
|
-
"@aztec-foundation/ipc-runtime": "6.0.0-rc.
|
|
68
|
-
"@aztec-foundation/noir-acvm_js": "6.0.0-rc.
|
|
69
|
-
"@aztec-foundation/noir-noirc_abi": "6.0.0-rc.
|
|
70
|
-
"@aztec-foundation/noir-types": "6.0.0-rc.
|
|
71
|
-
"@aztec-labs/constants": "6.0.0-rc.
|
|
72
|
-
"@aztec-labs/foundation": "6.0.0-rc.
|
|
73
|
-
"@aztec-labs/protocol-contracts": "6.0.0-rc.
|
|
74
|
-
"@aztec-labs/standard-contracts": "6.0.0-rc.
|
|
75
|
-
"@aztec-labs/stdlib": "6.0.0-rc.
|
|
76
|
-
"@aztec-labs/telemetry-client": "6.0.0-rc.
|
|
77
|
-
"@aztec-labs/world-state": "6.0.0-rc.
|
|
65
|
+
"@aztec-foundation/bb-avm-sim": "6.0.0-rc.6",
|
|
66
|
+
"@aztec-foundation/cdb": "6.0.0-rc.6",
|
|
67
|
+
"@aztec-foundation/ipc-runtime": "6.0.0-rc.6",
|
|
68
|
+
"@aztec-foundation/noir-acvm_js": "6.0.0-rc.6",
|
|
69
|
+
"@aztec-foundation/noir-noirc_abi": "6.0.0-rc.6",
|
|
70
|
+
"@aztec-foundation/noir-types": "6.0.0-rc.6",
|
|
71
|
+
"@aztec-labs/constants": "6.0.0-rc.3",
|
|
72
|
+
"@aztec-labs/foundation": "6.0.0-rc.3",
|
|
73
|
+
"@aztec-labs/protocol-contracts": "6.0.0-rc.3",
|
|
74
|
+
"@aztec-labs/standard-contracts": "6.0.0-rc.3",
|
|
75
|
+
"@aztec-labs/stdlib": "6.0.0-rc.3",
|
|
76
|
+
"@aztec-labs/telemetry-client": "6.0.0-rc.3",
|
|
77
|
+
"@aztec-labs/world-state": "6.0.0-rc.3",
|
|
78
78
|
"lodash.clonedeep": "^4.5.0",
|
|
79
79
|
"lodash.merge": "^4.6.2",
|
|
80
80
|
"msgpackr": "^1.11.2",
|
|
81
81
|
"tslib": "^2.4.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@aztec-labs/noir-contracts.js": "6.0.0-rc.
|
|
85
|
-
"@aztec-labs/noir-test-contracts.js": "6.0.0-rc.
|
|
84
|
+
"@aztec-labs/noir-contracts.js": "6.0.0-rc.3",
|
|
85
|
+
"@aztec-labs/noir-test-contracts.js": "6.0.0-rc.3",
|
|
86
86
|
"@jest/globals": "^30.0.0",
|
|
87
87
|
"@types/jest": "^30.0.0",
|
|
88
88
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AvmService } from '@aztec-foundation/bb-avm-sim';
|
|
2
2
|
|
|
3
|
-
import { AbortError } from '@aztec-labs/foundation/error';
|
|
3
|
+
import { AbortError, isRetryableError } from '@aztec-labs/foundation/error';
|
|
4
4
|
import { type Logger, createLogger } from '@aztec-labs/foundation/log';
|
|
5
5
|
import { sleep } from '@aztec-labs/foundation/sleep';
|
|
6
6
|
|
|
@@ -53,7 +53,7 @@ export interface AvmProcessHandle {
|
|
|
53
53
|
* lifecycle is invisible to the pool's callers.
|
|
54
54
|
*/
|
|
55
55
|
function isProcessFailure(err: unknown): boolean {
|
|
56
|
-
return
|
|
56
|
+
return isRetryableError(err);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** Sleep that wakes early (without throwing) when the signal aborts; callers re-check the signal. */
|
|
@@ -188,6 +188,7 @@ export class PublicProcessor implements Traceable {
|
|
|
188
188
|
let totalPublicGas = new Gas(0, 0);
|
|
189
189
|
let totalBlockGas = new Gas(0, 0);
|
|
190
190
|
let totalBlobFields = 0;
|
|
191
|
+
let blockGasSkippedCount = 0;
|
|
191
192
|
let silentlySkippedCount = 0;
|
|
192
193
|
let totalSilentlySkippedDurationMs = 0;
|
|
193
194
|
|
|
@@ -225,12 +226,13 @@ export class PublicProcessor implements Traceable {
|
|
|
225
226
|
// Only done during proposal building: during re-execution we must process the exact txs from the proposal.
|
|
226
227
|
const txGasLimit = tx.data.constants.txContext.gasSettings.gasLimits;
|
|
227
228
|
if (isBuildingProposal && maxBlockGas !== undefined && totalBlockGas.add(txGasLimit).gtAny(maxBlockGas)) {
|
|
228
|
-
this.log.
|
|
229
|
+
this.log.debug(`Skipping processing of tx ${txHash} due to block gas limit`, {
|
|
229
230
|
txHash,
|
|
230
231
|
txGasLimit,
|
|
231
232
|
totalBlockGas,
|
|
232
233
|
maxBlockGas,
|
|
233
234
|
});
|
|
235
|
+
blockGasSkippedCount++;
|
|
234
236
|
continue;
|
|
235
237
|
}
|
|
236
238
|
|
|
@@ -294,17 +296,17 @@ export class PublicProcessor implements Traceable {
|
|
|
294
296
|
continue;
|
|
295
297
|
}
|
|
296
298
|
|
|
297
|
-
// During re-execution, check if the
|
|
299
|
+
// During re-execution, check if the billed gas of this tx would push the block over the gas limit.
|
|
298
300
|
// Unlike the proposal-building check (which uses declared gas limits pessimistically before processing),
|
|
299
|
-
// this uses
|
|
301
|
+
// this uses billed gas and stops processing when the limit is exceeded.
|
|
300
302
|
if (
|
|
301
303
|
!isBuildingProposal &&
|
|
302
304
|
maxBlockGas !== undefined &&
|
|
303
|
-
totalBlockGas.add(processedTx.gasUsed.
|
|
305
|
+
totalBlockGas.add(processedTx.gasUsed.billedGas).gtAny(maxBlockGas)
|
|
304
306
|
) {
|
|
305
307
|
this.log.warn(`Stopping re-execution since tx ${txHash} would push block gas over limit`, {
|
|
306
308
|
txHash,
|
|
307
|
-
txGas: processedTx.gasUsed.
|
|
309
|
+
txGas: processedTx.gasUsed.billedGas,
|
|
308
310
|
totalBlockGas,
|
|
309
311
|
maxBlockGas,
|
|
310
312
|
});
|
|
@@ -324,7 +326,9 @@ export class PublicProcessor implements Traceable {
|
|
|
324
326
|
this.debugLogStore.storeLogs(processedTx.hash.toString(), txDebugLogs);
|
|
325
327
|
|
|
326
328
|
totalPublicGas = totalPublicGas.add(processedTx.gasUsed.publicGas);
|
|
327
|
-
|
|
329
|
+
// Block mana limits are enforced on billed gas (the block header's totalManaUsed), which charges the full
|
|
330
|
+
// teardown gas limit. Accumulating actual gas would treat unused teardown limits as free headroom.
|
|
331
|
+
totalBlockGas = totalBlockGas.add(processedTx.gasUsed.billedGas);
|
|
328
332
|
totalSizeInBytes += txSize;
|
|
329
333
|
totalBlobFields += txBlobFields;
|
|
330
334
|
|
|
@@ -388,7 +392,8 @@ export class PublicProcessor implements Traceable {
|
|
|
388
392
|
const silentlySkippedDurationMs = Math.round(totalSilentlySkippedDurationMs);
|
|
389
393
|
this.log.info(
|
|
390
394
|
`Processed ${result.length} successful txs and ${failed.length} failed txs ` +
|
|
391
|
-
`(${
|
|
395
|
+
`(${blockGasSkippedCount} skipped due to block gas limit, ` +
|
|
396
|
+
`${silentlySkippedCount} silently skipped, ${silentlySkippedDurationMs}ms wasted) ` +
|
|
392
397
|
`in ${duration}s`,
|
|
393
398
|
{
|
|
394
399
|
blockNumber: this.globalVariables.blockNumber,
|
|
@@ -399,6 +404,7 @@ export class PublicProcessor implements Traceable {
|
|
|
399
404
|
totalPublicGas,
|
|
400
405
|
totalBlockGas,
|
|
401
406
|
totalSizeInBytes,
|
|
407
|
+
blockGasSkippedCount,
|
|
402
408
|
silentlySkippedCount,
|
|
403
409
|
silentlySkippedDurationMs,
|
|
404
410
|
},
|