@aztec/sequencer-client 0.86.0-starknet.1 → 0.87.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/config.d.ts.map +1 -1
- package/dest/config.js +5 -0
- package/dest/publisher/sequencer-publisher-metrics.js +2 -2
- package/dest/publisher/sequencer-publisher.d.ts +2 -4
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/sequencer/metrics.d.ts +1 -0
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +3 -0
- package/dest/sequencer/sequencer.d.ts +3 -3
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +13 -8
- package/dest/sequencer/timetable.d.ts +3 -3
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +7 -2
- package/dest/slasher/factory.d.ts.map +1 -1
- package/dest/tx_validator/nullifier_cache.d.ts +0 -2
- package/dest/tx_validator/nullifier_cache.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/client/sequencer-client.ts +1 -1
- package/src/config.ts +5 -0
- package/src/publisher/sequencer-publisher-metrics.ts +2 -2
- package/src/sequencer/metrics.ts +4 -0
- package/src/sequencer/sequencer.ts +12 -7
- package/src/sequencer/timetable.ts +12 -9
- package/src/slasher/slasher_client.ts +1 -1
- package/src/test/index.ts +4 -4
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAu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,CACF,iBAAiB,EACjB,sBAAsB,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,4BAA4B,CACnG,CAAC;AAEJ,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,eAAe,CAwEvE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CAanF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
|
package/dest/config.js
CHANGED
|
@@ -23,6 +23,11 @@ export const sequencerConfigMappings = {
|
|
|
23
23
|
description: 'The minimum number of txs to include in a block.',
|
|
24
24
|
...numberConfigHelper(1)
|
|
25
25
|
},
|
|
26
|
+
publishTxsWithProposals: {
|
|
27
|
+
env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
|
|
28
|
+
description: 'Whether to publish txs with proposals.',
|
|
29
|
+
...booleanConfigHelper(false)
|
|
30
|
+
},
|
|
26
31
|
maxL2BlockGas: {
|
|
27
32
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
28
33
|
description: 'The maximum L2 block gas.',
|
|
@@ -149,7 +149,7 @@ export class SequencerPublisherMetrics {
|
|
|
149
149
|
this.txBlobDataGasUsed.record(Number(stats.blobGasUsed), attributes);
|
|
150
150
|
try {
|
|
151
151
|
this.gasPrice.record(parseInt(formatEther(stats.gasPrice, 'gwei'), 10));
|
|
152
|
-
} catch
|
|
152
|
+
} catch {
|
|
153
153
|
// ignore
|
|
154
154
|
}
|
|
155
155
|
const executionFee = stats.gasUsed * stats.gasPrice;
|
|
@@ -157,7 +157,7 @@ export class SequencerPublisherMetrics {
|
|
|
157
157
|
const totalFee = executionFee + blobFee;
|
|
158
158
|
try {
|
|
159
159
|
this.txTotalFee.record(parseFloat(formatEther(totalFee)));
|
|
160
|
-
} catch
|
|
160
|
+
} catch {
|
|
161
161
|
// ignore
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { L2Block } from '@aztec/aztec.js';
|
|
4
2
|
import { Blob } from '@aztec/blob-lib';
|
|
5
3
|
import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
@@ -79,12 +77,12 @@ export declare class SequencerPublisher {
|
|
|
79
77
|
*/
|
|
80
78
|
sendRequests(): Promise<{
|
|
81
79
|
result: {
|
|
82
|
-
receipt:
|
|
80
|
+
receipt: import("viem").TransactionReceipt;
|
|
83
81
|
gasPrice: GasPrice;
|
|
84
82
|
stats: TransactionStats | undefined;
|
|
85
83
|
errorMsg?: undefined;
|
|
86
84
|
} | {
|
|
87
|
-
receipt:
|
|
85
|
+
receipt: import("viem").TransactionReceipt;
|
|
88
86
|
gasPrice: GasPrice;
|
|
89
87
|
errorMsg: string | undefined;
|
|
90
88
|
stats?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher.ts"],"names":[],"mappings":"
|
|
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;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,0BAA0B,EAE/B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CA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MG;IACU,YAAY;;;;;;;;;;;;;;;IAuEzB,OAAO,CAAC,2BAA2B;IAYnC;;;;OAIG;IACI,wBAAwB,CAAC,UAAU,EAAE,MAAM;IAclD;;;;;;;;OAQG;IACU,0BAA0B,CACrC,MAAM,EAAE,mBAAmB,EAC3B,eAAe,GAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,SAAS,EAAE,CAAA;KAGzD,GACA,OAAO,CAAC,MAAM,CAAC;IAmBL,wBAAwB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YAKhD,qBAAqB;YA8CrB,aAAa;IAmB3B;;;;;;OAMG;IACU,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IASzG;;;;;OAKG;IACU,qBAAqB,CAChC,KAAK,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,SAAS,EAAE,EAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,EACnB,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO,GAChC,OAAO,CAAC,OAAO,CAAC;IA+BnB;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;YAKA,gBAAgB;YAoGhB,YAAY;IAoE1B;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlF"}
|
|
@@ -21,6 +21,7 @@ export declare class SequencerMetrics {
|
|
|
21
21
|
private missedSlots;
|
|
22
22
|
private lastSeenSlot?;
|
|
23
23
|
constructor(client: TelemetryClient, getState: SequencerStateCallback, coinbase: EthAddress, rollup: RollupContract, name?: string);
|
|
24
|
+
setCoinbase(coinbase: EthAddress): void;
|
|
24
25
|
start(): void;
|
|
25
26
|
stop(): void;
|
|
26
27
|
private observe;
|
|
@@ -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nC,OAAO,CAAC,WAAW,CAAgB;IAEnC,OAAO,CAAC,YAAY,CAAC,CAAS;gBAG5B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,sBAAsB,EACxB,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,cAAc,EAC9B,IAAI,SAAc;IA2Fb,WAAW,CAAC,QAAQ,EAAE,UAAU;IAIhC,KAAK;IAIL,IAAI;IAIX,OAAO,CAAC,OAAO,CAQb;IAEF,gCAAgC,IAAI,MAAM,IAAI;IAS9C,+BAA+B,CAAC,IAAI,EAAE,MAAM;IAI5C,gCAAgC,CAAC,MAAM,EAAE,MAAM;IAI/C,oBAAoB;IAOpB,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAQ3D,iBAAiB;IAOjB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAInD,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc;IAMvE,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM;IAqB5D,aAAa,CAAC,QAAQ,EAAE,MAAM;IAO9B,OAAO,CAAC,eAAe;CAIxB"}
|
|
@@ -99,6 +99,9 @@ export class SequencerMetrics {
|
|
|
99
99
|
description: 'The number of slots this sequencer has missed to fill'
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
+
setCoinbase(coinbase) {
|
|
103
|
+
this.coinbase = coinbase;
|
|
104
|
+
}
|
|
102
105
|
start() {
|
|
103
106
|
this.meter.addBatchObservableCallback(this.observe, [
|
|
104
107
|
this.rewards
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { type L2Block } from '@aztec/aztec.js';
|
|
4
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
3
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
@@ -144,6 +142,7 @@ export declare class Sequencer {
|
|
|
144
142
|
numTxs: number;
|
|
145
143
|
numFailedTxs: number;
|
|
146
144
|
blockBuildingTimer: Timer;
|
|
145
|
+
usedTxs: Tx[];
|
|
147
146
|
}>;
|
|
148
147
|
/**
|
|
149
148
|
* Build a block from a proposal. Used by the validator to re-execute transactions.
|
|
@@ -163,6 +162,7 @@ export declare class Sequencer {
|
|
|
163
162
|
numTxs: number;
|
|
164
163
|
numFailedTxs: number;
|
|
165
164
|
blockBuildingTimer: Timer;
|
|
165
|
+
usedTxs: Tx[];
|
|
166
166
|
}>;
|
|
167
167
|
/**
|
|
168
168
|
* @notice Build and propose a block to the chain
|
|
@@ -174,7 +174,7 @@ export declare class Sequencer {
|
|
|
174
174
|
* @param proposalHeader - The partial header constructed for the proposal
|
|
175
175
|
*/
|
|
176
176
|
private buildBlockAndEnqueuePublish;
|
|
177
|
-
protected collectAttestations(block: L2Block,
|
|
177
|
+
protected collectAttestations(block: L2Block, txs: Tx[]): Promise<Signature[] | undefined>;
|
|
178
178
|
/**
|
|
179
179
|
* Publishes the L2Block to the rollup contract.
|
|
180
180
|
* @param block - The L2Block to be published.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,iBAAiB,CAAC;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAW,MAAM,yBAAyB,CAAC;AAC5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AOG;IACG,sBAAsB,CAC1B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,mBAAmB,EAC3B,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC,EAC5C,IAAI,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO;;;;;;;;;;IAavC;;;;;;;;OAQG;YAIW,2BAA2B;cAkEzB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC;IAqDhG;;;OAGG;cAIa,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,SAAS,EAAE,EAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC;IAiBhB;;;;OAIG;cACa,WAAW,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,EAAE,CAAA;KAAE,GAAG,SAAS,CAAC;IA+CxF,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,kBAAkB;IAK1B,IAAI,iBAAiB,WAEpB;IAED,IAAI,QAAQ,IAAI,UAAU,CAEzB;IAED,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;CACF"}
|
|
@@ -95,7 +95,7 @@ export { SequencerState };
|
|
|
95
95
|
this.maxBlockGas = new Gas(100e9, 100e9);
|
|
96
96
|
this.isFlushing = false;
|
|
97
97
|
this.enforceTimeTable = false;
|
|
98
|
-
this.metrics = new SequencerMetrics(telemetry, ()=>this.state, this.
|
|
98
|
+
this.metrics = new SequencerMetrics(telemetry, ()=>this.state, this.config.coinbase ?? this.publisher.getSenderAddress(), this.publisher.getRollupContract(), 'Sequencer');
|
|
99
99
|
this.l1Metrics = new L1Metrics(telemetry.getMeter('SequencerL1Metrics'), publisher.l1TxUtils.client, [
|
|
100
100
|
publisher.getSenderAddress()
|
|
101
101
|
]);
|
|
@@ -132,6 +132,7 @@ export { SequencerState };
|
|
|
132
132
|
}
|
|
133
133
|
if (config.coinbase) {
|
|
134
134
|
this._coinbase = config.coinbase;
|
|
135
|
+
this.metrics.setCoinbase(this._coinbase);
|
|
135
136
|
}
|
|
136
137
|
if (config.feeRecipient) {
|
|
137
138
|
this._feeRecipient = config.feeRecipient;
|
|
@@ -404,7 +405,7 @@ export { SequencerState };
|
|
|
404
405
|
deadline,
|
|
405
406
|
...proposerLimits
|
|
406
407
|
};
|
|
407
|
-
const [publicProcessorDuration, [processedTxs, failedTxs]] = await elapsed(()=>processor.process(pendingTxs, limits, validator));
|
|
408
|
+
const [publicProcessorDuration, [processedTxs, failedTxs, usedTxs]] = await elapsed(()=>processor.process(pendingTxs, limits, validator));
|
|
408
409
|
if (!opts.validateOnly && failedTxs.length > 0) {
|
|
409
410
|
const failedTxData = failedTxs.map((fail)=>fail.tx);
|
|
410
411
|
const failedTxHashes = await Tx.getHashes(failedTxData);
|
|
@@ -437,7 +438,8 @@ export { SequencerState };
|
|
|
437
438
|
numMsgs: l1ToL2Messages.length,
|
|
438
439
|
numTxs: processedTxs.length,
|
|
439
440
|
numFailedTxs: failedTxs.length,
|
|
440
|
-
blockBuildingTimer
|
|
441
|
+
blockBuildingTimer,
|
|
442
|
+
usedTxs
|
|
441
443
|
};
|
|
442
444
|
} finally{
|
|
443
445
|
// We create a fresh processor each time to reset any cached state (eg storage writes)
|
|
@@ -490,7 +492,7 @@ export { SequencerState };
|
|
|
490
492
|
this.setState(SequencerState.CREATING_BLOCK, slot);
|
|
491
493
|
try {
|
|
492
494
|
const buildBlockRes = await this.buildBlock(pendingTxs, newGlobalVariables);
|
|
493
|
-
const { publicGas, block, publicProcessorDuration, numTxs, numMsgs, blockBuildingTimer } = buildBlockRes;
|
|
495
|
+
const { publicGas, block, publicProcessorDuration, numTxs, numMsgs, blockBuildingTimer, usedTxs } = buildBlockRes;
|
|
494
496
|
this.metrics.recordBuiltBlock(workTimer.ms(), publicGas.l2Gas);
|
|
495
497
|
// TODO(@PhilWindle) We should probably periodically check for things like another
|
|
496
498
|
// block being published before ours instead of just waiting on our block
|
|
@@ -513,7 +515,7 @@ export { SequencerState };
|
|
|
513
515
|
});
|
|
514
516
|
this.log.debug('Collecting attestations');
|
|
515
517
|
const stopCollectingAttestationsTimer = this.metrics.startCollectingAttestationsTimer();
|
|
516
|
-
const attestations = await this.collectAttestations(block,
|
|
518
|
+
const attestations = await this.collectAttestations(block, usedTxs);
|
|
517
519
|
if (attestations !== undefined) {
|
|
518
520
|
this.log.verbose(`Collected ${attestations.length} attestations`, {
|
|
519
521
|
blockHash,
|
|
@@ -527,7 +529,7 @@ export { SequencerState };
|
|
|
527
529
|
throw err;
|
|
528
530
|
}
|
|
529
531
|
}
|
|
530
|
-
async collectAttestations(block,
|
|
532
|
+
async collectAttestations(block, txs) {
|
|
531
533
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/7962): inefficient to have a round trip in here - this should be cached
|
|
532
534
|
const committee = await this.publisher.getCurrentEpochCommittee();
|
|
533
535
|
if (committee.length === 0) {
|
|
@@ -545,13 +547,16 @@ export { SequencerState };
|
|
|
545
547
|
const slotNumber = block.header.globalVariables.slotNumber.toBigInt();
|
|
546
548
|
this.setState(SequencerState.COLLECTING_ATTESTATIONS, slotNumber);
|
|
547
549
|
this.log.debug('Creating block proposal for validators');
|
|
548
|
-
const
|
|
550
|
+
const blockProposalOptions = {
|
|
551
|
+
publishFullTxs: !!this.config.publishTxsWithProposals
|
|
552
|
+
};
|
|
553
|
+
const proposal = await this.validatorClient.createBlockProposal(block.header.globalVariables.blockNumber, block.header.toPropose(), block.archive.root, block.header.state, txs, blockProposalOptions);
|
|
549
554
|
if (!proposal) {
|
|
550
555
|
const msg = `Failed to create block proposal`;
|
|
551
556
|
throw new Error(msg);
|
|
552
557
|
}
|
|
553
558
|
this.log.debug('Broadcasting block proposal to validators');
|
|
554
|
-
this.validatorClient.broadcastBlockProposal(proposal);
|
|
559
|
+
await this.validatorClient.broadcastBlockProposal(proposal);
|
|
555
560
|
const attestationTimeAllowed = this.enforceTimeTable ? this.timetable.getMaxAllowedTime(SequencerState.PUBLISHING_BLOCK) : this.aztecSlotDuration;
|
|
556
561
|
const attestationDeadline = new Date(this.dateProvider.now() + attestationTimeAllowed * 1000);
|
|
557
562
|
const attestations = await this.validatorClient.collectAttestations(proposal, numberOfRequiredAttestations, attestationDeadline);
|
|
@@ -20,13 +20,13 @@ export declare class SequencerTimetable {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly l1PublishingTime: number;
|
|
22
22
|
/** What's the minimum time we want to leave available for execution and reexecution (used to derive init deadline) */
|
|
23
|
-
readonly minExecutionTime
|
|
23
|
+
readonly minExecutionTime: number;
|
|
24
24
|
/** How long it takes to get ready to start building */
|
|
25
|
-
readonly blockPrepareTime
|
|
25
|
+
readonly blockPrepareTime: number;
|
|
26
26
|
/** How long it takes to for proposals and attestations to travel across the p2p layer (one-way) */
|
|
27
27
|
readonly attestationPropagationTime: number;
|
|
28
28
|
/** How much time we spend validating and processing a block after building it, and assembling the proposal to send to attestors */
|
|
29
|
-
readonly blockValidationTime
|
|
29
|
+
readonly blockValidationTime: number;
|
|
30
30
|
constructor(ethereumSlotDuration: number, aztecSlotDuration: number, maxL1TxInclusionTimeIntoSlot: number, enforce?: boolean, metrics?: SequencerMetrics | undefined, log?: import("@aztec/aztec.js").Logger);
|
|
31
31
|
private get afterBlockBuildingTimeNeededWithoutReexec();
|
|
32
32
|
getBlockProposalExecTimeEnd(secondsIntoSlot: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|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EAAE,MAAM;CAkBxE;AAED,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"}
|
|
@@ -3,8 +3,7 @@ import { SequencerState } from './utils.js';
|
|
|
3
3
|
const MIN_EXECUTION_TIME = 1;
|
|
4
4
|
const BLOCK_PREPARE_TIME = 1;
|
|
5
5
|
const BLOCK_VALIDATION_TIME = 1;
|
|
6
|
-
|
|
7
|
-
const ATTESTATION_PROPAGATION_TIME = process.env.ATTESTATION_PROPAGATION_TIME ? parseInt(process.env.ATTESTATION_PROPAGATION_TIME, 10) : 2;
|
|
6
|
+
const ATTESTATION_PROPAGATION_TIME = 2;
|
|
8
7
|
export class SequencerTimetable {
|
|
9
8
|
ethereumSlotDuration;
|
|
10
9
|
aztecSlotDuration;
|
|
@@ -38,6 +37,12 @@ export class SequencerTimetable {
|
|
|
38
37
|
this.attestationPropagationTime = ATTESTATION_PROPAGATION_TIME;
|
|
39
38
|
this.blockValidationTime = BLOCK_VALIDATION_TIME;
|
|
40
39
|
this.l1PublishingTime = this.ethereumSlotDuration - this.maxL1TxInclusionTimeIntoSlot;
|
|
40
|
+
// Assume zero-cost propagation time and faster runs in test environments where L1 slot duration is shortened
|
|
41
|
+
if (this.ethereumSlotDuration < 8) {
|
|
42
|
+
this.attestationPropagationTime = 0;
|
|
43
|
+
this.blockValidationTime = 0.5;
|
|
44
|
+
this.blockPrepareTime = 0.5;
|
|
45
|
+
}
|
|
41
46
|
const allWorkToDo = this.blockPrepareTime + this.minExecutionTime * 2 + this.attestationPropagationTime * 2 + this.blockValidationTime + this.l1PublishingTime;
|
|
42
47
|
const initializeDeadline = this.aztecSlotDuration - allWorkToDo;
|
|
43
48
|
if (initializeDeadline <= 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/slasher/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/slasher/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,mBAAmB,GAC9B,SAAS,aAAa,GAAG,iBAAiB,GAAG,cAAc,EAC3D,eAAe,yBAAyB,EACxC,YAAW,eAAsC,kBAIlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullifier_cache.d.ts","sourceRoot":"","sources":["../../src/tx_validator/nullifier_cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nullifier_cache.d.ts","sourceRoot":"","sources":["../../src/tx_validator/nullifier_cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;;GAGG;AACH,qBAAa,cAAe,YAAW,eAAe;IAGxC,OAAO,CAAC,EAAE;IAFtB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEJ,EAAE,EAAE,wBAAwB;IAInC,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAS/D,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE;CAK1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -26,49 +26,49 @@
|
|
|
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": "0.
|
|
30
|
-
"@aztec/bb-prover": "0.
|
|
31
|
-
"@aztec/blob-lib": "0.
|
|
32
|
-
"@aztec/blob-sink": "0.
|
|
33
|
-
"@aztec/constants": "0.
|
|
34
|
-
"@aztec/epoch-cache": "0.
|
|
35
|
-
"@aztec/ethereum": "0.
|
|
36
|
-
"@aztec/foundation": "0.
|
|
37
|
-
"@aztec/l1-artifacts": "0.
|
|
38
|
-
"@aztec/merkle-tree": "0.
|
|
39
|
-
"@aztec/noir-acvm_js": "0.
|
|
40
|
-
"@aztec/noir-contracts.js": "0.
|
|
41
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
42
|
-
"@aztec/noir-types": "0.
|
|
43
|
-
"@aztec/p2p": "0.
|
|
44
|
-
"@aztec/protocol-contracts": "0.
|
|
45
|
-
"@aztec/prover-client": "0.
|
|
46
|
-
"@aztec/simulator": "0.
|
|
47
|
-
"@aztec/stdlib": "0.
|
|
48
|
-
"@aztec/telemetry-client": "0.
|
|
49
|
-
"@aztec/validator-client": "0.
|
|
50
|
-
"@aztec/world-state": "0.
|
|
29
|
+
"@aztec/aztec.js": "0.87.0",
|
|
30
|
+
"@aztec/bb-prover": "0.87.0",
|
|
31
|
+
"@aztec/blob-lib": "0.87.0",
|
|
32
|
+
"@aztec/blob-sink": "0.87.0",
|
|
33
|
+
"@aztec/constants": "0.87.0",
|
|
34
|
+
"@aztec/epoch-cache": "0.87.0",
|
|
35
|
+
"@aztec/ethereum": "0.87.0",
|
|
36
|
+
"@aztec/foundation": "0.87.0",
|
|
37
|
+
"@aztec/l1-artifacts": "0.87.0",
|
|
38
|
+
"@aztec/merkle-tree": "0.87.0",
|
|
39
|
+
"@aztec/noir-acvm_js": "0.87.0",
|
|
40
|
+
"@aztec/noir-contracts.js": "0.87.0",
|
|
41
|
+
"@aztec/noir-protocol-circuits-types": "0.87.0",
|
|
42
|
+
"@aztec/noir-types": "0.87.0",
|
|
43
|
+
"@aztec/p2p": "0.87.0",
|
|
44
|
+
"@aztec/protocol-contracts": "0.87.0",
|
|
45
|
+
"@aztec/prover-client": "0.87.0",
|
|
46
|
+
"@aztec/simulator": "0.87.0",
|
|
47
|
+
"@aztec/stdlib": "0.87.0",
|
|
48
|
+
"@aztec/telemetry-client": "0.87.0",
|
|
49
|
+
"@aztec/validator-client": "0.87.0",
|
|
50
|
+
"@aztec/world-state": "0.87.0",
|
|
51
51
|
"lodash.chunk": "^4.2.0",
|
|
52
52
|
"lodash.pick": "^4.4.0",
|
|
53
53
|
"tslib": "^2.4.0",
|
|
54
54
|
"viem": "2.23.7"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@aztec/archiver": "0.
|
|
58
|
-
"@aztec/kv-store": "0.
|
|
57
|
+
"@aztec/archiver": "0.87.0",
|
|
58
|
+
"@aztec/kv-store": "0.87.0",
|
|
59
59
|
"@jest/globals": "^29.5.0",
|
|
60
60
|
"@types/jest": "^29.5.0",
|
|
61
61
|
"@types/lodash.chunk": "^4.2.7",
|
|
62
62
|
"@types/lodash.pick": "^4.4.7",
|
|
63
|
-
"@types/node": "^
|
|
63
|
+
"@types/node": "^22.15.17",
|
|
64
64
|
"concurrently": "^7.6.0",
|
|
65
|
-
"eslint": "^
|
|
65
|
+
"eslint": "^9.26.0",
|
|
66
66
|
"express": "^4.21.1",
|
|
67
67
|
"jest": "^29.5.0",
|
|
68
68
|
"jest-mock-extended": "^3.0.3",
|
|
69
|
-
"prettier": "^
|
|
69
|
+
"prettier": "^3.5.3",
|
|
70
70
|
"ts-node": "^10.9.1",
|
|
71
|
-
"typescript": "^5.
|
|
71
|
+
"typescript": "^5.3.3"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
74
|
"dest",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
],
|
|
78
78
|
"types": "./dest/index.d.ts",
|
|
79
79
|
"engines": {
|
|
80
|
-
"node": ">=
|
|
80
|
+
"node": ">=20.10"
|
|
81
81
|
},
|
|
82
82
|
"jest": {
|
|
83
83
|
"extensionsToTreatAsEsm": [
|
|
@@ -157,7 +157,7 @@ export class SequencerClient {
|
|
|
157
157
|
// make it with a propagation time into slot equal to 4s. However, we prefer being conservative.
|
|
158
158
|
// See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
|
|
159
159
|
const maxL1TxInclusionTimeIntoSlot =
|
|
160
|
-
config.maxL1TxInclusionTimeIntoSlot ?? isAnvilTestChain(config.l1ChainId) ? ethereumSlotDuration : 0;
|
|
160
|
+
(config.maxL1TxInclusionTimeIntoSlot ?? isAnvilTestChain(config.l1ChainId)) ? ethereumSlotDuration : 0;
|
|
161
161
|
|
|
162
162
|
const l1Constants = {
|
|
163
163
|
l1GenesisTime,
|
package/src/config.ts
CHANGED
|
@@ -58,6 +58,11 @@ export const sequencerConfigMappings: ConfigMappingsType<SequencerConfig> = {
|
|
|
58
58
|
description: 'The minimum number of txs to include in a block.',
|
|
59
59
|
...numberConfigHelper(1),
|
|
60
60
|
},
|
|
61
|
+
publishTxsWithProposals: {
|
|
62
|
+
env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
|
|
63
|
+
description: 'Whether to publish txs with proposals.',
|
|
64
|
+
...booleanConfigHelper(false),
|
|
65
|
+
},
|
|
61
66
|
maxL2BlockGas: {
|
|
62
67
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
63
68
|
description: 'The maximum L2 block gas.',
|
|
@@ -181,7 +181,7 @@ export class SequencerPublisherMetrics {
|
|
|
181
181
|
|
|
182
182
|
try {
|
|
183
183
|
this.gasPrice.record(parseInt(formatEther(stats.gasPrice, 'gwei'), 10));
|
|
184
|
-
} catch
|
|
184
|
+
} catch {
|
|
185
185
|
// ignore
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -191,7 +191,7 @@ export class SequencerPublisherMetrics {
|
|
|
191
191
|
|
|
192
192
|
try {
|
|
193
193
|
this.txTotalFee.record(parseFloat(formatEther(totalFee)));
|
|
194
|
-
} catch
|
|
194
|
+
} catch {
|
|
195
195
|
// ignore
|
|
196
196
|
}
|
|
197
197
|
}
|
package/src/sequencer/metrics.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
type WorldStateSynchronizer,
|
|
24
24
|
} from '@aztec/stdlib/interfaces/server';
|
|
25
25
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
26
|
+
import type { BlockProposalOptions } from '@aztec/stdlib/p2p';
|
|
26
27
|
import { pickFromSchema } from '@aztec/stdlib/schemas';
|
|
27
28
|
import type { L2BlockBuiltStats } from '@aztec/stdlib/stats';
|
|
28
29
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
@@ -102,7 +103,7 @@ export class Sequencer {
|
|
|
102
103
|
this.metrics = new SequencerMetrics(
|
|
103
104
|
telemetry,
|
|
104
105
|
() => this.state,
|
|
105
|
-
this.
|
|
106
|
+
this.config.coinbase ?? this.publisher.getSenderAddress(),
|
|
106
107
|
this.publisher.getRollupContract(),
|
|
107
108
|
'Sequencer',
|
|
108
109
|
);
|
|
@@ -154,6 +155,7 @@ export class Sequencer {
|
|
|
154
155
|
}
|
|
155
156
|
if (config.coinbase) {
|
|
156
157
|
this._coinbase = config.coinbase;
|
|
158
|
+
this.metrics.setCoinbase(this._coinbase);
|
|
157
159
|
}
|
|
158
160
|
if (config.feeRecipient) {
|
|
159
161
|
this._feeRecipient = config.feeRecipient;
|
|
@@ -498,7 +500,7 @@ export class Sequencer {
|
|
|
498
500
|
maxBlockGas: this.maxBlockGas,
|
|
499
501
|
};
|
|
500
502
|
const limits = opts.validateOnly ? { deadline } : { deadline, ...proposerLimits };
|
|
501
|
-
const [publicProcessorDuration, [processedTxs, failedTxs]] = await elapsed(() =>
|
|
503
|
+
const [publicProcessorDuration, [processedTxs, failedTxs, usedTxs]] = await elapsed(() =>
|
|
502
504
|
processor.process(pendingTxs, limits, validator),
|
|
503
505
|
);
|
|
504
506
|
|
|
@@ -542,6 +544,7 @@ export class Sequencer {
|
|
|
542
544
|
numTxs: processedTxs.length,
|
|
543
545
|
numFailedTxs: failedTxs.length,
|
|
544
546
|
blockBuildingTimer,
|
|
547
|
+
usedTxs,
|
|
545
548
|
};
|
|
546
549
|
} finally {
|
|
547
550
|
// We create a fresh processor each time to reset any cached state (eg storage writes)
|
|
@@ -613,7 +616,7 @@ export class Sequencer {
|
|
|
613
616
|
|
|
614
617
|
try {
|
|
615
618
|
const buildBlockRes = await this.buildBlock(pendingTxs, newGlobalVariables);
|
|
616
|
-
const { publicGas, block, publicProcessorDuration, numTxs, numMsgs, blockBuildingTimer } = buildBlockRes;
|
|
619
|
+
const { publicGas, block, publicProcessorDuration, numTxs, numMsgs, blockBuildingTimer, usedTxs } = buildBlockRes;
|
|
617
620
|
this.metrics.recordBuiltBlock(workTimer.ms(), publicGas.l2Gas);
|
|
618
621
|
|
|
619
622
|
// TODO(@PhilWindle) We should probably periodically check for things like another
|
|
@@ -645,7 +648,7 @@ export class Sequencer {
|
|
|
645
648
|
|
|
646
649
|
this.log.debug('Collecting attestations');
|
|
647
650
|
const stopCollectingAttestationsTimer = this.metrics.startCollectingAttestationsTimer();
|
|
648
|
-
const attestations = await this.collectAttestations(block,
|
|
651
|
+
const attestations = await this.collectAttestations(block, usedTxs);
|
|
649
652
|
if (attestations !== undefined) {
|
|
650
653
|
this.log.verbose(`Collected ${attestations.length} attestations`, { blockHash, blockNumber });
|
|
651
654
|
}
|
|
@@ -663,7 +666,7 @@ export class Sequencer {
|
|
|
663
666
|
[Attributes.BLOCK_ARCHIVE]: block.archive.toString(),
|
|
664
667
|
[Attributes.BLOCK_TXS_COUNT]: txHashes.length,
|
|
665
668
|
}))
|
|
666
|
-
protected async collectAttestations(block: L2Block,
|
|
669
|
+
protected async collectAttestations(block: L2Block, txs: Tx[]): Promise<Signature[] | undefined> {
|
|
667
670
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/7962): inefficient to have a round trip in here - this should be cached
|
|
668
671
|
const committee = await this.publisher.getCurrentEpochCommittee();
|
|
669
672
|
|
|
@@ -685,12 +688,14 @@ export class Sequencer {
|
|
|
685
688
|
this.setState(SequencerState.COLLECTING_ATTESTATIONS, slotNumber);
|
|
686
689
|
|
|
687
690
|
this.log.debug('Creating block proposal for validators');
|
|
691
|
+
const blockProposalOptions: BlockProposalOptions = { publishFullTxs: !!this.config.publishTxsWithProposals };
|
|
688
692
|
const proposal = await this.validatorClient.createBlockProposal(
|
|
689
693
|
block.header.globalVariables.blockNumber,
|
|
690
694
|
block.header.toPropose(),
|
|
691
695
|
block.archive.root,
|
|
692
696
|
block.header.state,
|
|
693
|
-
|
|
697
|
+
txs,
|
|
698
|
+
blockProposalOptions,
|
|
694
699
|
);
|
|
695
700
|
if (!proposal) {
|
|
696
701
|
const msg = `Failed to create block proposal`;
|
|
@@ -698,7 +703,7 @@ export class Sequencer {
|
|
|
698
703
|
}
|
|
699
704
|
|
|
700
705
|
this.log.debug('Broadcasting block proposal to validators');
|
|
701
|
-
this.validatorClient.broadcastBlockProposal(proposal);
|
|
706
|
+
await this.validatorClient.broadcastBlockProposal(proposal);
|
|
702
707
|
|
|
703
708
|
const attestationTimeAllowed = this.enforceTimeTable
|
|
704
709
|
? this.timetable.getMaxAllowedTime(SequencerState.PUBLISHING_BLOCK)!
|
|
@@ -6,11 +6,7 @@ import { SequencerState } from './utils.js';
|
|
|
6
6
|
const MIN_EXECUTION_TIME = 1;
|
|
7
7
|
const BLOCK_PREPARE_TIME = 1;
|
|
8
8
|
const BLOCK_VALIDATION_TIME = 1;
|
|
9
|
-
|
|
10
|
-
// Loaded from env for testing purposes
|
|
11
|
-
const ATTESTATION_PROPAGATION_TIME = process.env.ATTESTATION_PROPAGATION_TIME
|
|
12
|
-
? parseInt(process.env.ATTESTATION_PROPAGATION_TIME, 10)
|
|
13
|
-
: 2;
|
|
9
|
+
const ATTESTATION_PROPAGATION_TIME = 2;
|
|
14
10
|
|
|
15
11
|
export class SequencerTimetable {
|
|
16
12
|
/**
|
|
@@ -28,16 +24,16 @@ export class SequencerTimetable {
|
|
|
28
24
|
public readonly l1PublishingTime;
|
|
29
25
|
|
|
30
26
|
/** What's the minimum time we want to leave available for execution and reexecution (used to derive init deadline) */
|
|
31
|
-
public readonly minExecutionTime = MIN_EXECUTION_TIME;
|
|
27
|
+
public readonly minExecutionTime: number = MIN_EXECUTION_TIME;
|
|
32
28
|
|
|
33
29
|
/** How long it takes to get ready to start building */
|
|
34
|
-
public readonly blockPrepareTime = BLOCK_PREPARE_TIME;
|
|
30
|
+
public readonly blockPrepareTime: number = BLOCK_PREPARE_TIME;
|
|
35
31
|
|
|
36
32
|
/** How long it takes to for proposals and attestations to travel across the p2p layer (one-way) */
|
|
37
|
-
public readonly attestationPropagationTime = ATTESTATION_PROPAGATION_TIME;
|
|
33
|
+
public readonly attestationPropagationTime: number = ATTESTATION_PROPAGATION_TIME;
|
|
38
34
|
|
|
39
35
|
/** How much time we spend validating and processing a block after building it, and assembling the proposal to send to attestors */
|
|
40
|
-
public readonly blockValidationTime = BLOCK_VALIDATION_TIME;
|
|
36
|
+
public readonly blockValidationTime: number = BLOCK_VALIDATION_TIME;
|
|
41
37
|
|
|
42
38
|
constructor(
|
|
43
39
|
private readonly ethereumSlotDuration: number,
|
|
@@ -49,6 +45,13 @@ export class SequencerTimetable {
|
|
|
49
45
|
) {
|
|
50
46
|
this.l1PublishingTime = this.ethereumSlotDuration - this.maxL1TxInclusionTimeIntoSlot;
|
|
51
47
|
|
|
48
|
+
// Assume zero-cost propagation time and faster runs in test environments where L1 slot duration is shortened
|
|
49
|
+
if (this.ethereumSlotDuration < 8) {
|
|
50
|
+
this.attestationPropagationTime = 0;
|
|
51
|
+
this.blockValidationTime = 0.5;
|
|
52
|
+
this.blockPrepareTime = 0.5;
|
|
53
|
+
}
|
|
54
|
+
|
|
52
55
|
const allWorkToDo =
|
|
53
56
|
this.blockPrepareTime +
|
|
54
57
|
this.minExecutionTime * 2 +
|
|
@@ -154,7 +154,7 @@ export class SlasherClient extends WithTracer {
|
|
|
154
154
|
|
|
155
155
|
public handleBlockStreamEvent(event: L2BlockSourceEvent): Promise<void> {
|
|
156
156
|
this.log.debug(`Handling block stream event ${event.type}`);
|
|
157
|
-
switch (event.type) {
|
|
157
|
+
switch (event.type as L2BlockSourceEvents) {
|
|
158
158
|
case L2BlockSourceEvents.L2PruneDetected:
|
|
159
159
|
this.handlePruneL2Blocks(event);
|
|
160
160
|
break;
|
package/src/test/index.ts
CHANGED
|
@@ -6,15 +6,15 @@ import { Sequencer } from '../sequencer/sequencer.js';
|
|
|
6
6
|
import type { SequencerTimetable } from '../sequencer/timetable.js';
|
|
7
7
|
|
|
8
8
|
class TestSequencer_ extends Sequencer {
|
|
9
|
-
public
|
|
10
|
-
public
|
|
11
|
-
public
|
|
9
|
+
declare public publicProcessorFactory: PublicProcessorFactory;
|
|
10
|
+
declare public timetable: SequencerTimetable;
|
|
11
|
+
declare public publisher: SequencerPublisher;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export type TestSequencer = TestSequencer_;
|
|
15
15
|
|
|
16
16
|
class TestSequencerClient_ extends SequencerClient {
|
|
17
|
-
public
|
|
17
|
+
declare public sequencer: TestSequencer;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type TestSequencerClient = TestSequencerClient_;
|