@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.
- package/dest/client/index.js +0 -1
- package/dest/client/sequencer-client.js +55 -55
- package/dest/config.js +40 -42
- package/dest/global_variable_builder/global_builder.js +39 -26
- package/dest/global_variable_builder/index.js +0 -1
- package/dest/index.js +0 -1
- package/dest/publisher/config.js +49 -50
- package/dest/publisher/index.js +0 -1
- package/dest/publisher/sequencer-publisher-metrics.js +32 -23
- package/dest/publisher/sequencer-publisher.js +251 -253
- package/dest/sequencer/allowed.js +5 -12
- package/dest/sequencer/config.js +1 -2
- package/dest/sequencer/index.js +0 -1
- package/dest/sequencer/metrics.js +26 -18
- package/dest/sequencer/sequencer.js +648 -607
- package/dest/sequencer/timetable.js +33 -19
- package/dest/sequencer/utils.js +22 -32
- package/dest/slasher/factory.js +6 -5
- package/dest/slasher/index.js +0 -1
- package/dest/slasher/slasher_client.js +128 -122
- package/dest/test/index.js +4 -1
- package/dest/tx_validator/archive_cache.js +7 -7
- package/dest/tx_validator/gas_validator.js +76 -64
- package/dest/tx_validator/nullifier_cache.js +8 -8
- package/dest/tx_validator/phases_validator.js +27 -19
- package/dest/tx_validator/test_utils.js +1 -2
- package/dest/tx_validator/tx_validator_factory.js +5 -5
- package/package.json +23 -22
- package/src/client/sequencer-client.ts +23 -2
- package/src/config.ts +1 -1
- package/src/publisher/sequencer-publisher.ts +71 -91
- package/src/sequencer/sequencer.ts +29 -13
- package/src/slasher/factory.ts +3 -3
- package/src/slasher/slasher_client.ts +40 -31
- package/dest/client/index.d.ts +0 -2
- package/dest/client/index.d.ts.map +0 -1
- package/dest/client/sequencer-client.d.ts +0 -68
- package/dest/client/sequencer-client.d.ts.map +0 -1
- package/dest/config.d.ts +0 -37
- package/dest/config.d.ts.map +0 -1
- package/dest/global_variable_builder/global_builder.d.ts +0 -29
- package/dest/global_variable_builder/global_builder.d.ts.map +0 -1
- package/dest/global_variable_builder/index.d.ts +0 -2
- package/dest/global_variable_builder/index.d.ts.map +0 -1
- package/dest/index.d.ts +0 -8
- package/dest/index.d.ts.map +0 -1
- package/dest/publisher/config.d.ts +0 -38
- package/dest/publisher/config.d.ts.map +0 -1
- package/dest/publisher/index.d.ts +0 -2
- package/dest/publisher/index.d.ts.map +0 -1
- package/dest/publisher/sequencer-publisher-metrics.d.ts +0 -24
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +0 -1
- package/dest/publisher/sequencer-publisher.d.ts +0 -158
- package/dest/publisher/sequencer-publisher.d.ts.map +0 -1
- package/dest/sequencer/allowed.d.ts +0 -3
- package/dest/sequencer/allowed.d.ts.map +0 -1
- package/dest/sequencer/config.d.ts +0 -2
- package/dest/sequencer/config.d.ts.map +0 -1
- package/dest/sequencer/index.d.ts +0 -4
- package/dest/sequencer/index.d.ts.map +0 -1
- package/dest/sequencer/metrics.d.ts +0 -24
- package/dest/sequencer/metrics.d.ts.map +0 -1
- package/dest/sequencer/sequencer.d.ts +0 -172
- package/dest/sequencer/sequencer.d.ts.map +0 -1
- package/dest/sequencer/timetable.d.ts +0 -38
- package/dest/sequencer/timetable.d.ts.map +0 -1
- package/dest/sequencer/utils.d.ts +0 -47
- package/dest/sequencer/utils.d.ts.map +0 -1
- package/dest/slasher/factory.d.ts +0 -11
- package/dest/slasher/factory.d.ts.map +0 -1
- package/dest/slasher/index.d.ts +0 -3
- package/dest/slasher/index.d.ts.map +0 -1
- package/dest/slasher/slasher_client.d.ts +0 -127
- package/dest/slasher/slasher_client.d.ts.map +0 -1
- package/dest/test/index.d.ts +0 -17
- package/dest/test/index.d.ts.map +0 -1
- package/dest/tx_validator/archive_cache.d.ts +0 -14
- package/dest/tx_validator/archive_cache.d.ts.map +0 -1
- package/dest/tx_validator/gas_validator.d.ts +0 -12
- package/dest/tx_validator/gas_validator.d.ts.map +0 -1
- package/dest/tx_validator/nullifier_cache.d.ts +0 -16
- package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
- package/dest/tx_validator/phases_validator.d.ts +0 -11
- package/dest/tx_validator/phases_validator.d.ts.map +0 -1
- package/dest/tx_validator/test_utils.d.ts +0 -21
- package/dest/tx_validator/test_utils.d.ts.map +0 -1
- package/dest/tx_validator/tx_validator_factory.d.ts +0 -16
- package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
|
@@ -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 AztecKVStore } 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: AztecKVStore, 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(): 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(): 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,EAAE,KAAK,YAAY,EAAsC,MAAM,iBAAiB,CAAC;AACxF,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;;GAEG;AACH,oBAAY,kBAAkB;IAC5B,IAAI,IAAA;IACJ,QAAQ,IAAA;IACR,OAAO,IAAA;IACP,OAAO,IAAA;CACR;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE,kBAAkB,CAAC;IAC1B;;OAEG;IACH,eAAe,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAQD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAwBzC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,aAAa;IAErB,OAAO,CAAC,GAAG;IA3Bb,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,WAAW,CAAC,CAAyB;IAC7C,OAAO,CAAC,wBAAwB,CAAM;IACtC,OAAO,CAAC,wBAAwB,CAAM;IAEtC,OAAO,CAAC,kBAAkB,CAA2B;IACrD,OAAO,CAAC,wBAAwB,CAAyB;IACzD,OAAO,CAAC,wBAAwB,CAAyB;IAEzD,OAAO,CAAC,WAAW,CAAC;IAEpB,OAAO,CAAC,WAAW,CAAoB;IAEvC,SAAS,CAAC,oBAAoB,CAAC,EAAE,qBAAqB,CAAC,OAAO,eAAe,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CACtG;IAKZ,OAAO,CAAC,cAAc,CAAc;gBAG1B,MAAM,EAAE,aAAa,GAAG,iBAAiB,GAAG,cAAc,EAC1D,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,aAAa,EACpC,SAAS,GAAE,eAAsC,EACzC,GAAG,yCAA0B;IAkC1B,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IA8B1E,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI3D,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IA6BtB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBhE,KAAK;IAmClB;;;OAGG;IACU,IAAI;IAQjB;;;OAGG;IACI,OAAO;IAId;;;OAGG;IACI,uBAAuB;IAI9B;;;OAGG;IACI,uBAAuB;IAI9B;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAenD;;;;OAIG;YACW,oBAAoB;IAclC;;;;OAIG;YACW,oBAAoB;YAWpB,mBAAmB;IAqBjC,OAAO,CAAC,qBAAqB;IAc7B;;;OAGG;IACH,OAAO,CAAC,eAAe;CAIxB"}
|
package/dest/test/index.d.ts
DELETED
|
@@ -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
|
package/dest/test/index.d.ts.map
DELETED
|
@@ -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"}
|