@aztec/sequencer-client 3.0.0-nightly.20251003 → 3.0.0-nightly.20251004
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/publisher/config.d.ts +0 -2
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +1 -7
- package/dest/publisher/sequencer-publisher.d.ts +2 -2
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +4 -3
- package/dest/sequencer/errors.d.ts +11 -0
- package/dest/sequencer/errors.d.ts.map +1 -0
- package/dest/sequencer/errors.js +15 -0
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +11 -3
- package/dest/sequencer/timetable.d.ts +0 -6
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +2 -9
- package/dest/sequencer/utils.d.ts +10 -24
- package/dest/sequencer/utils.d.ts.map +1 -1
- package/dest/sequencer/utils.js +9 -24
- package/package.json +27 -27
- package/src/publisher/config.ts +1 -9
- package/src/publisher/sequencer-publisher.ts +8 -5
- package/src/sequencer/errors.ts +21 -0
- package/src/sequencer/sequencer.ts +9 -7
- package/src/sequencer/timetable.ts +2 -13
- package/src/sequencer/utils.ts +10 -24
|
@@ -19,8 +19,6 @@ export type TxSenderConfig = L1ReaderConfig & {
|
|
|
19
19
|
* Configuration of the L1Publisher.
|
|
20
20
|
*/
|
|
21
21
|
export type PublisherConfig = L1TxUtilsConfig & BlobSinkConfig & {
|
|
22
|
-
/** The interval to wait between publish retries. */
|
|
23
|
-
l1PublishRetryIntervalMS: number;
|
|
24
22
|
/** True to use publishers in invalid states (timed out, cancelled, etc) if no other is available */
|
|
25
23
|
publisherAllowInvalidStates?: boolean;
|
|
26
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/publisher/config.ts"],"names":[],"mappings":"AAAA,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AAyB,EAAE,CACtC,KAAK,EAAE,QAAQ,GAAG,KAAK,KACpB,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAezD,CAAC;AAEH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAErG;AAED,eAAO,MAAM,0BAA0B,EAAE,CACvC,KAAK,EAAE,QAAQ,GAAG,KAAK,KACpB,kBAAkB,CAAC,eAAe,GAAG,eAAe,CAQvD,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,eAAe,CAElF"}
|
package/dest/publisher/config.js
CHANGED
|
@@ -24,16 +24,10 @@ export function getTxSenderConfigFromEnv(scope) {
|
|
|
24
24
|
return getConfigFromMappings(getTxSenderConfigMappings(scope));
|
|
25
25
|
}
|
|
26
26
|
export const getPublisherConfigMappings = (scope)=>({
|
|
27
|
-
l1PublishRetryIntervalMS: {
|
|
28
|
-
env: scope === `PROVER` ? `PROVER_PUBLISH_RETRY_INTERVAL_MS` : `SEQ_PUBLISH_RETRY_INTERVAL_MS`,
|
|
29
|
-
parseEnv: (val)=>+val,
|
|
30
|
-
defaultValue: 1000,
|
|
31
|
-
description: 'The interval to wait between publish retries.'
|
|
32
|
-
},
|
|
33
27
|
publisherAllowInvalidStates: {
|
|
34
28
|
description: 'True to use publishers in invalid states (timed out, cancelled, etc) if no other is available',
|
|
35
29
|
env: scope === `PROVER` ? `PROVER_PUBLISHER_ALLOW_INVALID_STATES` : `SEQ_PUBLISHER_ALLOW_INVALID_STATES`,
|
|
36
|
-
...booleanConfigHelper(
|
|
30
|
+
...booleanConfigHelper(true)
|
|
37
31
|
},
|
|
38
32
|
...l1TxUtilsConfigMappings,
|
|
39
33
|
...blobSinkConfigMapping
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { L2Block } from '@aztec/aztec.js';
|
|
2
2
|
import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
3
3
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
4
|
-
import { type EmpireSlashingProposerContract, FormattedViemError, type GovernanceProposerContract, type L1BlobInputs, type L1ContractsConfig, type
|
|
4
|
+
import { type EmpireSlashingProposerContract, FormattedViemError, type GovernanceProposerContract, type L1BlobInputs, type L1ContractsConfig, type L1TxConfig, type L1TxRequest, RollupContract, type TallySlashingProposerContract, type TransactionStats } from '@aztec/ethereum';
|
|
5
5
|
import type { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
|
|
6
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
7
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
@@ -30,7 +30,7 @@ interface RequestWithExpiry {
|
|
|
30
30
|
action: Action;
|
|
31
31
|
request: L1TxRequest;
|
|
32
32
|
lastValidL2Slot: bigint;
|
|
33
|
-
gasConfig?: Pick<
|
|
33
|
+
gasConfig?: Pick<L1TxConfig, 'txTimeoutAt' | 'gasLimit'>;
|
|
34
34
|
blobConfig?: L1BlobInputs;
|
|
35
35
|
checkSuccess: (request: L1TxRequest, result?: {
|
|
36
36
|
receipt: TransactionReceipt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,KAAK,8BAA8B,EACnC,kBAAkB,EAClB,KAAK,0BAA0B,EAE/B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,
|
|
1
|
+
{"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","s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E;QAAE,WAAW,CAAC,EAAE,IAAI,CAAC;QAAC,uBAAuB,CAAC,EAAE,MAAM,CAAA;KAAO,GAClE,OAAO,CAAC,OAAO,CAAC;IAqCZ,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,EAAE,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO;YAgC9F,yBAAyB;IAoDvC;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;YAKA,gBAAgB;IAsD9B;;;;;OAKG;YACW,iBAAiB;YAoEjB,YAAY;CAkF3B"}
|
|
@@ -140,7 +140,7 @@ export class SequencerPublisher {
|
|
|
140
140
|
const gasLimit = gasLimits.length > 0 ? sumBigint(gasLimits) : undefined; // sum
|
|
141
141
|
const txTimeoutAts = gasConfigs.map((g)=>g?.txTimeoutAt).filter((g)=>g !== undefined);
|
|
142
142
|
const txTimeoutAt = txTimeoutAts.length > 0 ? new Date(Math.min(...txTimeoutAts.map((g)=>g.getTime()))) : undefined; // earliest
|
|
143
|
-
const
|
|
143
|
+
const txConfig = {
|
|
144
144
|
gasLimit,
|
|
145
145
|
txTimeoutAt
|
|
146
146
|
};
|
|
@@ -149,9 +149,10 @@ export class SequencerPublisher {
|
|
|
149
149
|
validRequests.sort((a, b)=>compareActions(a.action, b.action));
|
|
150
150
|
try {
|
|
151
151
|
this.log.debug('Forwarding transactions', {
|
|
152
|
-
validRequests: validRequests.map((request)=>request.action)
|
|
152
|
+
validRequests: validRequests.map((request)=>request.action),
|
|
153
|
+
txConfig
|
|
153
154
|
});
|
|
154
|
-
const result = await Multicall3.forward(validRequests.map((request)=>request.request), this.l1TxUtils,
|
|
155
|
+
const result = await Multicall3.forward(validRequests.map((request)=>request.request), this.l1TxUtils, txConfig, blobConfig, this.rollupContract.address, this.log);
|
|
155
156
|
const { successfulActions = [], failedActions = [] } = this.callbackBundledTransactions(validRequests, result);
|
|
156
157
|
return {
|
|
157
158
|
result,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SequencerState } from './utils.js';
|
|
2
|
+
export declare class SequencerTooSlowError extends Error {
|
|
3
|
+
readonly proposedState: SequencerState;
|
|
4
|
+
readonly maxAllowedTime: number;
|
|
5
|
+
readonly currentTime: number;
|
|
6
|
+
constructor(proposedState: SequencerState, maxAllowedTime: number, currentTime: number);
|
|
7
|
+
}
|
|
8
|
+
export declare class SequencerInterruptedError extends Error {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sequencer/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,aAAa,EAAE,cAAc;aAC7B,cAAc,EAAE,MAAM;aACtB,WAAW,EAAE,MAAM;gBAFnB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM;CAOtC;AAED,qBAAa,yBAA0B,SAAQ,KAAK;;CAKnD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class SequencerTooSlowError extends Error {
|
|
2
|
+
proposedState;
|
|
3
|
+
maxAllowedTime;
|
|
4
|
+
currentTime;
|
|
5
|
+
constructor(proposedState, maxAllowedTime, currentTime){
|
|
6
|
+
super(`Too far into slot for ${proposedState} (time into slot ${currentTime}s greater than ${maxAllowedTime}s allowance)`), this.proposedState = proposedState, this.maxAllowedTime = maxAllowedTime, this.currentTime = currentTime;
|
|
7
|
+
this.name = 'SequencerTooSlowError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class SequencerInterruptedError extends Error {
|
|
11
|
+
constructor(){
|
|
12
|
+
super(`Sequencer was interrupted`);
|
|
13
|
+
this.name = 'SequencerInterruptedError';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EACL,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,C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,sBAAsB,EAAE,+BAA+B,EACvD,+BAA+B,EAAE,SAAS,EAC1C,eAAe,EAAE,sBAAsB,GAAG,SAAS,EACnD,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC;IAuBhB;;;;OAIG;cACa,WAAW,IAAI,OAAO,CAClC;QACE,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,EAAE,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,4BAA4B,EAAE,mBAAmB,CAAC;KACnD,GACD,SAAS,CACZ;IAsDD;;;;;OAKG;cACa,yBAAyB,CACvC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EACpE,WAAW,EAAE,MAAM,EACnB,qBAAqB,EAAE,UAAU,EAAE,EACnC,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC;IA6DhB,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,kBAAkB;IAK1B,IAAI,iBAAiB,WAEpB;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAEM,gBAAgB,IAAI,sBAAsB,GAAG,SAAS;CAG9D"}
|
|
@@ -14,7 +14,7 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
14
14
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
15
15
|
import { Timer } from '@aztec/foundation/timer';
|
|
16
16
|
import { CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
|
|
17
|
-
import { getSlotAtTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
17
|
+
import { getSlotAtTimestamp, getSlotStartBuildTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
18
18
|
import { Gas } from '@aztec/stdlib/gas';
|
|
19
19
|
import { SequencerConfigSchema } from '@aztec/stdlib/interfaces/server';
|
|
20
20
|
import { orderAttestations } from '@aztec/stdlib/p2p';
|
|
@@ -25,8 +25,9 @@ import { ContentCommitment } from '@aztec/stdlib/tx';
|
|
|
25
25
|
import { AttestationTimeoutError } from '@aztec/stdlib/validators';
|
|
26
26
|
import { Attributes, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
27
27
|
import EventEmitter from 'node:events';
|
|
28
|
+
import { SequencerInterruptedError, SequencerTooSlowError } from './errors.js';
|
|
28
29
|
import { SequencerMetrics } from './metrics.js';
|
|
29
|
-
import { SequencerTimetable
|
|
30
|
+
import { SequencerTimetable } from './timetable.js';
|
|
30
31
|
import { SequencerState } from './utils.js';
|
|
31
32
|
export { SequencerState };
|
|
32
33
|
/**
|
|
@@ -151,6 +152,9 @@ export { SequencerState };
|
|
|
151
152
|
* Stops the sequencer from processing txs and moves to STOPPED state.
|
|
152
153
|
*/ async stop() {
|
|
153
154
|
this.log.info(`Stopping sequencer`);
|
|
155
|
+
this.setState(SequencerState.STOPPING, undefined, {
|
|
156
|
+
force: true
|
|
157
|
+
});
|
|
154
158
|
this.publisher?.interrupt();
|
|
155
159
|
await this.runningPromise?.stop();
|
|
156
160
|
this.setState(SequencerState.STOPPED, undefined, {
|
|
@@ -404,6 +408,10 @@ export { SequencerState };
|
|
|
404
408
|
}
|
|
405
409
|
}
|
|
406
410
|
setState(proposedState, slotNumber, opts = {}) {
|
|
411
|
+
if (this.state === SequencerState.STOPPING && proposedState !== SequencerState.STOPPED && !opts.force) {
|
|
412
|
+
this.log.warn(`Cannot set sequencer to ${proposedState} as it is stopping.`);
|
|
413
|
+
throw new SequencerInterruptedError();
|
|
414
|
+
}
|
|
407
415
|
if (this.state === SequencerState.STOPPED && !opts.force) {
|
|
408
416
|
this.log.warn(`Cannot set sequencer from ${this.state} to ${proposedState} as it is stopped.`);
|
|
409
417
|
return;
|
|
@@ -688,7 +696,7 @@ export { SequencerState };
|
|
|
688
696
|
await publisher.sendRequests();
|
|
689
697
|
}
|
|
690
698
|
getSlotStartBuildTimestamp(slotNumber) {
|
|
691
|
-
return
|
|
699
|
+
return getSlotStartBuildTimestamp(slotNumber, this.l1Constants);
|
|
692
700
|
}
|
|
693
701
|
getSecondsIntoSlot(slotNumber) {
|
|
694
702
|
const slotStartTimestamp = this.getSlotStartBuildTimestamp(slotNumber);
|
|
@@ -45,10 +45,4 @@ export declare class SequencerTimetable {
|
|
|
45
45
|
getMaxAllowedTime(state: SequencerState): number | undefined;
|
|
46
46
|
assertTimeLeft(newState: SequencerState, secondsIntoSlot: number): void;
|
|
47
47
|
}
|
|
48
|
-
export declare class SequencerTooSlowError extends Error {
|
|
49
|
-
readonly proposedState: SequencerState;
|
|
50
|
-
readonly maxAllowedTime: number;
|
|
51
|
-
readonly currentTime: number;
|
|
52
|
-
constructor(proposedState: SequencerState, maxAllowedTime: number, currentTime: number);
|
|
53
|
-
}
|
|
54
48
|
//# sourceMappingURL=timetable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM5C,qBAAa,kBAAkB;IA+C3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IA/CtB;;;;OAIG;IACH,SAAgB,kBAAkB,EAAE,MAAM,CAAC;IAE3C;;;;OAIG;IACH,SAAgB,gBAAgB,SAAC;IAEjC,sHAAsH;IACtH,SAAgB,gBAAgB,EAAE,MAAM,CAAsB;IAE9D,uDAAuD;IACvD,SAAgB,gBAAgB,EAAE,MAAM,CAAsB;IAE9D,mGAAmG;IACnG,SAAgB,0BAA0B,EAAE,MAAM,CAAC;IAEnD,mIAAmI;IACnI,SAAgB,mBAAmB,EAAE,MAAM,CAAyB;IAEpE,wCAAwC;IACxC,SAAgB,oBAAoB,EAAE,MAAM,CAAC;IAE7C,kFAAkF;IAClF,SAAgB,iBAAiB,EAAE,MAAM,CAAC;IAE1C,2IAA2I;IAC3I,SAAgB,4BAA4B,EAAE,MAAM,CAAC;IAErD,4DAA4D;IAC5D,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAG/B,IAAI,EAAE;QACJ,oBAAoB,EAAE,MAAM,CAAC;QAC7B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,4BAA4B,EAAE,MAAM,CAAC;QACrC,0BAA0B,CAAC,EAAE,MAAM,CAAC;QACpC,OAAO,EAAE,OAAO,CAAC;KAClB,EACgB,OAAO,CAAC,EAAE,gBAAgB,YAAA,EAC1B,GAAG,mCAAsC;IA+C5D,OAAO,KAAK,yCAAyC,GAEpD;IAEM,2BAA2B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;IAenE,OAAO,KAAK,0BAA0B,GAErC;IAEM,yBAAyB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM;IAU3D,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAuB5D,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM;CAkBxE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js';
|
|
2
2
|
import { DEFAULT_ATTESTATION_PROPAGATION_TIME } from '../config.js';
|
|
3
|
+
import { SequencerTooSlowError } from './errors.js';
|
|
3
4
|
import { SequencerState } from './utils.js';
|
|
4
5
|
const MIN_EXECUTION_TIME = 1;
|
|
5
6
|
const BLOCK_PREPARE_TIME = 1;
|
|
@@ -95,6 +96,7 @@ export class SequencerTimetable {
|
|
|
95
96
|
getMaxAllowedTime(state) {
|
|
96
97
|
switch(state){
|
|
97
98
|
case SequencerState.STOPPED:
|
|
99
|
+
case SequencerState.STOPPING:
|
|
98
100
|
case SequencerState.IDLE:
|
|
99
101
|
case SequencerState.SYNCHRONIZING:
|
|
100
102
|
return; // We don't really care about times for this states
|
|
@@ -133,12 +135,3 @@ export class SequencerTimetable {
|
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
|
-
export class SequencerTooSlowError extends Error {
|
|
137
|
-
proposedState;
|
|
138
|
-
maxAllowedTime;
|
|
139
|
-
currentTime;
|
|
140
|
-
constructor(proposedState, maxAllowedTime, currentTime){
|
|
141
|
-
super(`Too far into slot for ${proposedState} (time into slot ${currentTime}s greater than ${maxAllowedTime}s allowance)`), this.proposedState = proposedState, this.maxAllowedTime = maxAllowedTime, this.currentTime = currentTime;
|
|
142
|
-
this.name = 'SequencerTooSlowError';
|
|
143
|
-
}
|
|
144
|
-
}
|
|
@@ -1,35 +1,21 @@
|
|
|
1
1
|
export declare enum SequencerState {
|
|
2
|
-
/**
|
|
3
|
-
* Sequencer is stopped and not processing any txs from the pool.
|
|
4
|
-
*/
|
|
2
|
+
/** Sequencer is stopped and not processing any txs from the pool. */
|
|
5
3
|
STOPPED = "STOPPED",
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/** Sequencer is being stopped. Will move to STOPPED shortly. */
|
|
5
|
+
STOPPING = "STOPPING",
|
|
6
|
+
/** Sequencer is awaiting the next call to work(). */
|
|
9
7
|
IDLE = "IDLE",
|
|
10
|
-
/**
|
|
11
|
-
* Synchronizing with the L2 chain.
|
|
12
|
-
*/
|
|
8
|
+
/** Synchronizing with the L2 chain. */
|
|
13
9
|
SYNCHRONIZING = "SYNCHRONIZING",
|
|
14
|
-
/**
|
|
15
|
-
* Checking if we are the proposer for the current slot.
|
|
16
|
-
*/
|
|
10
|
+
/** Checking if we are the proposer for the current slot. */
|
|
17
11
|
PROPOSER_CHECK = "PROPOSER_CHECK",
|
|
18
|
-
/**
|
|
19
|
-
* Initializing the block proposal. Will move to CREATING_BLOCK if there are valid txs to include, or back to SYNCHRONIZING otherwise.
|
|
20
|
-
*/
|
|
12
|
+
/** Initializing the block proposal. Will move to CREATING_BLOCK if there are valid txs to include, or back to SYNCHRONIZING otherwise. */
|
|
21
13
|
INITIALIZING_PROPOSAL = "INITIALIZING_PROPOSAL",
|
|
22
|
-
/**
|
|
23
|
-
* Creating a new L2 block. Includes processing public function calls and running rollup circuits. Will move to PUBLISHING_CONTRACT_DATA.
|
|
24
|
-
*/
|
|
14
|
+
/** Creating a new L2 block. Includes processing public function calls and running rollup circuits. Will move to PUBLISHING_CONTRACT_DATA. */
|
|
25
15
|
CREATING_BLOCK = "CREATING_BLOCK",
|
|
26
|
-
/**
|
|
27
|
-
* Collecting attestations from its peers. Will move to PUBLISHING_BLOCK.
|
|
28
|
-
*/
|
|
16
|
+
/** Collecting attestations from its peers. Will move to PUBLISHING_BLOCK. */
|
|
29
17
|
COLLECTING_ATTESTATIONS = "COLLECTING_ATTESTATIONS",
|
|
30
|
-
/**
|
|
31
|
-
* Sending the tx to L1 with the L2 block data and awaiting it to be mined. Will move to SYNCHRONIZING.
|
|
32
|
-
*/
|
|
18
|
+
/** Sending the tx to L1 with the L2 block data and awaiting it to be mined. Will move to SYNCHRONIZING. */
|
|
33
19
|
PUBLISHING_BLOCK = "PUBLISHING_BLOCK"
|
|
34
20
|
}
|
|
35
21
|
export type SequencerStateWithSlot = SequencerState.INITIALIZING_PROPOSAL | SequencerState.CREATING_BLOCK | SequencerState.COLLECTING_ATTESTATIONS | SequencerState.PUBLISHING_BLOCK | SequencerState.PROPOSER_CHECK;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/sequencer/utils.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/sequencer/utils.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,qEAAqE;IACrE,OAAO,YAAY;IACnB,gEAAgE;IAChE,QAAQ,aAAa;IACrB,qDAAqD;IACrD,IAAI,SAAS;IACb,uCAAuC;IACvC,aAAa,kBAAkB;IAC/B,4DAA4D;IAC5D,cAAc,mBAAmB;IACjC,0IAA0I;IAC1I,qBAAqB,0BAA0B;IAC/C,6IAA6I;IAC7I,cAAc,mBAAmB;IACjC,6EAA6E;IAC7E,uBAAuB,4BAA4B;IACnD,2GAA2G;IAC3G,gBAAgB,qBAAqB;CACtC;AAED,MAAM,MAAM,sBAAsB,GAC9B,cAAc,CAAC,qBAAqB,GACpC,cAAc,CAAC,cAAc,GAC7B,cAAc,CAAC,uBAAuB,GACtC,cAAc,CAAC,gBAAgB,GAC/B,cAAc,CAAC,cAAc,CAAC;AAElC,MAAM,MAAM,sBAAsB,GAAG,MAAM,cAAc,CAAC;AAE1D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEpE"}
|
package/dest/sequencer/utils.js
CHANGED
|
@@ -1,28 +1,13 @@
|
|
|
1
1
|
export var SequencerState = /*#__PURE__*/ function(SequencerState) {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Checking if we are the proposer for the current slot.
|
|
13
|
-
*/ SequencerState["PROPOSER_CHECK"] = "PROPOSER_CHECK";
|
|
14
|
-
/**
|
|
15
|
-
* Initializing the block proposal. Will move to CREATING_BLOCK if there are valid txs to include, or back to SYNCHRONIZING otherwise.
|
|
16
|
-
*/ SequencerState["INITIALIZING_PROPOSAL"] = "INITIALIZING_PROPOSAL";
|
|
17
|
-
/**
|
|
18
|
-
* Creating a new L2 block. Includes processing public function calls and running rollup circuits. Will move to PUBLISHING_CONTRACT_DATA.
|
|
19
|
-
*/ SequencerState["CREATING_BLOCK"] = "CREATING_BLOCK";
|
|
20
|
-
/**
|
|
21
|
-
* Collecting attestations from its peers. Will move to PUBLISHING_BLOCK.
|
|
22
|
-
*/ SequencerState["COLLECTING_ATTESTATIONS"] = "COLLECTING_ATTESTATIONS";
|
|
23
|
-
/**
|
|
24
|
-
* Sending the tx to L1 with the L2 block data and awaiting it to be mined. Will move to SYNCHRONIZING.
|
|
25
|
-
*/ SequencerState["PUBLISHING_BLOCK"] = "PUBLISHING_BLOCK";
|
|
2
|
+
/** Sequencer is stopped and not processing any txs from the pool. */ SequencerState["STOPPED"] = "STOPPED";
|
|
3
|
+
/** Sequencer is being stopped. Will move to STOPPED shortly. */ SequencerState["STOPPING"] = "STOPPING";
|
|
4
|
+
/** Sequencer is awaiting the next call to work(). */ SequencerState["IDLE"] = "IDLE";
|
|
5
|
+
/** Synchronizing with the L2 chain. */ SequencerState["SYNCHRONIZING"] = "SYNCHRONIZING";
|
|
6
|
+
/** Checking if we are the proposer for the current slot. */ SequencerState["PROPOSER_CHECK"] = "PROPOSER_CHECK";
|
|
7
|
+
/** Initializing the block proposal. Will move to CREATING_BLOCK if there are valid txs to include, or back to SYNCHRONIZING otherwise. */ SequencerState["INITIALIZING_PROPOSAL"] = "INITIALIZING_PROPOSAL";
|
|
8
|
+
/** Creating a new L2 block. Includes processing public function calls and running rollup circuits. Will move to PUBLISHING_CONTRACT_DATA. */ SequencerState["CREATING_BLOCK"] = "CREATING_BLOCK";
|
|
9
|
+
/** Collecting attestations from its peers. Will move to PUBLISHING_BLOCK. */ SequencerState["COLLECTING_ATTESTATIONS"] = "COLLECTING_ATTESTATIONS";
|
|
10
|
+
/** Sending the tx to L1 with the L2 block data and awaiting it to be mined. Will move to SYNCHRONIZING. */ SequencerState["PUBLISHING_BLOCK"] = "PUBLISHING_BLOCK";
|
|
26
11
|
return SequencerState;
|
|
27
12
|
}({});
|
|
28
13
|
export function sequencerStateToNumber(state) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251004",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -26,37 +26,37 @@
|
|
|
26
26
|
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
30
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
31
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
32
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
33
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
34
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
35
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
36
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
37
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
38
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
39
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
40
|
-
"@aztec/noir-acvm_js": "3.0.0-nightly.
|
|
41
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
42
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
43
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
44
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
45
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
46
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
47
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
48
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
49
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
50
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
51
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
52
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
29
|
+
"@aztec/aztec.js": "3.0.0-nightly.20251004",
|
|
30
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251004",
|
|
31
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251004",
|
|
32
|
+
"@aztec/blob-sink": "3.0.0-nightly.20251004",
|
|
33
|
+
"@aztec/constants": "3.0.0-nightly.20251004",
|
|
34
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20251004",
|
|
35
|
+
"@aztec/ethereum": "3.0.0-nightly.20251004",
|
|
36
|
+
"@aztec/foundation": "3.0.0-nightly.20251004",
|
|
37
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251004",
|
|
38
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251004",
|
|
39
|
+
"@aztec/node-keystore": "3.0.0-nightly.20251004",
|
|
40
|
+
"@aztec/noir-acvm_js": "3.0.0-nightly.20251004",
|
|
41
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251004",
|
|
42
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251004",
|
|
43
|
+
"@aztec/noir-types": "3.0.0-nightly.20251004",
|
|
44
|
+
"@aztec/p2p": "3.0.0-nightly.20251004",
|
|
45
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251004",
|
|
46
|
+
"@aztec/prover-client": "3.0.0-nightly.20251004",
|
|
47
|
+
"@aztec/simulator": "3.0.0-nightly.20251004",
|
|
48
|
+
"@aztec/slasher": "3.0.0-nightly.20251004",
|
|
49
|
+
"@aztec/stdlib": "3.0.0-nightly.20251004",
|
|
50
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251004",
|
|
51
|
+
"@aztec/validator-client": "3.0.0-nightly.20251004",
|
|
52
|
+
"@aztec/world-state": "3.0.0-nightly.20251004",
|
|
53
53
|
"lodash.chunk": "^4.2.0",
|
|
54
54
|
"tslib": "^2.4.0",
|
|
55
55
|
"viem": "2.23.7"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
59
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
58
|
+
"@aztec/archiver": "3.0.0-nightly.20251004",
|
|
59
|
+
"@aztec/kv-store": "3.0.0-nightly.20251004",
|
|
60
60
|
"@jest/globals": "^30.0.0",
|
|
61
61
|
"@types/jest": "^30.0.0",
|
|
62
62
|
"@types/lodash.chunk": "^4.2.7",
|
package/src/publisher/config.ts
CHANGED
|
@@ -33,8 +33,6 @@ export type TxSenderConfig = L1ReaderConfig & {
|
|
|
33
33
|
*/
|
|
34
34
|
export type PublisherConfig = L1TxUtilsConfig &
|
|
35
35
|
BlobSinkConfig & {
|
|
36
|
-
/** The interval to wait between publish retries. */
|
|
37
|
-
l1PublishRetryIntervalMS: number;
|
|
38
36
|
/** True to use publishers in invalid states (timed out, cancelled, etc) if no other is available */
|
|
39
37
|
publisherAllowInvalidStates?: boolean;
|
|
40
38
|
};
|
|
@@ -65,16 +63,10 @@ export function getTxSenderConfigFromEnv(scope: 'PROVER' | 'SEQ'): Omit<TxSender
|
|
|
65
63
|
export const getPublisherConfigMappings: (
|
|
66
64
|
scope: 'PROVER' | 'SEQ',
|
|
67
65
|
) => ConfigMappingsType<PublisherConfig & L1TxUtilsConfig> = scope => ({
|
|
68
|
-
l1PublishRetryIntervalMS: {
|
|
69
|
-
env: scope === `PROVER` ? `PROVER_PUBLISH_RETRY_INTERVAL_MS` : `SEQ_PUBLISH_RETRY_INTERVAL_MS`,
|
|
70
|
-
parseEnv: (val: string) => +val,
|
|
71
|
-
defaultValue: 1000,
|
|
72
|
-
description: 'The interval to wait between publish retries.',
|
|
73
|
-
},
|
|
74
66
|
publisherAllowInvalidStates: {
|
|
75
67
|
description: 'True to use publishers in invalid states (timed out, cancelled, etc) if no other is available',
|
|
76
68
|
env: scope === `PROVER` ? `PROVER_PUBLISHER_ALLOW_INVALID_STATES` : `SEQ_PUBLISHER_ALLOW_INVALID_STATES`,
|
|
77
|
-
...booleanConfigHelper(
|
|
69
|
+
...booleanConfigHelper(true),
|
|
78
70
|
},
|
|
79
71
|
...l1TxUtilsConfigMappings,
|
|
80
72
|
...blobSinkConfigMapping,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type IEmpireBase,
|
|
10
10
|
type L1BlobInputs,
|
|
11
11
|
type L1ContractsConfig,
|
|
12
|
-
type
|
|
12
|
+
type L1TxConfig,
|
|
13
13
|
type L1TxRequest,
|
|
14
14
|
MULTI_CALL_3_ADDRESS,
|
|
15
15
|
Multicall3,
|
|
@@ -92,7 +92,7 @@ interface RequestWithExpiry {
|
|
|
92
92
|
action: Action;
|
|
93
93
|
request: L1TxRequest;
|
|
94
94
|
lastValidL2Slot: bigint;
|
|
95
|
-
gasConfig?: Pick<
|
|
95
|
+
gasConfig?: Pick<L1TxConfig, 'txTimeoutAt' | 'gasLimit'>;
|
|
96
96
|
blobConfig?: L1BlobInputs;
|
|
97
97
|
checkSuccess: (
|
|
98
98
|
request: L1TxRequest,
|
|
@@ -247,18 +247,21 @@ export class SequencerPublisher {
|
|
|
247
247
|
const gasLimit = gasLimits.length > 0 ? sumBigint(gasLimits) : undefined; // sum
|
|
248
248
|
const txTimeoutAts = gasConfigs.map(g => g?.txTimeoutAt).filter((g): g is Date => g !== undefined);
|
|
249
249
|
const txTimeoutAt = txTimeoutAts.length > 0 ? new Date(Math.min(...txTimeoutAts.map(g => g.getTime()))) : undefined; // earliest
|
|
250
|
-
const
|
|
250
|
+
const txConfig: RequestWithExpiry['gasConfig'] = { gasLimit, txTimeoutAt };
|
|
251
251
|
|
|
252
252
|
// Sort the requests so that proposals always go first
|
|
253
253
|
// This ensures the committee gets precomputed correctly
|
|
254
254
|
validRequests.sort((a, b) => compareActions(a.action, b.action));
|
|
255
255
|
|
|
256
256
|
try {
|
|
257
|
-
this.log.debug('Forwarding transactions', {
|
|
257
|
+
this.log.debug('Forwarding transactions', {
|
|
258
|
+
validRequests: validRequests.map(request => request.action),
|
|
259
|
+
txConfig,
|
|
260
|
+
});
|
|
258
261
|
const result = await Multicall3.forward(
|
|
259
262
|
validRequests.map(request => request.request),
|
|
260
263
|
this.l1TxUtils,
|
|
261
|
-
|
|
264
|
+
txConfig,
|
|
262
265
|
blobConfig,
|
|
263
266
|
this.rollupContract.address,
|
|
264
267
|
this.log,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SequencerState } from './utils.js';
|
|
2
|
+
|
|
3
|
+
export class SequencerTooSlowError extends Error {
|
|
4
|
+
constructor(
|
|
5
|
+
public readonly proposedState: SequencerState,
|
|
6
|
+
public readonly maxAllowedTime: number,
|
|
7
|
+
public readonly currentTime: number,
|
|
8
|
+
) {
|
|
9
|
+
super(
|
|
10
|
+
`Too far into slot for ${proposedState} (time into slot ${currentTime}s greater than ${maxAllowedTime}s allowance)`,
|
|
11
|
+
);
|
|
12
|
+
this.name = 'SequencerTooSlowError';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class SequencerInterruptedError extends Error {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(`Sequencer was interrupted`);
|
|
19
|
+
this.name = 'SequencerInterruptedError';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
type L2BlockSource,
|
|
19
19
|
type ValidateBlockResult,
|
|
20
20
|
} from '@aztec/stdlib/block';
|
|
21
|
-
import { type L1RollupConstants, getSlotAtTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
21
|
+
import { type L1RollupConstants, getSlotAtTimestamp, getSlotStartBuildTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
22
22
|
import { Gas } from '@aztec/stdlib/gas';
|
|
23
23
|
import {
|
|
24
24
|
type IFullNodeBlockBuilder,
|
|
@@ -45,8 +45,9 @@ import type { GlobalVariableBuilder } from '../global_variable_builder/global_bu
|
|
|
45
45
|
import type { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
|
|
46
46
|
import type { Action, InvalidateBlockRequest, SequencerPublisher } from '../publisher/sequencer-publisher.js';
|
|
47
47
|
import type { SequencerConfig } from './config.js';
|
|
48
|
+
import { SequencerInterruptedError, SequencerTooSlowError } from './errors.js';
|
|
48
49
|
import { SequencerMetrics } from './metrics.js';
|
|
49
|
-
import { SequencerTimetable
|
|
50
|
+
import { SequencerTimetable } from './timetable.js';
|
|
50
51
|
import { SequencerState, type SequencerStateWithSlot } from './utils.js';
|
|
51
52
|
|
|
52
53
|
export { SequencerState };
|
|
@@ -223,6 +224,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
223
224
|
*/
|
|
224
225
|
public async stop(): Promise<void> {
|
|
225
226
|
this.log.info(`Stopping sequencer`);
|
|
227
|
+
this.setState(SequencerState.STOPPING, undefined, { force: true });
|
|
226
228
|
this.publisher?.interrupt();
|
|
227
229
|
await this.runningPromise?.stop();
|
|
228
230
|
this.setState(SequencerState.STOPPED, undefined, { force: true });
|
|
@@ -524,6 +526,10 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
524
526
|
opts?: { force?: boolean },
|
|
525
527
|
): void;
|
|
526
528
|
setState(proposedState: SequencerState, slotNumber: bigint | undefined, opts: { force?: boolean } = {}): void {
|
|
529
|
+
if (this.state === SequencerState.STOPPING && proposedState !== SequencerState.STOPPED && !opts.force) {
|
|
530
|
+
this.log.warn(`Cannot set sequencer to ${proposedState} as it is stopping.`);
|
|
531
|
+
throw new SequencerInterruptedError();
|
|
532
|
+
}
|
|
527
533
|
if (this.state === SequencerState.STOPPED && !opts.force) {
|
|
528
534
|
this.log.warn(`Cannot set sequencer from ${this.state} to ${proposedState} as it is stopped.`);
|
|
529
535
|
return;
|
|
@@ -954,11 +960,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
954
960
|
}
|
|
955
961
|
|
|
956
962
|
private getSlotStartBuildTimestamp(slotNumber: number | bigint): number {
|
|
957
|
-
return (
|
|
958
|
-
Number(this.l1Constants.l1GenesisTime) +
|
|
959
|
-
Number(slotNumber) * this.l1Constants.slotDuration -
|
|
960
|
-
this.l1Constants.ethereumSlotDuration
|
|
961
|
-
);
|
|
963
|
+
return getSlotStartBuildTimestamp(slotNumber, this.l1Constants);
|
|
962
964
|
}
|
|
963
965
|
|
|
964
966
|
private getSecondsIntoSlot(slotNumber: number | bigint): number {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js';
|
|
2
2
|
|
|
3
3
|
import { DEFAULT_ATTESTATION_PROPAGATION_TIME } from '../config.js';
|
|
4
|
+
import { SequencerTooSlowError } from './errors.js';
|
|
4
5
|
import type { SequencerMetrics } from './metrics.js';
|
|
5
6
|
import { SequencerState } from './utils.js';
|
|
6
7
|
|
|
@@ -139,6 +140,7 @@ export class SequencerTimetable {
|
|
|
139
140
|
public getMaxAllowedTime(state: SequencerState): number | undefined {
|
|
140
141
|
switch (state) {
|
|
141
142
|
case SequencerState.STOPPED:
|
|
143
|
+
case SequencerState.STOPPING:
|
|
142
144
|
case SequencerState.IDLE:
|
|
143
145
|
case SequencerState.SYNCHRONIZING:
|
|
144
146
|
return; // We don't really care about times for this states
|
|
@@ -177,16 +179,3 @@ export class SequencerTimetable {
|
|
|
177
179
|
this.log.trace(`Enough time to transition to ${newState}`, { maxAllowedTime, secondsIntoSlot });
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
|
-
|
|
181
|
-
export class SequencerTooSlowError extends Error {
|
|
182
|
-
constructor(
|
|
183
|
-
public readonly proposedState: SequencerState,
|
|
184
|
-
public readonly maxAllowedTime: number,
|
|
185
|
-
public readonly currentTime: number,
|
|
186
|
-
) {
|
|
187
|
-
super(
|
|
188
|
-
`Too far into slot for ${proposedState} (time into slot ${currentTime}s greater than ${maxAllowedTime}s allowance)`,
|
|
189
|
-
);
|
|
190
|
-
this.name = 'SequencerTooSlowError';
|
|
191
|
-
}
|
|
192
|
-
}
|
package/src/sequencer/utils.ts
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
1
|
export enum SequencerState {
|
|
2
|
-
/**
|
|
3
|
-
* Sequencer is stopped and not processing any txs from the pool.
|
|
4
|
-
*/
|
|
2
|
+
/** Sequencer is stopped and not processing any txs from the pool. */
|
|
5
3
|
STOPPED = 'STOPPED',
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/** Sequencer is being stopped. Will move to STOPPED shortly. */
|
|
5
|
+
STOPPING = 'STOPPING',
|
|
6
|
+
/** Sequencer is awaiting the next call to work(). */
|
|
9
7
|
IDLE = 'IDLE',
|
|
10
|
-
/**
|
|
11
|
-
* Synchronizing with the L2 chain.
|
|
12
|
-
*/
|
|
8
|
+
/** Synchronizing with the L2 chain. */
|
|
13
9
|
SYNCHRONIZING = 'SYNCHRONIZING',
|
|
14
|
-
/**
|
|
15
|
-
* Checking if we are the proposer for the current slot.
|
|
16
|
-
*/
|
|
10
|
+
/** Checking if we are the proposer for the current slot. */
|
|
17
11
|
PROPOSER_CHECK = 'PROPOSER_CHECK',
|
|
18
|
-
/**
|
|
19
|
-
* Initializing the block proposal. Will move to CREATING_BLOCK if there are valid txs to include, or back to SYNCHRONIZING otherwise.
|
|
20
|
-
*/
|
|
12
|
+
/** Initializing the block proposal. Will move to CREATING_BLOCK if there are valid txs to include, or back to SYNCHRONIZING otherwise. */
|
|
21
13
|
INITIALIZING_PROPOSAL = 'INITIALIZING_PROPOSAL',
|
|
22
|
-
/**
|
|
23
|
-
* Creating a new L2 block. Includes processing public function calls and running rollup circuits. Will move to PUBLISHING_CONTRACT_DATA.
|
|
24
|
-
*/
|
|
14
|
+
/** Creating a new L2 block. Includes processing public function calls and running rollup circuits. Will move to PUBLISHING_CONTRACT_DATA. */
|
|
25
15
|
CREATING_BLOCK = 'CREATING_BLOCK',
|
|
26
|
-
/**
|
|
27
|
-
* Collecting attestations from its peers. Will move to PUBLISHING_BLOCK.
|
|
28
|
-
*/
|
|
16
|
+
/** Collecting attestations from its peers. Will move to PUBLISHING_BLOCK. */
|
|
29
17
|
COLLECTING_ATTESTATIONS = 'COLLECTING_ATTESTATIONS',
|
|
30
|
-
/**
|
|
31
|
-
* Sending the tx to L1 with the L2 block data and awaiting it to be mined. Will move to SYNCHRONIZING.
|
|
32
|
-
*/
|
|
18
|
+
/** Sending the tx to L1 with the L2 block data and awaiting it to be mined. Will move to SYNCHRONIZING. */
|
|
33
19
|
PUBLISHING_BLOCK = 'PUBLISHING_BLOCK',
|
|
34
20
|
}
|
|
35
21
|
|