@aztec/sequencer-client 0.69.0 → 0.69.1
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 +3 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +4 -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/l1-publisher.d.ts +36 -11
- package/dest/publisher/l1-publisher.d.ts.map +1 -1
- package/dest/publisher/l1-publisher.js +154 -88
- 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 +9 -16
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +61 -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/slasher/factory.d.ts +11 -0
- package/dest/slasher/factory.d.ts.map +1 -0
- package/dest/slasher/factory.js +10 -0
- package/dest/slasher/index.d.ts +3 -0
- package/dest/slasher/index.d.ts.map +1 -0
- package/dest/slasher/index.js +3 -0
- package/dest/slasher/slasher_client.d.ts +127 -0
- package/dest/slasher/slasher_client.d.ts.map +1 -0
- package/dest/slasher/slasher_client.js +305 -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 +38 -24
- package/package.json +21 -19
- package/src/client/sequencer-client.ts +5 -2
- package/src/config.ts +10 -0
- package/src/index.ts +3 -1
- package/src/publisher/config.ts +10 -0
- package/src/publisher/l1-publisher.ts +180 -97
- package/src/sequencer/index.ts +1 -0
- package/src/sequencer/sequencer.ts +70 -180
- package/src/sequencer/utils.ts +2 -2
- package/src/slasher/factory.ts +22 -0
- package/src/slasher/index.ts +2 -0
- package/src/slasher/slasher_client.ts +402 -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 +82 -40
|
@@ -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';
|
|
@@ -13,15 +13,10 @@ import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
|
13
13
|
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
|
-
import { type
|
|
16
|
+
import { type SlasherClient } from '../slasher/slasher_client.js';
|
|
17
17
|
import { type SequencerConfig } from './config.js';
|
|
18
18
|
import { SequencerState } from './utils.js';
|
|
19
19
|
export { SequencerState };
|
|
20
|
-
export type ShouldProposeArgs = {
|
|
21
|
-
pendingTxsCount?: number;
|
|
22
|
-
validTxsCount?: number;
|
|
23
|
-
processedTxsCount?: number;
|
|
24
|
-
};
|
|
25
20
|
export declare class SequencerTooSlowError extends Error {
|
|
26
21
|
readonly currentState: SequencerState;
|
|
27
22
|
readonly proposedState: SequencerState;
|
|
@@ -45,11 +40,12 @@ export declare class Sequencer {
|
|
|
45
40
|
private globalsBuilder;
|
|
46
41
|
private p2pClient;
|
|
47
42
|
private worldState;
|
|
43
|
+
private slasherClient;
|
|
48
44
|
private blockBuilderFactory;
|
|
49
45
|
private l2BlockSource;
|
|
50
46
|
private l1ToL2MessageSource;
|
|
51
47
|
private publicProcessorFactory;
|
|
52
|
-
private
|
|
48
|
+
private contractDataSource;
|
|
53
49
|
protected l1Constants: SequencerRollupConstants;
|
|
54
50
|
private dateProvider;
|
|
55
51
|
private config;
|
|
@@ -64,6 +60,7 @@ export declare class Sequencer {
|
|
|
64
60
|
private state;
|
|
65
61
|
private allowedInSetup;
|
|
66
62
|
private maxBlockSizeInBytes;
|
|
63
|
+
private maxBlockGas;
|
|
67
64
|
private processTxTime;
|
|
68
65
|
private metrics;
|
|
69
66
|
private isFlushing;
|
|
@@ -74,7 +71,7 @@ export declare class Sequencer {
|
|
|
74
71
|
protected timeTable: Record<SequencerState, number>;
|
|
75
72
|
protected enforceTimeTable: boolean;
|
|
76
73
|
constructor(publisher: L1Publisher, validatorClient: ValidatorClient | undefined, // During migration the validator client can be inactive
|
|
77
|
-
globalsBuilder: GlobalVariableBuilder, p2pClient: P2P, worldState: WorldStateSynchronizer, 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);
|
|
78
75
|
get tracer(): Tracer;
|
|
79
76
|
/**
|
|
80
77
|
* Updates sequencer config.
|
|
@@ -123,16 +120,14 @@ export declare class Sequencer {
|
|
|
123
120
|
* it is only used to check if we have enough time left in the slot to transition to the new state.
|
|
124
121
|
*/
|
|
125
122
|
setState(proposedState: SequencerState, currentSlotNumber: bigint, force?: boolean): void;
|
|
126
|
-
shouldProposeBlock(historicalHeader: BlockHeader | undefined, args: ShouldProposeArgs): boolean;
|
|
127
123
|
/**
|
|
128
124
|
* Build a block
|
|
129
125
|
*
|
|
130
126
|
* Shared between the sequencer and the validator for re-execution
|
|
131
127
|
*
|
|
132
|
-
* @param
|
|
128
|
+
* @param pendingTxs - The pending transactions to construct the block from
|
|
133
129
|
* @param newGlobalVariables - The global variables for the new block
|
|
134
130
|
* @param historicalHeader - The historical header of the parent
|
|
135
|
-
* @param interrupt - The interrupt callback, used to validate the block for submission and check if we should propose the block
|
|
136
131
|
* @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal
|
|
137
132
|
*/
|
|
138
133
|
private buildBlock;
|
|
@@ -142,7 +137,7 @@ export declare class Sequencer {
|
|
|
142
137
|
* @dev MUST throw instead of exiting early to ensure that world-state
|
|
143
138
|
* is being rolled back if the block is dropped.
|
|
144
139
|
*
|
|
145
|
-
* @param
|
|
140
|
+
* @param pendingTxs - Iterable of pending transactions to construct the block from
|
|
146
141
|
* @param proposalHeader - The partial header constructed for the proposal
|
|
147
142
|
* @param historicalHeader - The historical header of the parent
|
|
148
143
|
*/
|
|
@@ -156,8 +151,6 @@ export declare class Sequencer {
|
|
|
156
151
|
* @param block - The L2Block to be published.
|
|
157
152
|
*/
|
|
158
153
|
protected publishL2Block(block: L2Block, attestations?: Signature[], txHashes?: TxHash[], proofQuote?: EpochProofQuote): Promise<void>;
|
|
159
|
-
protected takeValidTxs<T extends Tx | ProcessedTx>(txs: T[], validator: TxValidator<T>): Promise<T[]>;
|
|
160
|
-
protected takeTxsWithinMaxSize(txs: Tx[]): Tx[];
|
|
161
154
|
protected claimEpochProofRightIfAvailable(slotNumber: bigint): Promise<bigint | undefined>;
|
|
162
155
|
/**
|
|
163
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;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D,OAAO,EAAE,KAAK,YAAY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