@aztec/sequencer-client 0.73.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2

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.
Files changed (88) hide show
  1. package/dest/client/index.js +0 -1
  2. package/dest/client/sequencer-client.js +55 -55
  3. package/dest/config.js +40 -42
  4. package/dest/global_variable_builder/global_builder.js +39 -26
  5. package/dest/global_variable_builder/index.js +0 -1
  6. package/dest/index.js +0 -1
  7. package/dest/publisher/config.js +49 -50
  8. package/dest/publisher/index.js +0 -1
  9. package/dest/publisher/sequencer-publisher-metrics.js +32 -23
  10. package/dest/publisher/sequencer-publisher.js +251 -253
  11. package/dest/sequencer/allowed.js +5 -12
  12. package/dest/sequencer/config.js +1 -2
  13. package/dest/sequencer/index.js +0 -1
  14. package/dest/sequencer/metrics.js +26 -18
  15. package/dest/sequencer/sequencer.js +648 -607
  16. package/dest/sequencer/timetable.js +33 -19
  17. package/dest/sequencer/utils.js +22 -32
  18. package/dest/slasher/factory.js +6 -5
  19. package/dest/slasher/index.js +0 -1
  20. package/dest/slasher/slasher_client.js +128 -122
  21. package/dest/test/index.js +4 -1
  22. package/dest/tx_validator/archive_cache.js +7 -7
  23. package/dest/tx_validator/gas_validator.js +76 -64
  24. package/dest/tx_validator/nullifier_cache.js +8 -8
  25. package/dest/tx_validator/phases_validator.js +27 -19
  26. package/dest/tx_validator/test_utils.js +1 -2
  27. package/dest/tx_validator/tx_validator_factory.js +5 -5
  28. package/package.json +23 -22
  29. package/src/client/sequencer-client.ts +23 -2
  30. package/src/config.ts +1 -1
  31. package/src/publisher/sequencer-publisher.ts +71 -91
  32. package/src/sequencer/sequencer.ts +29 -13
  33. package/src/slasher/factory.ts +3 -3
  34. package/src/slasher/slasher_client.ts +40 -31
  35. package/dest/client/index.d.ts +0 -2
  36. package/dest/client/index.d.ts.map +0 -1
  37. package/dest/client/sequencer-client.d.ts +0 -68
  38. package/dest/client/sequencer-client.d.ts.map +0 -1
  39. package/dest/config.d.ts +0 -37
  40. package/dest/config.d.ts.map +0 -1
  41. package/dest/global_variable_builder/global_builder.d.ts +0 -29
  42. package/dest/global_variable_builder/global_builder.d.ts.map +0 -1
  43. package/dest/global_variable_builder/index.d.ts +0 -2
  44. package/dest/global_variable_builder/index.d.ts.map +0 -1
  45. package/dest/index.d.ts +0 -8
  46. package/dest/index.d.ts.map +0 -1
  47. package/dest/publisher/config.d.ts +0 -38
  48. package/dest/publisher/config.d.ts.map +0 -1
  49. package/dest/publisher/index.d.ts +0 -2
  50. package/dest/publisher/index.d.ts.map +0 -1
  51. package/dest/publisher/sequencer-publisher-metrics.d.ts +0 -24
  52. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +0 -1
  53. package/dest/publisher/sequencer-publisher.d.ts +0 -158
  54. package/dest/publisher/sequencer-publisher.d.ts.map +0 -1
  55. package/dest/sequencer/allowed.d.ts +0 -3
  56. package/dest/sequencer/allowed.d.ts.map +0 -1
  57. package/dest/sequencer/config.d.ts +0 -2
  58. package/dest/sequencer/config.d.ts.map +0 -1
  59. package/dest/sequencer/index.d.ts +0 -4
  60. package/dest/sequencer/index.d.ts.map +0 -1
  61. package/dest/sequencer/metrics.d.ts +0 -24
  62. package/dest/sequencer/metrics.d.ts.map +0 -1
  63. package/dest/sequencer/sequencer.d.ts +0 -172
  64. package/dest/sequencer/sequencer.d.ts.map +0 -1
  65. package/dest/sequencer/timetable.d.ts +0 -38
  66. package/dest/sequencer/timetable.d.ts.map +0 -1
  67. package/dest/sequencer/utils.d.ts +0 -47
  68. package/dest/sequencer/utils.d.ts.map +0 -1
  69. package/dest/slasher/factory.d.ts +0 -11
  70. package/dest/slasher/factory.d.ts.map +0 -1
  71. package/dest/slasher/index.d.ts +0 -3
  72. package/dest/slasher/index.d.ts.map +0 -1
  73. package/dest/slasher/slasher_client.d.ts +0 -127
  74. package/dest/slasher/slasher_client.d.ts.map +0 -1
  75. package/dest/test/index.d.ts +0 -17
  76. package/dest/test/index.d.ts.map +0 -1
  77. package/dest/tx_validator/archive_cache.d.ts +0 -14
  78. package/dest/tx_validator/archive_cache.d.ts.map +0 -1
  79. package/dest/tx_validator/gas_validator.d.ts +0 -12
  80. package/dest/tx_validator/gas_validator.d.ts.map +0 -1
  81. package/dest/tx_validator/nullifier_cache.d.ts +0 -16
  82. package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
  83. package/dest/tx_validator/phases_validator.d.ts +0 -11
  84. package/dest/tx_validator/phases_validator.d.ts.map +0 -1
  85. package/dest/tx_validator/test_utils.d.ts +0 -21
  86. package/dest/tx_validator/test_utils.d.ts.map +0 -1
  87. package/dest/tx_validator/tx_validator_factory.d.ts +0 -16
  88. package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
