@aztec/sequencer-client 0.69.0-devnet → 0.69.1-devnet
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/client/sequencer-client.d.ts +2 -0
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +3 -4
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +11 -1
- package/dest/index.d.ts +2 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +3 -2
- package/dest/publisher/config.d.ts +4 -0
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +6 -1
- package/dest/publisher/index.d.ts +0 -1
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/index.js +1 -2
- package/dest/publisher/l1-publisher.d.ts +21 -2
- package/dest/publisher/l1-publisher.d.ts.map +1 -1
- package/dest/publisher/l1-publisher.js +91 -95
- package/dest/sequencer/index.d.ts +1 -0
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +2 -1
- package/dest/sequencer/sequencer.d.ts +21 -30
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +60 -130
- package/dest/sequencer/utils.d.ts +2 -2
- package/dest/sequencer/utils.d.ts.map +1 -1
- package/dest/sequencer/utils.js +3 -3
- package/dest/test/index.d.ts +18 -0
- package/dest/test/index.d.ts.map +1 -0
- package/dest/test/index.js +8 -0
- package/dest/{publisher → test}/test-l1-publisher.d.ts +1 -1
- package/dest/test/test-l1-publisher.d.ts.map +1 -0
- package/dest/test/test-l1-publisher.js +11 -0
- package/dest/tx_validator/archive_cache.d.ts +14 -0
- package/dest/tx_validator/archive_cache.d.ts.map +1 -0
- package/dest/tx_validator/archive_cache.js +22 -0
- package/dest/tx_validator/gas_validator.d.ts +2 -3
- package/dest/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/tx_validator/gas_validator.js +9 -22
- package/dest/tx_validator/nullifier_cache.d.ts +16 -0
- package/dest/tx_validator/nullifier_cache.d.ts.map +1 -0
- package/dest/tx_validator/nullifier_cache.js +24 -0
- package/dest/tx_validator/phases_validator.d.ts +2 -3
- package/dest/tx_validator/phases_validator.d.ts.map +1 -1
- package/dest/tx_validator/phases_validator.js +15 -24
- package/dest/tx_validator/tx_validator_factory.d.ts +15 -14
- package/dest/tx_validator/tx_validator_factory.d.ts.map +1 -1
- package/dest/tx_validator/tx_validator_factory.js +41 -24
- package/package.json +23 -20
- package/src/client/sequencer-client.ts +5 -3
- package/src/config.ts +10 -0
- package/src/index.ts +2 -1
- package/src/publisher/config.ts +10 -0
- package/src/publisher/index.ts +0 -1
- package/src/publisher/l1-publisher.ts +119 -93
- package/src/sequencer/index.ts +1 -0
- package/src/sequencer/sequencer.ts +82 -193
- package/src/sequencer/utils.ts +2 -2
- package/src/test/index.ts +23 -0
- package/src/{publisher → test}/test-l1-publisher.ts +1 -1
- package/src/tx_validator/archive_cache.ts +27 -0
- package/src/tx_validator/gas_validator.ts +11 -24
- package/src/tx_validator/nullifier_cache.ts +29 -0
- package/src/tx_validator/phases_validator.ts +22 -33
- package/src/tx_validator/tx_validator_factory.ts +89 -40
- package/dest/publisher/test-l1-publisher.d.ts.map +0 -1
- package/dest/publisher/test-l1-publisher.js +0 -11
- package/dest/publisher/utils.d.ts +0 -2
- package/dest/publisher/utils.d.ts.map +0 -1
- package/dest/publisher/utils.js +0 -13
- package/src/publisher/utils.ts +0 -14
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { type EpochProofQuote, type L1RollupConstants, type L1ToL2MessageSource, type L2Block, type L2BlockSource, type
|
|
3
|
+
import { type EpochProofQuote, type L1RollupConstants, type L1ToL2MessageSource, type L2Block, type L2BlockSource, type TxHash, type WorldStateSynchronizer } from '@aztec/circuit-types';
|
|
4
4
|
import type { Signature } from '@aztec/circuit-types/interfaces';
|
|
5
|
-
import {
|
|
5
|
+
import { type ContractDataSource } from '@aztec/circuits.js';
|
|
6
6
|
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
7
7
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
8
|
import { type DateProvider } from '@aztec/foundation/timer';
|
|
@@ -14,15 +14,9 @@ import { type ValidatorClient } from '@aztec/validator-client';
|
|
|
14
14
|
import { type GlobalVariableBuilder } from '../global_variable_builder/global_builder.js';
|
|
15
15
|
import { type L1Publisher } from '../publisher/l1-publisher.js';
|
|
16
16
|
import { type SlasherClient } from '../slasher/slasher_client.js';
|
|
17
|
-
import { type TxValidatorFactory } from '../tx_validator/tx_validator_factory.js';
|
|
18
17
|
import { type SequencerConfig } from './config.js';
|
|
19
18
|
import { SequencerState } from './utils.js';
|
|
20
19
|
export { SequencerState };
|
|
21
|
-
export type ShouldProposeArgs = {
|
|
22
|
-
pendingTxsCount?: number;
|
|
23
|
-
validTxsCount?: number;
|
|
24
|
-
processedTxsCount?: number;
|
|
25
|
-
};
|
|
26
20
|
export declare class SequencerTooSlowError extends Error {
|
|
27
21
|
readonly currentState: SequencerState;
|
|
28
22
|
readonly proposedState: SequencerState;
|
|
@@ -41,21 +35,21 @@ type SequencerRollupConstants = Pick<L1RollupConstants, 'ethereumSlotDuration' |
|
|
|
41
35
|
* - Publishes L1 tx(s) to the rollup contract via RollupPublisher.
|
|
42
36
|
*/
|
|
43
37
|
export declare class Sequencer {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
protected publisher: L1Publisher;
|
|
39
|
+
protected validatorClient: ValidatorClient | undefined;
|
|
40
|
+
protected globalsBuilder: GlobalVariableBuilder;
|
|
41
|
+
protected p2pClient: P2P;
|
|
42
|
+
protected worldState: WorldStateSynchronizer;
|
|
43
|
+
protected slasherClient: SlasherClient;
|
|
44
|
+
protected blockBuilderFactory: BlockBuilderFactory;
|
|
45
|
+
protected l2BlockSource: L2BlockSource;
|
|
46
|
+
protected l1ToL2MessageSource: L1ToL2MessageSource;
|
|
47
|
+
protected publicProcessorFactory: PublicProcessorFactory;
|
|
48
|
+
protected contractDataSource: ContractDataSource;
|
|
55
49
|
protected l1Constants: SequencerRollupConstants;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
protected dateProvider: DateProvider;
|
|
51
|
+
protected config: SequencerConfig;
|
|
52
|
+
protected log: import("@aztec/foundation/log").Logger;
|
|
59
53
|
private runningPromise?;
|
|
60
54
|
private pollingIntervalMs;
|
|
61
55
|
private maxTxsPerBlock;
|
|
@@ -66,7 +60,8 @@ export declare class Sequencer {
|
|
|
66
60
|
private state;
|
|
67
61
|
private allowedInSetup;
|
|
68
62
|
private maxBlockSizeInBytes;
|
|
69
|
-
private
|
|
63
|
+
private maxBlockGas;
|
|
64
|
+
protected processTxTime: number;
|
|
70
65
|
private metrics;
|
|
71
66
|
private isFlushing;
|
|
72
67
|
/**
|
|
@@ -76,7 +71,7 @@ export declare class Sequencer {
|
|
|
76
71
|
protected timeTable: Record<SequencerState, number>;
|
|
77
72
|
protected enforceTimeTable: boolean;
|
|
78
73
|
constructor(publisher: L1Publisher, validatorClient: ValidatorClient | undefined, // During migration the validator client can be inactive
|
|
79
|
-
globalsBuilder: GlobalVariableBuilder, p2pClient: P2P, worldState: WorldStateSynchronizer, slasherClient: SlasherClient, blockBuilderFactory: BlockBuilderFactory, l2BlockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, publicProcessorFactory: PublicProcessorFactory,
|
|
74
|
+
globalsBuilder: GlobalVariableBuilder, p2pClient: P2P, worldState: WorldStateSynchronizer, slasherClient: SlasherClient, blockBuilderFactory: BlockBuilderFactory, l2BlockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, publicProcessorFactory: PublicProcessorFactory, contractDataSource: ContractDataSource, l1Constants: SequencerRollupConstants, dateProvider: DateProvider, telemetry: TelemetryClient, config?: SequencerConfig, log?: import("@aztec/foundation/log").Logger);
|
|
80
75
|
get tracer(): Tracer;
|
|
81
76
|
/**
|
|
82
77
|
* Updates sequencer config.
|
|
@@ -125,16 +120,14 @@ export declare class Sequencer {
|
|
|
125
120
|
* it is only used to check if we have enough time left in the slot to transition to the new state.
|
|
126
121
|
*/
|
|
127
122
|
setState(proposedState: SequencerState, currentSlotNumber: bigint, force?: boolean): void;
|
|
128
|
-
shouldProposeBlock(historicalHeader: BlockHeader | undefined, args: ShouldProposeArgs): boolean;
|
|
129
123
|
/**
|
|
130
124
|
* Build a block
|
|
131
125
|
*
|
|
132
126
|
* Shared between the sequencer and the validator for re-execution
|
|
133
127
|
*
|
|
134
|
-
* @param
|
|
128
|
+
* @param pendingTxs - The pending transactions to construct the block from
|
|
135
129
|
* @param newGlobalVariables - The global variables for the new block
|
|
136
130
|
* @param historicalHeader - The historical header of the parent
|
|
137
|
-
* @param interrupt - The interrupt callback, used to validate the block for submission and check if we should propose the block
|
|
138
131
|
* @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal
|
|
139
132
|
*/
|
|
140
133
|
private buildBlock;
|
|
@@ -144,7 +137,7 @@ export declare class Sequencer {
|
|
|
144
137
|
* @dev MUST throw instead of exiting early to ensure that world-state
|
|
145
138
|
* is being rolled back if the block is dropped.
|
|
146
139
|
*
|
|
147
|
-
* @param
|
|
140
|
+
* @param pendingTxs - Iterable of pending transactions to construct the block from
|
|
148
141
|
* @param proposalHeader - The partial header constructed for the proposal
|
|
149
142
|
* @param historicalHeader - The historical header of the parent
|
|
150
143
|
*/
|
|
@@ -158,8 +151,6 @@ export declare class Sequencer {
|
|
|
158
151
|
* @param block - The L2Block to be published.
|
|
159
152
|
*/
|
|
160
153
|
protected publishL2Block(block: L2Block, attestations?: Signature[], txHashes?: TxHash[], proofQuote?: EpochProofQuote): Promise<void>;
|
|
161
|
-
protected takeValidTxs<T extends Tx | ProcessedTx>(txs: T[], validator: TxValidator<T>): Promise<T[]>;
|
|
162
|
-
protected takeTxsWithinMaxSize(txs: Tx[]): Tx[];
|
|
163
154
|
protected claimEpochProofRightIfAvailable(slotNumber: bigint): Promise<bigint | undefined>;
|
|
164
155
|
/**
|
|
165
156
|
* Returns whether all dependencies have caught up.
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAGlB,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAkB,SAAS,EAAgC,MAAM,iCAAiC,CAAC;AAE/G,OAAO,EAIL,KAAK,kBAAkB,EAKxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,MAAM,EAAa,MAAM,yBAAyB,CAAC;AACnG,O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