@aztec/sequencer-client 0.74.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 (85) hide show
  1. package/dest/client/index.js +0 -1
  2. package/dest/client/sequencer-client.js +52 -57
  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 +216 -191
  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 +5 -4
  19. package/dest/slasher/index.js +0 -1
  20. package/dest/slasher/slasher_client.js +107 -110
  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/config.ts +1 -1
  30. package/src/publisher/sequencer-publisher.ts +1 -1
  31. package/src/sequencer/sequencer.ts +29 -13
  32. package/dest/client/index.d.ts +0 -2
  33. package/dest/client/index.d.ts.map +0 -1
  34. package/dest/client/sequencer-client.d.ts +0 -68
  35. package/dest/client/sequencer-client.d.ts.map +0 -1
  36. package/dest/config.d.ts +0 -37
  37. package/dest/config.d.ts.map +0 -1
  38. package/dest/global_variable_builder/global_builder.d.ts +0 -29
  39. package/dest/global_variable_builder/global_builder.d.ts.map +0 -1
  40. package/dest/global_variable_builder/index.d.ts +0 -2
  41. package/dest/global_variable_builder/index.d.ts.map +0 -1
  42. package/dest/index.d.ts +0 -8
  43. package/dest/index.d.ts.map +0 -1
  44. package/dest/publisher/config.d.ts +0 -38
  45. package/dest/publisher/config.d.ts.map +0 -1
  46. package/dest/publisher/index.d.ts +0 -2
  47. package/dest/publisher/index.d.ts.map +0 -1
  48. package/dest/publisher/sequencer-publisher-metrics.d.ts +0 -24
  49. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +0 -1
  50. package/dest/publisher/sequencer-publisher.d.ts +0 -163
  51. package/dest/publisher/sequencer-publisher.d.ts.map +0 -1
  52. package/dest/sequencer/allowed.d.ts +0 -3
  53. package/dest/sequencer/allowed.d.ts.map +0 -1
  54. package/dest/sequencer/config.d.ts +0 -2
  55. package/dest/sequencer/config.d.ts.map +0 -1
  56. package/dest/sequencer/index.d.ts +0 -4
  57. package/dest/sequencer/index.d.ts.map +0 -1
  58. package/dest/sequencer/metrics.d.ts +0 -24
  59. package/dest/sequencer/metrics.d.ts.map +0 -1
  60. package/dest/sequencer/sequencer.d.ts +0 -172
  61. package/dest/sequencer/sequencer.d.ts.map +0 -1
  62. package/dest/sequencer/timetable.d.ts +0 -38
  63. package/dest/sequencer/timetable.d.ts.map +0 -1
  64. package/dest/sequencer/utils.d.ts +0 -47
  65. package/dest/sequencer/utils.d.ts.map +0 -1
  66. package/dest/slasher/factory.d.ts +0 -11
  67. package/dest/slasher/factory.d.ts.map +0 -1
  68. package/dest/slasher/index.d.ts +0 -3
  69. package/dest/slasher/index.d.ts.map +0 -1
  70. package/dest/slasher/slasher_client.d.ts +0 -127
  71. package/dest/slasher/slasher_client.d.ts.map +0 -1
  72. package/dest/test/index.d.ts +0 -17
  73. package/dest/test/index.d.ts.map +0 -1
  74. package/dest/tx_validator/archive_cache.d.ts +0 -14
  75. package/dest/tx_validator/archive_cache.d.ts.map +0 -1
  76. package/dest/tx_validator/gas_validator.d.ts +0 -12
  77. package/dest/tx_validator/gas_validator.d.ts.map +0 -1
  78. package/dest/tx_validator/nullifier_cache.d.ts +0 -16
  79. package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
  80. package/dest/tx_validator/phases_validator.d.ts +0 -11
  81. package/dest/tx_validator/phases_validator.d.ts.map +0 -1
  82. package/dest/tx_validator/test_utils.d.ts +0 -21
  83. package/dest/tx_validator/test_utils.d.ts.map +0 -1
  84. package/dest/tx_validator/tx_validator_factory.d.ts +0 -16
  85. package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