@@ -1,158 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
4
- import { type EpochProofQuote, type L2Block, type TxHash } from '@aztec/circuit-types';
5
- import { type BlockHeader, EthAddress } from '@aztec/circuits.js';
6
- import { type EpochCache } from '@aztec/epoch-cache';
7
- import { type ForwarderContract, type GasPrice, type L1BlobInputs, type L1ContractsConfig, type L1GasConfig, type L1TxRequest, type L1TxUtilsWithBlobs, type RollupContract, type TransactionStats } from '@aztec/ethereum';
8
- import { Blob } from '@aztec/foundation/blob';
9
- import { type Signature } from '@aztec/foundation/eth-signature';
10
- import { type Logger } from '@aztec/foundation/log';
11
- import { type TelemetryClient } from '@aztec/telemetry-client';
12
- import { type TransactionReceipt } from 'viem';
13
- import { type PublisherConfig, type TxSenderConfig } from './config.js';
14
- export declare enum VoteType {
15
- GOVERNANCE = 0,
16
- SLASHING = 1
17
- }
18
- type GetSlashPayloadCallBack = (slotNumber: bigint) => Promise<EthAddress | undefined>;
19
- type Action = 'propose' | 'claim' | 'governance-vote' | 'slashing-vote';
20
- interface RequestWithExpiry {
21
- action: Action;
22
- request: L1TxRequest;
23
- lastValidL2Slot: bigint;
24
- gasConfig?: L1GasConfig;
25
- blobConfig?: L1BlobInputs;
26
- onResult?: (request: L1TxRequest, result?: {
27
- receipt: TransactionReceipt;
28
- gasPrice: GasPrice;
29
- stats?: TransactionStats;
30
- errorMsg?: string;
31
- }) => void;
32
- }
33
- export declare class SequencerPublisher {
34
- private interrupted;
35
- private metrics;
36
- private epochCache;
37
- private forwarderContract;
38
- protected governanceLog: Logger;
39
- protected governanceProposerAddress?: EthAddress;
40
- private governancePayload;
41
- protected slashingLog: Logger;
42
- protected slashingProposerAddress?: EthAddress;
43
- private getSlashPayload?;
44
- private myLastVotes;
45
- protected log: Logger;
46
- protected ethereumSlotDuration: bigint;
47
- private blobSinkClient;
48
- static PROPOSE_GAS_GUESS: bigint;
49
- static PROPOSE_AND_CLAIM_GAS_GUESS: bigint;
50
- l1TxUtils: L1TxUtilsWithBlobs;
51
- rollupContract: RollupContract;
52
- protected requests: RequestWithExpiry[];
53
- constructor(config: TxSenderConfig & PublisherConfig & Pick<L1ContractsConfig, 'ethereumSlotDuration'>, deps: {
54
- telemetry?: TelemetryClient;
55
- blobSinkClient?: BlobSinkClientInterface;
56
- forwarderContract: ForwarderContract;
57
- l1TxUtils: L1TxUtilsWithBlobs;
58
- rollupContract: RollupContract;
59
- epochCache: EpochCache;
60
- });
61
- registerSlashPayloadGetter(callback: GetSlashPayloadCallBack): void;
62
- getForwarderAddress(): EthAddress;
63
- getSenderAddress(): EthAddress;
64
- getGovernancePayload(): EthAddress;
65
- setGovernancePayload(payload: EthAddress): void;
66
- addRequest(request: RequestWithExpiry): void;
67
- getCurrentL2Slot(): bigint;
68
- /**
69
- * Sends all requests that are still valid.
70
- * @returns one of:
71
- * - A receipt and stats if the tx succeeded
72
- * - a receipt and errorMsg if it failed on L1
73
- * - undefined if no valid requests are found OR the tx failed to send.
74
- */
75
- sendRequests(): Promise<{
76
- receipt: TransactionReceipt<bigint, number, "success" | "reverted", import("viem").TransactionType>;
77
- gasPrice: GasPrice;
78
- stats: TransactionStats | undefined;
79
- errorMsg?: undefined;
80
- } | {
81
- receipt: TransactionReceipt<bigint, number, "success" | "reverted", import("viem").TransactionType>;
82
- gasPrice: GasPrice;
83
- errorMsg: string | undefined;
84
- stats?: undefined;
85
- } | undefined>;
86
- private callbackBundledTransactions;
87
- /**
88
- * @notice Will call `canProposeAtNextEthBlock` to make sure that it is possible to propose
89
- * @param tipArchive - The archive to check
90
- * @returns The slot and block number if it is possible to propose, undefined otherwise
91
- */
92
- canProposeAtNextEthBlock(tipArchive: Buffer): Promise<[bigint, bigint] | undefined>;
93
- /**
94
- * @returns The epoch that is currently claimable, undefined otherwise
95
- */
96
- getClaimableEpoch(): Promise<bigint | undefined>;
97
- /**
98
- * @notice Will filter out invalid quotes according to L1
99
- * @param quotes - The quotes to filter
100
- * @returns The filtered quotes
101
- */
102
- filterValidQuotes(quotes: EpochProofQuote[]): Promise<EpochProofQuote[]>;
103
- /**
104
- * @notice Will call `validateHeader` to make sure that it is possible to propose
105
- *
106
- * @dev Throws if unable to propose
107
- *
108
- * @param header - The header to propose
109
- * @param digest - The digest that attestations are signing over
110
- *
111
- */
112
- validateBlockForSubmission(header: BlockHeader, attestationData?: {
113
- digest: Buffer;
114
- signatures: Signature[];
115
- }): Promise<bigint>;
116
- getCurrentEpochCommittee(): Promise<EthAddress[]>;
117
- /**
118
- * Enqueues a castVote transaction to cast a vote for a given slot number.
119
- * @param slotNumber - The slot number to cast a vote for.
120
- * @param timestamp - The timestamp of the slot to cast a vote for.
121
- * @param voteType - The type of vote to cast.
122
- * @returns True if the vote was successfully enqueued, false otherwise.
123
- */
124
- enqueueCastVote(slotNumber: bigint, timestamp: bigint, voteType: VoteType): Promise<boolean>;
125
- /**
126
- * Proposes a L2 block on L1.
127
- *
128
- * @param block - L2 block to propose.
129
- * @returns True if the tx has been enqueued, throws otherwise. See #9315
130
- */
131
- enqueueProposeL2Block(block: L2Block, attestations?: Signature[], txHashes?: TxHash[], opts?: {
132
- txTimeoutAt?: Date;
133
- }): Promise<boolean>;
134
- /** Enqueues a claimEpochProofRight transaction to submit a chosen prover quote for the previous epoch. */
135
- enqueueClaimEpochProofRight(proofQuote: EpochProofQuote): boolean;
136
- /**
137
- * Calling `interrupt` will cause any in progress call to `publishRollup` to return `false` asap.
138
- * Be warned, the call may return false even if the tx subsequently gets successfully mined.
139
- * In practice this shouldn't matter, as we'll only ever be calling `interrupt` when we know it's going to fail.
140
- * A call to `restart` is required before you can continue publishing.
141
- */
142
- interrupt(): void;
143
- /** Restarts the publisher after calling `interrupt`. */
144
- restart(): void;
145
- private prepareProposeTx;
146
- private addProposeTx;
147
- /**
148
- * Send blobs to the blob sink
149
- *
150
- * If a blob sink url is configured, then we send blobs to the blob sink
151
- * - for now we use the blockHash as the identifier for the blobs;
152
- * In the future this will move to be the beacon block id - which takes a bit more work
153
- * to calculate and will need to be mocked in e2e tests
154
- */
155
- protected sendBlobsToBlobSink(blockHash: string, blobs: Blob[]): Promise<boolean>;
156
- }
157
- export {};
158
- //# sourceMappingURL=sequencer-publisher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,OAAO,EAEZ,KAAK,MAAM,EAEZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc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B;;;;OAIG;IACI,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAgB/E;;;;;;;;OAQG;IACU,0BAA0B,CACrC,MAAM,EAAE,WAAW,EACnB,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;IAK9D;;;;;;OAMG;IACU,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAqGzG;;;;;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;IA8BnB,0GAA0G;IACnG,2BAA2B,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO;IA6CxE;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;YAKA,gBAAgB;YAoGhB,YAAY;IAqE1B;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlF"}
@@ -1,3 +0,0 @@
1
- import { type AllowedElement } from '@aztec/circuit-types';
2
- export declare function getDefaultAllowedSetupFunctions(): Promise<AllowedElement[]>;
3
- //# sourceMappingURL=allowed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"allowed.d.ts","sourceRoot":"","sources":["../../src/sequencer/allowed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQ3D,wBAAsB,+BAA+B,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CA2BjF"}
@@ -1,2 +0,0 @@
1
- export { type SequencerConfig } from '@aztec/circuit-types/config';
2
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/sequencer/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './config.js';
2
- export * from './sequencer.js';
3
- export * from './allowed.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sequencer/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -1,24 +0,0 @@
1
- import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
2
- import { type SequencerState, type SequencerStateCallback } from './utils.js';
3
- export declare class SequencerMetrics {
4
- readonly tracer: Tracer;
5
- private blockCounter;
6
- private blockBuildDuration;
7
- private blockBuildManaPerSecond;
8
- private stateTransitionBufferDuration;
9
- private currentBlockNumber;
10
- private currentBlockSize;
11
- private blockBuilderInsertions;
12
- private timeToCollectAttestations;
13
- constructor(client: TelemetryClient, getState: SequencerStateCallback, name?: string);
14
- startCollectingAttestationsTimer(): () => void;
15
- recordTimeToCollectAttestations(time: number): void;
16
- recordBlockBuilderTreeInsertions(timeUs: number): void;
17
- recordCancelledBlock(): void;
18
- recordBuiltBlock(buildDurationMs: number, totalMana: number): void;
19
- recordFailedBlock(): void;
20
- recordNewBlock(blockNumber: number, txCount: number): void;
21
- recordStateTransitionBufferMs(durationMs: number, state: SequencerState): void;
22
- private setCurrentBlock;
23
- }
24
- //# sourceMappingURL=metrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/sequencer/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAA0B,MAAM,YAAY,CAAC;AAEtG,qBAAa,gBAAgB;IAC3B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,kBAAkB,CAAY;IACtC,OAAO,CAAC,uBAAuB,CAAQ;IACvC,OAAO,CAAC,6BAA6B,CAAY;IACjD,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,sBAAsB,CAAY;IAE1C,OAAO,CAAC,yBAAyB,CAAQ;gBAE7B,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,sBAAsB,EAAE,IAAI,SAAc;IAyDzF,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,OAAO,CAAC,eAAe;CAIxB"}
@@ -1,172 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import { type EpochProofQuote, type L1RollupConstants, type L1ToL2MessageSource, type L2Block, type L2BlockSource, Tx, type TxHash, type WorldStateSynchronizer } from '@aztec/circuit-types';
4
- import type { Signature } from '@aztec/circuit-types/interfaces';
5
- import { type ContractDataSource, Gas, type GlobalVariables } from '@aztec/circuits.js';
6
- import { AztecAddress } from '@aztec/foundation/aztec-address';
7
- import { EthAddress } from '@aztec/foundation/eth-address';
8
- import { type DateProvider, Timer } from '@aztec/foundation/timer';
9
- import { type P2P } from '@aztec/p2p';
10
- import { type BlockBuilderFactory } from '@aztec/prover-client/block-builder';
11
- import { type PublicProcessorFactory } from '@aztec/simulator/server';
12
- import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
13
- import { type ValidatorClient } from '@aztec/validator-client';
14
- import { type GlobalVariableBuilder } from '../global_variable_builder/global_builder.js';
15
- import { type SequencerPublisher } from '../publisher/sequencer-publisher.js';
16
- import { type SlasherClient } from '../slasher/slasher_client.js';
17
- import { type SequencerConfig } from './config.js';
18
- import { SequencerTimetable } from './timetable.js';
19
- import { SequencerState } from './utils.js';
20
- export { SequencerState };
21
- type SequencerRollupConstants = Pick<L1RollupConstants, 'ethereumSlotDuration' | 'l1GenesisTime' | 'slotDuration'>;
22
- /**
23
- * Sequencer client
24
- * - Wins a period of time to become the sequencer (depending on finalized protocol).
25
- * - Chooses a set of txs from the tx pool to be in the rollup.
26
- * - Simulate the rollup of txs.
27
- * - Adds proof requests to the request pool (not for this milestone).
28
- * - Receives results to those proofs from the network (repeats as necessary) (not for this milestone).
29
- * - Publishes L1 tx(s) to the rollup contract via RollupPublisher.
30
- */
31
- export declare class Sequencer {
32
- protected publisher: SequencerPublisher;
33
- protected validatorClient: ValidatorClient | undefined;
34
- protected globalsBuilder: GlobalVariableBuilder;
35
- protected p2pClient: P2P;
36
- protected worldState: WorldStateSynchronizer;
37
- protected slasherClient: SlasherClient;
38
- protected blockBuilderFactory: BlockBuilderFactory;
39
- protected l2BlockSource: L2BlockSource;
40
- protected l1ToL2MessageSource: L1ToL2MessageSource;
41
- protected publicProcessorFactory: PublicProcessorFactory;
42
- protected contractDataSource: ContractDataSource;
43
- protected l1Constants: SequencerRollupConstants;
44
- protected dateProvider: DateProvider;
45
- protected config: SequencerConfig;
46
- protected log: import("@aztec/foundation/log").Logger;
47
- private runningPromise?;
48
- private pollingIntervalMs;
49
- private maxTxsPerBlock;
50
- private minTxsPerBlock;
51
- private maxL1TxInclusionTimeIntoSlot;
52
- private _coinbase;
53
- private _feeRecipient;
54
- private state;
55
- private allowedInSetup;
56
- private maxBlockSizeInBytes;
57
- private maxBlockGas;
58
- private metrics;
59
- private isFlushing;
60
- /** The maximum number of seconds that the sequencer can be into a slot to transition to a particular state. */
61
- protected timetable: SequencerTimetable;
62
- protected enforceTimeTable: boolean;
63
- constructor(publisher: SequencerPublisher, validatorClient: ValidatorClient | undefined, // During migration the validator client can be inactive
64
- globalsBuilder: GlobalVariableBuilder, p2pClient: P2P, worldState: WorldStateSynchronizer, slasherClient: SlasherClient, blockBuilderFactory: BlockBuilderFactory, l2BlockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, publicProcessorFactory: PublicProcessorFactory, contractDataSource: ContractDataSource, l1Constants: SequencerRollupConstants, dateProvider: DateProvider, config?: SequencerConfig, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
65
- get tracer(): Tracer;
66
- /**
67
- * Updates sequencer config.
68
- * @param config - New parameters.
69
- */
70
- updateConfig(config: SequencerConfig): Promise<void>;
71
- private setTimeTable;
72
- /**
73
- * Starts the sequencer and moves to IDLE state.
74
- */
75
- start(): Promise<void>;
76
- /**
77
- * Stops the sequencer from processing txs and moves to STOPPED state.
78
- */
79
- stop(): Promise<void>;
80
- /**
81
- * Starts a previously stopped sequencer.
82
- */
83
- restart(): void;
84
- /**
85
- * Returns the current state of the sequencer.
86
- * @returns An object with a state entry with one of SequencerState.
87
- */
88
- status(): {
89
- state: SequencerState;
90
- };
91
- /** Forces the sequencer to bypass all time and tx count checks for the next block and build anyway. */
92
- flush(): void;
93
- /**
94
- * @notice Performs most of the sequencer duties:
95
- * - Checks if we are up to date
96
- * - If we are and we are the sequencer, collect txs and build a block
97
- * - Collect attestations for the block
98
- * - Submit block
99
- * - If our block for some reason is not included, revert the state
100
- */
101
- protected doRealWork(): Promise<void>;
102
- protected work(): Promise<void>;
103
- getForwarderAddress(): EthAddress;
104
- /**
105
- * Checks if we can propose at the next block and returns the slot number if we can.
106
- * @param tipArchive - The archive of the previous block.
107
- * @param proposalBlockNumber - The block number of the proposal.
108
- * @returns The slot number if we can propose at the next block, otherwise undefined.
109
- */
110
- slotForProposal(tipArchive: Buffer, proposalBlockNumber: bigint): Promise<bigint | undefined>;
111
- /**
112
- * Sets the sequencer state and checks if we have enough time left in the slot to transition to the new state.
113
- * @param proposedState - The new state to transition to.
114
- * @param currentSlotNumber - The current slot number.
115
- * @param force - Whether to force the transition even if the sequencer is stopped.
116
- *
117
- * @dev If the `currentSlotNumber` doesn't matter (e.g. transitioning to IDLE), pass in `0n`;
118
- * it is only used to check if we have enough time left in the slot to transition to the new state.
119
- */
120
- setState(proposedState: SequencerState, currentSlotNumber: bigint, force?: boolean): void;
121
- /**
122
- * Build a block
123
- *
124
- * Shared between the sequencer and the validator for re-execution
125
- *
126
- * @param pendingTxs - The pending transactions to construct the block from
127
- * @param newGlobalVariables - The global variables for the new block
128
- * @param historicalHeader - The historical header of the parent
129
- * @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal
130
- */
131
- protected buildBlock(pendingTxs: Iterable<Tx> | AsyncIterable<Tx>, newGlobalVariables: GlobalVariables, opts?: {
132
- validateOnly?: boolean;
133
- }): Promise<{
134
- block: L2Block;
135
- publicGas: Gas;
136
- publicProcessorDuration: number;
137
- numMsgs: number;
138
- numTxs: number;
139
- numFailedTxs: number;
140
- blockBuildingTimer: Timer;
141
- }>;
142
- /**
143
- * @notice Build and propose a block to the chain
144
- *
145
- * @dev MUST throw instead of exiting early to ensure that world-state
146
- * is being rolled back if the block is dropped.
147
- *
148
- * @param pendingTxs - Iterable of pending transactions to construct the block from
149
- * @param proposalHeader - The partial header constructed for the proposal
150
- */
151
- private buildBlockAndEnqueuePublish;
152
- protected collectAttestations(block: L2Block, txHashes: TxHash[]): Promise<Signature[] | undefined>;
153
- protected createProofClaimForPreviousEpoch(slotNumber: bigint): Promise<EpochProofQuote | undefined>;
154
- /**
155
- * Publishes the L2Block to the rollup contract.
156
- * @param block - The L2Block to be published.
157
- */
158
- protected enqueuePublishL2Block(block: L2Block, attestations?: Signature[], txHashes?: TxHash[]): Promise<void>;
159
- protected claimEpochProofRightIfAvailable(slotNumber: bigint): Promise<bigint | undefined>;
160
- /**
161
- * Returns whether all dependencies have caught up.
162
- * We don't check against the previous block submitted since it may have been reorg'd out.
163
- * @returns Boolean indicating if our dependencies are synced to the latest block.
164
- */
165
- protected isBlockSynced(): Promise<boolean>;
166
- private getSlotStartTimestamp;
167
- private getSecondsIntoSlot;
168
- get aztecSlotDuration(): number;
169
- get coinbase(): EthAddress;
170
- get feeRecipient(): AztecAddress;
171
- }
172
- //# sourceMappingURL=sequencer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,aAAa,EAElB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAkB,SAAS,EAAgC,MAAM,iCAAiC,CAAC;AAE/G,OAAO,EAIL,KAAK,kBAAkB,EAEvB,GAAG,EACH,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAW,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAA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
@@ -1,38 +0,0 @@
1
- import { type SequencerMetrics } from './metrics.js';
2
- import { SequencerState } from './utils.js';
3
- export declare class SequencerTimetable {
4
- private readonly ethereumSlotDuration;
5
- private readonly aztecSlotDuration;
6
- private readonly maxL1TxInclusionTimeIntoSlot;
7
- private readonly enforce;
8
- private readonly metrics?;
9
- private readonly log;
10
- /** How late into the slot can we be to start working */
11
- readonly initialTime = 3;
12
- /** How long it takes to get ready to start building */
13
- readonly blockPrepareTime = 1;
14
- /** How long it takes to for proposals and attestations to travel across the p2p layer (one-way) */
15
- readonly attestationPropagationTime = 2;
16
- /** How much time we spend validating and processing a block after building it, and assembling the proposal to send to attestors */
17
- readonly blockValidationTime = 1;
18
- /**
19
- * How long it takes to get a published block into L1. L1 builders typically accept txs up to 4 seconds into their slot,
20
- * but we'll timeout sooner to give it more time to propagate (remember we also have blobs!). Still, when working in anvil,
21
- * we can just post in the very last second of the L1 slot and still expect the tx to be accepted.
22
- */
23
- readonly l1PublishingTime: number;
24
- constructor(ethereumSlotDuration: number, aztecSlotDuration: number, maxL1TxInclusionTimeIntoSlot: number, enforce?: boolean, metrics?: SequencerMetrics | undefined, log?: import("@aztec/aztec.js").Logger);
25
- private get afterBlockBuildingTimeNeededWithoutReexec();
26
- getBlockProposalExecTimeEnd(secondsIntoSlot: number): number;
27
- private get afterBlockReexecTimeNeeded();
28
- getValidatorReexecTimeEnd(secondsIntoSlot: number): number;
29
- getMaxAllowedTime(state: SequencerState): number | undefined;
30
- assertTimeLeft(newState: SequencerState, secondsIntoSlot: number): void;
31
- }
32
- export declare class SequencerTooSlowError extends Error {
33
- readonly proposedState: SequencerState;
34
- readonly maxAllowedTime: number;
35
- readonly currentTime: number;
36
- constructor(proposedState: SequencerState, maxAllowedTime: number, currentTime: number);
37
- }
38
- //# sourceMappingURL=timetable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"AAEA,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1,47 +0,0 @@
1
- import type { BlockAttestation, EthAddress } from '@aztec/circuit-types';
2
- import { Signature } from '@aztec/foundation/eth-signature';
3
- export declare enum SequencerState {
4
- /**
5
- * Sequencer is stopped and not processing any txs from the pool.
6
- */
7
- STOPPED = "STOPPED",
8
- /**
9
- * Sequencer is awaiting the next call to work().
10
- */
11
- IDLE = "IDLE",
12
- /**
13
- * Synchronizing with the L2 chain.
14
- */
15
- SYNCHRONIZING = "SYNCHRONIZING",
16
- /**
17
- * Checking if we are the proposer for the current slot.
18
- */
19
- PROPOSER_CHECK = "PROPOSER_CHECK",
20
- /**
21
- * Initializing the block proposal. Will move to CREATING_BLOCK if there are valid txs to include, or back to SYNCHRONIZING otherwise.
22
- */
23
- INITIALIZING_PROPOSAL = "INITIALIZING_PROPOSAL",
24
- /**
25
- * Creating a new L2 block. Includes processing public function calls and running rollup circuits. Will move to PUBLISHING_CONTRACT_DATA.
26
- */
27
- CREATING_BLOCK = "CREATING_BLOCK",
28
- /**
29
- * Collecting attestations from its peers. Will move to PUBLISHING_BLOCK.
30
- */
31
- COLLECTING_ATTESTATIONS = "COLLECTING_ATTESTATIONS",
32
- /**
33
- * Sending the tx to L1 with the L2 block data and awaiting it to be mined. Will move to SYNCHRONIZING.
34
- */
35
- PUBLISHING_BLOCK = "PUBLISHING_BLOCK"
36
- }
37
- export type SequencerStateCallback = () => SequencerState;
38
- export declare function sequencerStateToNumber(state: SequencerState): number;
39
- /** Order Attestations
40
- *
41
- * Returns attestation signatures in the order of a series of provided ethereum addresses
42
- * The rollup smart contract expects attestations to appear in the order of the committee
43
- *
44
- * @todo: perform this logic within the memory attestation store instead?
45
- */
46
- export declare function orderAttestations(attestations: BlockAttestation[], orderAddresses: EthAddress[]): Promise<Signature[]>;
47
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/sequencer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,oBAAY,cAAc;IACxB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,aAAa,kBAAkB;IAC/B;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,qBAAqB,0BAA0B;IAC/C;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,uBAAuB,4BAA4B;IACnD;;OAEG;IACH,gBAAgB,qBAAqB;CACtC;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,cAAc,CAAC;AAE1D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEpE;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,gBAAgB,EAAE,EAChC,cAAc,EAAE,UAAU,EAAE,GAC3B,OAAO,CAAC,SAAS,EAAE,CAAC,CAkBtB"}
@@ -1,11 +0,0 @@
1
- import type { L2BlockSource } from '@aztec/circuit-types';
2
- import { type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum';
3
- import { type AztecKVStore } from '@aztec/kv-store';
4
- import { type DataStoreConfig } from '@aztec/kv-store/config';
5
- import { type TelemetryClient } from '@aztec/telemetry-client';
6
- import { SlasherClient } from './slasher_client.js';
7
- import { type SlasherConfig } from './slasher_client.js';
8
- export declare const createSlasherClient: (_config: SlasherConfig & DataStoreConfig & L1ContractsConfig & L1ReaderConfig, l2BlockSource: L2BlockSource, telemetry?: TelemetryClient, deps?: {
9
- store?: AztecKVStore;
10
- }) => Promise<SlasherClient>;
11
- //# sourceMappingURL=factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/slasher/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,mBAAmB,YACrB,aAAa,GAAG,eAAe,GAAG,iBAAiB,GAAG,cAAc,iBAC9D,aAAa,cACjB,eAAe,SACpB;IAAE,KAAK,CAAC,EAAE,YAAY,CAAA;CAAE,2BAK/B,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './slasher_client.js';
2
- export { createSlasherClient } from './factory.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slasher/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}