@@ -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":"sequenc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;;;;;;;;IAiIvC;;;;;;;;OAQG;YAIW,2BAA2B;cAkEzB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC;cA6CzF,gCAAgC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAgD1G;;;OAGG;cAIa,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,SAAS,EAAE,EAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC;cAuBA,+BAA+B,CAAC,UAAU,EAAE,MAAM;IAiBlE;;;;OAIG;cACa,aAAa;IA+B7B,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,kBAAkB;IAK1B,IAAI,iBAAiB,WAEpB;IAED,IAAI,QAAQ,IAAI,UAAU,CAEzB;IAED,IAAI,YAAY,IAAI,YAAY,CAE/B;CACF"}
@@ -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,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,qBAAa,kBAAkB;IAqB3B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,4BAA4B;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAzBtB,wDAAwD;IACxD,SAAgB,WAAW,KAAK;IAEhC,uDAAuD;IACvD,SAAgB,gBAAgB,KAAK;IAErC,mGAAmG;IACnG,SAAgB,0BAA0B,KAAK;IAE/C,mIAAmI;IACnI,SAAgB,mBAAmB,KAAK;IAExC;;;;OAIG;IACH,SAAgB,gBAAgB,SAAC;gBAGd,oBAAoB,EAAE,MAAM,EAC5B,iBAAiB,EAAE,MAAM,EACzB,4BAA4B,EAAE,MAAM,EACpC,OAAO,GAAE,OAAc,EACvB,OAAO,CAAC,8BAAkB,EAC1B,GAAG,mCAAsC;IAK5D,OAAO,KAAK,yCAAyC,GAEpD;IAEM,2BAA2B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;IAenE,OAAO,KAAK,0BAA0B,GAErC;IAEM,yBAAyB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;IAU1D,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAsB5D,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,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"}
@@ -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 AztecAsyncKVStore } 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?: AztecAsyncKVStore;
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,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,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,iBAAiB,CAAA;CAAE,2BAKpC,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"}
@@ -1,127 +0,0 @@
1
- import { type L2BlockId, type L2BlockSource, type L2BlockStreamEvent, type L2Tips } from '@aztec/circuit-types';
2
- import { type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum';
3
- import { EthAddress } from '@aztec/foundation/eth-address';
4
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
5
- import { SlashFactoryAbi } from '@aztec/l1-artifacts';
6
- import { type TelemetryClient, WithTracer } from '@aztec/telemetry-client';
7
- import { type Chain, type GetContractReturnType, type HttpTransport, type PublicClient } from 'viem';
8
- /**
9
- * Enum defining the possible states of the Slasher client.
10
- */
11
- export declare enum SlasherClientState {
12
- IDLE = 0,
13
- SYNCHING = 1,
14
- RUNNING = 2,
15
- STOPPED = 3
16
- }
17
- /**
18
- * The synchronization status of the Slasher client.
19
- */
20
- export interface SlasherSyncState {
21
- /**
22
- * The current state of the slasher client.
23
- */
24
- state: SlasherClientState;
25
- /**
26
- * The block number that the slasher client is synced to.
27
- */
28
- syncedToL2Block: L2BlockId;
29
- }
30
- export interface SlasherConfig {
31
- blockCheckIntervalMS: number;
32
- blockRequestBatchSize: number;
33
- }
34
- /**
35
- * @notice A Hypomeiones slasher client implementation
36
- *
37
- * Hypomeiones: a class of individuals in ancient Sparta who were considered inferior or lesser citizens compared
38
- * to the full Spartan citizens.
39
- *
40
- * The implementation here is less than ideal. It exists, not to be the end all be all, but to show that
41
- * slashing can be done with this mechanism.
42
- *
43
- * The implementation is VERY brute in the sense that it only looks for pruned blocks and then tries to slash
44
- * the full committee of that.
45
- * If it sees a prune, it will mark the full epoch as "to be slashed".
46
- *
47
- * Also, it is not particularly smart around what it should if there were to be multiple slashing events.
48
- *
49
- * A few improvements:
50
- * - Only vote on the proposal if it is possible to reach, e.g., if 6 votes are needed and only 4 slots are left don't vote.
51
- * - Stop voting on a payload once it is processed.
52
- * - Only vote on the proposal if it have not already been executed
53
- * - Caveat, we need to fully decide if it is acceptable to have the same payload address multiple times. In the current
54
- * slash factory that could mean slashing the same committee for the same error multiple times.
55
- * - Decide how to deal with multiple slashing events in the same round.
56
- * - This could be that multiple epochs are pruned in the same round, but with the current naive implementation we could end up
57
- * slashing only the first, because the "lifetime" of the second would have passed after that vote
58
- */
59
- export declare class SlasherClient extends WithTracer {
60
- private config;
61
- private store;
62
- private l2BlockSource;
63
- private log;
64
- private currentState;
65
- private syncPromise;
66
- private syncResolve?;
67
- private latestBlockNumberAtStart;
68
- private provenBlockNumberAtStart;
69
- private synchedBlockHashes;
70
- private synchedLatestBlockNumber;
71
- private synchedProvenBlockNumber;
72
- private blockStream;
73
- private slashEvents;
74
- protected slashFactoryContract?: GetContractReturnType<typeof SlashFactoryAbi, PublicClient<HttpTransport, Chain>>;
75
- private slashingAmount;
76
- constructor(config: SlasherConfig & L1ContractsConfig & L1ReaderConfig, store: AztecAsyncKVStore, l2BlockSource: L2BlockSource, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
77
- getSlashPayload(slotNumber: bigint): Promise<EthAddress | undefined>;
78
- getL2BlockHash(number: number): Promise<string | undefined>;
79
- getL2Tips(): Promise<L2Tips>;
80
- handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void>;
81
- start(): Promise<void>;
82
- /**
83
- * Allows consumers to stop the instance of the slasher client.
84
- * 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
85
- */
86
- stop(): Promise<void>;
87
- /**
88
- * Public function to check if the slasher client is fully synced and ready to receive txs.
89
- * @returns True if the slasher client is ready to receive txs.
90
- */
91
- isReady(): boolean;
92
- /**
93
- * Public function to check the latest block number that the slasher client is synced to.
94
- * @returns Block number of latest L2 Block we've synced with.
95
- */
96
- getSyncedLatestBlockNum(): Promise<number>;
97
- /**
98
- * Public function to check the latest proven block number that the slasher client is synced to.
99
- * @returns Block number of latest proven L2 Block we've synced with.
100
- */
101
- getSyncedProvenBlockNum(): Promise<number>;
102
- /**
103
- * Method to check the status of the slasher client.
104
- * @returns Information about slasher client status: state & syncedToBlockNum.
105
- */
106
- getStatus(): Promise<SlasherSyncState>;
107
- /**
108
- * Handles new blocks
109
- * @param blocks - A list of blocks that the slasher client needs to store block hashes for
110
- * @returns Empty promise.
111
- */
112
- private handleLatestL2Blocks;
113
- /**
114
- * Handles new proven blocks by updating the proven block number
115
- * @param blocks - A list of proven L2 blocks.
116
- * @returns Empty promise.
117
- */
118
- private handleProvenL2Blocks;
119
- private handlePruneL2Blocks;
120
- private startServiceIfSynched;
121
- /**
122
- * Method to set the value of the current state.
123
- * @param newState - New state value.
124
- */
125
- private setCurrentState;
126
- }
127
- //# sourceMappingURL=slasher_client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slasher_client.d.ts","sourceRoot":"","sources":["../../src/slasher/slasher_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACvB,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAuB,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAsC,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,KAAK,eAAe,EAAE,UAAU,EAAsB,MAAM,yBAAyB,CAAC;AAE/F,OAAO,EACL,KAAK,KAAK,EACV,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,YAAY,EAKlB,MAAM,MAAM,CAAC;AAEd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E,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIrD,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IA6B5B,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBhE,KAAK;IAmClB;;;OAGG;IACU,IAAI;IAUjB;;;OAGG;IACI,OAAO;IAId;;;OAGG;IACU,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIvD;;;OAGG;IACU,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIvD;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAenD;;;;OAIG;YACW,oBAAoB;IAiBlC;;;;OAIG;YACW,oBAAoB;YAWpB,mBAAmB;YAqBnB,qBAAqB;IAkBnC;;;OAGG;IACH,OAAO,CAAC,eAAe;CAIxB"}
@@ -1,17 +0,0 @@
1
- import { type PublicProcessorFactory } from '@aztec/simulator/server';
2
- import { SequencerClient } from '../client/sequencer-client.js';
3
- import { type SequencerPublisher } from '../publisher/sequencer-publisher.js';
4
- import { Sequencer } from '../sequencer/sequencer.js';
5
- import { type SequencerTimetable } from '../sequencer/timetable.js';
6
- declare class TestSequencer_ extends Sequencer {
7
- publicProcessorFactory: PublicProcessorFactory;
8
- timetable: SequencerTimetable;
9
- publisher: SequencerPublisher;
10
- }
11
- export type TestSequencer = TestSequencer_;
12
- declare class TestSequencerClient_ extends SequencerClient {
13
- sequencer: TestSequencer;
14
- }
15
- export type TestSequencerClient = TestSequencerClient_;
16
- export {};
17
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,cAAM,cAAe,SAAQ,SAAS;IACpB,sBAAsB,EAAG,sBAAsB,CAAC;IAChD,SAAS,EAAG,kBAAkB,CAAC;IAC/B,SAAS,EAAG,kBAAkB,CAAC;CAChD;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAE3C,cAAM,oBAAqB,SAAQ,eAAe;IAChC,SAAS,EAAG,aAAa,CAAC;CAC3C;AAED,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC"}
@@ -1,14 +0,0 @@
1
- import { type MerkleTreeReadOperations } from '@aztec/circuit-types';
2
- import { type Fr } from '@aztec/circuits.js';
3
- import { type ArchiveSource } from '@aztec/p2p';
4
- /**
5
- * Implements an archive source by checking a DB and an in-memory collection.
6
- * Intended for validating transactions as they are added to a block.
7
- */
8
- export declare class ArchiveCache implements ArchiveSource {
9
- private db;
10
- archives: Map<string, bigint>;
11
- constructor(db: MerkleTreeReadOperations);
12
- getArchiveIndices(archives: Fr[]): Promise<(bigint | undefined)[]>;
13
- }
14
- //# sourceMappingURL=archive_cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"archive_cache.d.ts","sourceRoot":"","sources":["../../src/tx_validator/archive_cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;GAGG;AACH,qBAAa,YAAa,YAAW,aAAa;IAGpC,OAAO,CAAC,EAAE;IAFtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEV,EAAE,EAAE,wBAAwB;IAInC,iBAAiB,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;CAWhF"}
@@ -1,12 +0,0 @@
1
- import { type Tx, type TxValidationResult, type TxValidator } from '@aztec/circuit-types';
2
- import { type AztecAddress, Fr, type GasFees } from '@aztec/circuits.js';
3
- /** Provides a view into public contract state */
4
- export interface PublicStateSource {
5
- storageRead: (contractAddress: AztecAddress, slot: Fr) => Promise<Fr>;
6
- }
7
- export declare class GasTxValidator implements TxValidator<Tx> {
8
- #private;
9
- constructor(publicDataSource: PublicStateSource, feeJuiceAddress: AztecAddress, enforceFees: boolean, gasFees: GasFees);
10
- validateTx(tx: Tx): Promise<TxValidationResult>;
11
- }
12
- //# sourceMappingURL=gas_validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gas_validator.d.ts","sourceRoot":"","sources":["../../src/tx_validator/gas_validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAoB,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,KAAK,YAAY,EAAE,EAAE,EAAoB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAK3F,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;CACvE;AAED,qBAAa,cAAe,YAAW,WAAW,CAAC,EAAE,CAAC;;gBAQlD,gBAAgB,EAAE,iBAAiB,EACnC,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,OAAO;IAQlB,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA+EhD"}
@@ -1,16 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import { type MerkleTreeReadOperations } from '@aztec/circuit-types';
4
- import { type NullifierSource } from '@aztec/p2p';
5
- /**
6
- * Implements a nullifier source by checking a DB and an in-memory collection.
7
- * Intended for validating transactions as they are added to a block.
8
- */
9
- export declare class NullifierCache implements NullifierSource {
10
- private db;
11
- nullifiers: Set<string>;
12
- constructor(db: MerkleTreeReadOperations);
13
- nullifiersExist(nullifiers: Buffer[]): Promise<boolean[]>;
14
- addNullifiers(nullifiers: Buffer[]): void;
15
- }
16
- //# sourceMappingURL=nullifier_cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullifier_cache.d.ts","sourceRoot":"","sources":["../../src/tx_validator/nullifier_cache.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAgB,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;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"}
@@ -1,11 +0,0 @@
1
- import { type AllowedElement, type PublicExecutionRequest, Tx, type TxValidationResult, type TxValidator } from '@aztec/circuit-types';
2
- import { type ContractDataSource } from '@aztec/circuits.js';
3
- export declare class PhasesTxValidator implements TxValidator<Tx> {
4
- #private;
5
- private setupAllowList;
6
- private contractDataSource;
7
- constructor(contracts: ContractDataSource, setupAllowList: AllowedElement[]);
8
- validateTx(tx: Tx): Promise<TxValidationResult>;
9
- isOnAllowList(publicCall: PublicExecutionRequest, allowList: AllowedElement[]): Promise<boolean>;
10
- }
11
- //# sourceMappingURL=phases_validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"phases_validator.d.ts","sourceRoot":"","sources":["../../src/tx_validator/phases_validator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,EAAE,EAEF,KAAK,kBAAkB,EACvB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAI7D,qBAAa,iBAAkB,YAAW,WAAW,CAAC,EAAE,CAAC;;IAIZ,OAAO,CAAC,cAAc;IAFjE,OAAO,CAAC,kBAAkB,CAA8B;gBAE5C,SAAS,EAAE,kBAAkB,EAAU,cAAc,EAAE,cAAc,EAAE;IAI7E,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgC/C,aAAa,CAAC,UAAU,EAAE,sBAAsB,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CA6CvG"}
@@ -1,21 +0,0 @@
1
- import { type Tx } from '@aztec/circuit-types';
2
- import { type AztecAddress, type Fr, type FunctionSelector } from '@aztec/circuits.js';
3
- export declare function patchNonRevertibleFn(tx: Tx, index: number, overrides: {
4
- address?: AztecAddress;
5
- selector: FunctionSelector;
6
- args?: Fr[];
7
- msgSender?: AztecAddress;
8
- }): Promise<{
9
- address: AztecAddress;
10
- selector: FunctionSelector;
11
- }>;
12
- export declare function patchRevertibleFn(tx: Tx, index: number, overrides: {
13
- address?: AztecAddress;
14
- selector: FunctionSelector;
15
- args?: Fr[];
16
- msgSender?: AztecAddress;
17
- }): Promise<{
18
- address: AztecAddress;
19
- selector: FunctionSelector;
20
- }>;
21
- //# sourceMappingURL=test_utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test_utils.d.ts","sourceRoot":"","sources":["../../src/tx_validator/test_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGvF,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAC;IAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,YAAY,CAAA;CAAE,GACvG,OAAO,CAAC;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAEhE;AAED,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAC;IAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,YAAY,CAAA;CAAE,GACvG,OAAO,CAAC;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAEhE"}
@@ -1,16 +0,0 @@
1
- import { type AllowedElement, type ClientProtocolCircuitVerifier, type MerkleTreeReadOperations, type ProcessedTx, type Tx, type TxValidator } from '@aztec/circuit-types';
2
- import { type ContractDataSource, type GasFees, type GlobalVariables } from '@aztec/circuits.js';
3
- import { NullifierCache } from './nullifier_cache.js';
4
- export declare function createValidatorForAcceptingTxs(db: MerkleTreeReadOperations, contractDataSource: ContractDataSource, verifier: ClientProtocolCircuitVerifier | undefined, data: {
5
- blockNumber: number;
6
- l1ChainId: number;
7
- enforceFees: boolean;
8
- setupAllowList: AllowedElement[];
9
- gasFees: GasFees;
10
- }): TxValidator<Tx>;
11
- export declare function createValidatorsForBlockBuilding(db: MerkleTreeReadOperations, contractDataSource: ContractDataSource, globalVariables: GlobalVariables, enforceFees: boolean, setupAllowList: AllowedElement[]): {
12
- preprocessValidator: TxValidator<Tx>;
13
- postprocessValidator: TxValidator<ProcessedTx>;
14
- nullifierCache: NullifierCache;
15
- };
16
- //# sourceMappingURL=tx_validator_factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tx_validator_factory.d.ts","sourceRoot":"","sources":["../../src/tx_validator/tx_validator_factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,KAAK,EAAE,EACP,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAqB,KAAK,kBAAkB,EAAM,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAcxH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,wBAAgB,8BAA8B,CAC5C,EAAE,EAAE,wBAAwB,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,6BAA6B,GAAG,SAAS,EACnD,IAAI,EAAE;IACJ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB,GACA,WAAW,CAAC,EAAE,CAAC,CAgBjB;AAED,wBAAgB,gCAAgC,CAC9C,EAAE,EAAE,wBAAwB,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,OAAO,EACpB,cAAc,EAAE,cAAc,EAAE,GAC/B;IACD,mBAAmB,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IACrC,oBAAoB,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/C,cAAc,EAAE,cAAc,CAAC;CAChC,CAkBA"}