@aztec/archiver 0.77.0-testnet-ignition.28 → 0.77.0-testnet-ignition.30
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/archiver/archiver.d.ts +197 -0
- package/dest/archiver/archiver.d.ts.map +1 -0
- package/dest/archiver/archiver_store.d.ts +220 -0
- package/dest/archiver/archiver_store.d.ts.map +1 -0
- package/dest/archiver/archiver_store_test_suite.d.ts +8 -0
- package/dest/archiver/archiver_store_test_suite.d.ts.map +1 -0
- package/dest/archiver/config.d.ts +37 -0
- package/dest/archiver/config.d.ts.map +1 -0
- package/dest/archiver/data_retrieval.d.ts +74 -0
- package/dest/archiver/data_retrieval.d.ts.map +1 -0
- package/dest/archiver/errors.d.ts +4 -0
- package/dest/archiver/errors.d.ts.map +1 -0
- package/dest/archiver/index.d.ts +8 -0
- package/dest/archiver/index.d.ts.map +1 -0
- package/dest/archiver/instrumentation.d.ts +29 -0
- package/dest/archiver/instrumentation.d.ts.map +1 -0
- package/dest/archiver/kv_archiver_store/block_store.d.ts +87 -0
- package/dest/archiver/kv_archiver_store/block_store.d.ts.map +1 -0
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +18 -0
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +1 -0
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +21 -0
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +1 -0
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +152 -0
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -0
- package/dest/archiver/kv_archiver_store/log_store.d.ts +49 -0
- package/dest/archiver/kv_archiver_store/log_store.d.ts.map +1 -0
- package/dest/archiver/kv_archiver_store/message_store.d.ts +33 -0
- package/dest/archiver/kv_archiver_store/message_store.d.ts.map +1 -0
- package/dest/archiver/kv_archiver_store/nullifier_store.d.ts +12 -0
- package/dest/archiver/kv_archiver_store/nullifier_store.d.ts.map +1 -0
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts +23 -0
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts.map +1 -0
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +175 -0
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +1 -0
- package/dest/archiver/structs/data_retrieval.d.ts +27 -0
- package/dest/archiver/structs/data_retrieval.d.ts.map +1 -0
- package/dest/archiver/structs/published.d.ts +11 -0
- package/dest/archiver/structs/published.d.ts.map +1 -0
- package/dest/factory.d.ts +24 -0
- package/dest/factory.d.ts.map +1 -0
- package/dest/index.d.ts +5 -0
- package/dest/index.d.ts.map +1 -0
- package/dest/rpc/index.d.ts +10 -0
- package/dest/rpc/index.d.ts.map +1 -0
- package/dest/test/index.d.ts +4 -0
- package/dest/test/index.d.ts.map +1 -0
- package/dest/test/mock_archiver.d.ts +23 -0
- package/dest/test/mock_archiver.d.ts.map +1 -0
- package/dest/test/mock_l1_to_l2_message_source.d.ts +16 -0
- package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -0
- package/dest/test/mock_l2_block_source.d.ts +79 -0
- package/dest/test/mock_l2_block_source.d.ts.map +1 -0
- package/package.json +13 -13
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
3
|
+
import { type ViemPublicClient } from '@aztec/ethereum';
|
|
4
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
6
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
7
|
+
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
8
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
9
|
+
import { type InBlock, type L2Block, type L2BlockSource, type L2Tips, type NullifierWithBlockSource } from '@aztec/stdlib/block';
|
|
10
|
+
import { type ContractClassPublic, type ContractDataSource, type ContractInstanceWithAddress, type PublicFunction } from '@aztec/stdlib/contract';
|
|
11
|
+
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
12
|
+
import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
|
|
13
|
+
import type { L2LogsSource } from '@aztec/stdlib/interfaces/server';
|
|
14
|
+
import { type LogFilter, type PrivateLog, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
15
|
+
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
16
|
+
import { type BlockHeader, TxEffect, TxHash, TxReceipt } from '@aztec/stdlib/tx';
|
|
17
|
+
import { type TelemetryClient, type Traceable, type Tracer } from '@aztec/telemetry-client';
|
|
18
|
+
import { EventEmitter } from 'events';
|
|
19
|
+
import type { ArchiverDataStore } from './archiver_store.js';
|
|
20
|
+
import type { ArchiverConfig } from './config.js';
|
|
21
|
+
import { ArchiverInstrumentation } from './instrumentation.js';
|
|
22
|
+
/**
|
|
23
|
+
* Helper interface to combine all sources this archiver implementation provides.
|
|
24
|
+
*/
|
|
25
|
+
export type ArchiveSource = L2BlockSource & L2LogsSource & ContractDataSource & L1ToL2MessageSource & NullifierWithBlockSource;
|
|
26
|
+
/**
|
|
27
|
+
* Pulls L2 blocks in a non-blocking manner and provides interface for their retrieval.
|
|
28
|
+
* Responsible for handling robust L1 polling so that other components do not need to
|
|
29
|
+
* concern themselves with it.
|
|
30
|
+
*/
|
|
31
|
+
export declare class Archiver extends EventEmitter implements ArchiveSource, Traceable {
|
|
32
|
+
private readonly publicClient;
|
|
33
|
+
private readonly l1Addresses;
|
|
34
|
+
readonly dataStore: ArchiverDataStore;
|
|
35
|
+
private readonly config;
|
|
36
|
+
private readonly blobSinkClient;
|
|
37
|
+
private readonly instrumentation;
|
|
38
|
+
private readonly l1constants;
|
|
39
|
+
private readonly log;
|
|
40
|
+
/**
|
|
41
|
+
* A promise in which we will be continually fetching new L2 blocks.
|
|
42
|
+
*/
|
|
43
|
+
private runningPromise?;
|
|
44
|
+
private rollup;
|
|
45
|
+
private inbox;
|
|
46
|
+
private store;
|
|
47
|
+
l1BlockNumber: bigint | undefined;
|
|
48
|
+
l1Timestamp: bigint | undefined;
|
|
49
|
+
readonly tracer: Tracer;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new instance of the Archiver.
|
|
52
|
+
* @param publicClient - A client for interacting with the Ethereum node.
|
|
53
|
+
* @param rollupAddress - Ethereum address of the rollup contract.
|
|
54
|
+
* @param inboxAddress - Ethereum address of the inbox contract.
|
|
55
|
+
* @param registryAddress - Ethereum address of the registry contract.
|
|
56
|
+
* @param pollingIntervalMs - The interval for polling for L1 logs (in milliseconds).
|
|
57
|
+
* @param store - An archiver data store for storage & retrieval of blocks, encrypted logs & contract data.
|
|
58
|
+
* @param log - A logger.
|
|
59
|
+
*/
|
|
60
|
+
constructor(publicClient: ViemPublicClient, l1Addresses: {
|
|
61
|
+
rollupAddress: EthAddress;
|
|
62
|
+
inboxAddress: EthAddress;
|
|
63
|
+
registryAddress: EthAddress;
|
|
64
|
+
}, dataStore: ArchiverDataStore, config: {
|
|
65
|
+
pollingIntervalMs: number;
|
|
66
|
+
batchSize: number;
|
|
67
|
+
}, blobSinkClient: BlobSinkClientInterface, instrumentation: ArchiverInstrumentation, l1constants: L1RollupConstants, log?: Logger);
|
|
68
|
+
/**
|
|
69
|
+
* Creates a new instance of the Archiver and blocks until it syncs from chain.
|
|
70
|
+
* @param config - The archiver's desired configuration.
|
|
71
|
+
* @param archiverStore - The backing store for the archiver.
|
|
72
|
+
* @param blockUntilSynced - If true, blocks until the archiver has fully synced.
|
|
73
|
+
* @returns - An instance of the archiver.
|
|
74
|
+
*/
|
|
75
|
+
static createAndSync(config: ArchiverConfig, archiverStore: ArchiverDataStore, deps: {
|
|
76
|
+
telemetry: TelemetryClient;
|
|
77
|
+
blobSinkClient: BlobSinkClientInterface;
|
|
78
|
+
}, blockUntilSynced?: boolean): Promise<Archiver>;
|
|
79
|
+
/**
|
|
80
|
+
* Starts sync process.
|
|
81
|
+
* @param blockUntilSynced - If true, blocks until the archiver has fully synced.
|
|
82
|
+
*/
|
|
83
|
+
start(blockUntilSynced: boolean): Promise<void>;
|
|
84
|
+
private syncSafe;
|
|
85
|
+
/**
|
|
86
|
+
* Fetches logs from L1 contracts and processes them.
|
|
87
|
+
*/
|
|
88
|
+
private sync;
|
|
89
|
+
/** Queries the rollup contract on whether a prune can be executed on the immediatenext L1 block. */
|
|
90
|
+
private canPrune;
|
|
91
|
+
/** Checks if there'd be a reorg for the next block submission and start pruning now. */
|
|
92
|
+
private handleEpochPrune;
|
|
93
|
+
private nextRange;
|
|
94
|
+
private handleL1ToL2Messages;
|
|
95
|
+
private handleL2blocks;
|
|
96
|
+
/**
|
|
97
|
+
* Stops the archiver.
|
|
98
|
+
* @returns A promise signalling completion of the stop process.
|
|
99
|
+
*/
|
|
100
|
+
stop(): Promise<void>;
|
|
101
|
+
getL1Constants(): Promise<L1RollupConstants>;
|
|
102
|
+
getRollupAddress(): Promise<EthAddress>;
|
|
103
|
+
getRegistryAddress(): Promise<EthAddress>;
|
|
104
|
+
getL1BlockNumber(): bigint;
|
|
105
|
+
getL1Timestamp(): bigint;
|
|
106
|
+
getL2SlotNumber(): Promise<bigint>;
|
|
107
|
+
getL2EpochNumber(): Promise<bigint>;
|
|
108
|
+
getBlocksForEpoch(epochNumber: bigint): Promise<L2Block[]>;
|
|
109
|
+
isEpochComplete(epochNumber: bigint): Promise<boolean>;
|
|
110
|
+
/**
|
|
111
|
+
* Gets up to `limit` amount of L2 blocks starting from `from`.
|
|
112
|
+
* @param from - Number of the first block to return (inclusive).
|
|
113
|
+
* @param limit - The number of blocks to return.
|
|
114
|
+
* @param proven - If true, only return blocks that have been proven.
|
|
115
|
+
* @returns The requested L2 blocks.
|
|
116
|
+
*/
|
|
117
|
+
getBlocks(from: number, limit: number, proven?: boolean): Promise<L2Block[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Gets an l2 block.
|
|
120
|
+
* @param number - The block number to return.
|
|
121
|
+
* @returns The requested L2 block.
|
|
122
|
+
*/
|
|
123
|
+
getBlock(number: number): Promise<L2Block | undefined>;
|
|
124
|
+
getBlockHeader(number: number | 'latest'): Promise<BlockHeader | undefined>;
|
|
125
|
+
getTxEffect(txHash: TxHash): Promise<InBlock<TxEffect> | undefined>;
|
|
126
|
+
getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the public function data for a contract.
|
|
129
|
+
* @param address - The contract address containing the function to fetch.
|
|
130
|
+
* @param selector - The function selector of the function to fetch.
|
|
131
|
+
* @returns The public function data (if found).
|
|
132
|
+
*/
|
|
133
|
+
getPublicFunction(address: AztecAddress, selector: FunctionSelector): Promise<PublicFunction | undefined>;
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves all private logs from up to `limit` blocks, starting from the block number `from`.
|
|
136
|
+
* @param from - The block number from which to begin retrieving logs.
|
|
137
|
+
* @param limit - The maximum number of blocks to retrieve logs from.
|
|
138
|
+
* @returns An array of private logs from the specified range of blocks.
|
|
139
|
+
*/
|
|
140
|
+
getPrivateLogs(from: number, limit: number): Promise<PrivateLog[]>;
|
|
141
|
+
/**
|
|
142
|
+
* Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
|
|
143
|
+
* @param tags - The tags to filter the logs by.
|
|
144
|
+
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
145
|
+
* that tag.
|
|
146
|
+
*/
|
|
147
|
+
getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
|
|
148
|
+
/**
|
|
149
|
+
* Returns the provided nullifier indexes scoped to the block
|
|
150
|
+
* they were first included in, or undefined if they're not present in the tree
|
|
151
|
+
* @param blockNumber Max block number to search for the nullifiers
|
|
152
|
+
* @param nullifiers Nullifiers to get
|
|
153
|
+
* @returns The block scoped indexes of the provided nullifiers, or undefined if the nullifier doesn't exist in the tree
|
|
154
|
+
*/
|
|
155
|
+
findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
|
|
156
|
+
/**
|
|
157
|
+
* Gets public logs based on the provided filter.
|
|
158
|
+
* @param filter - The filter to apply to the logs.
|
|
159
|
+
* @returns The requested logs.
|
|
160
|
+
*/
|
|
161
|
+
getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
|
|
162
|
+
/**
|
|
163
|
+
* Gets contract class logs based on the provided filter.
|
|
164
|
+
* @param filter - The filter to apply to the logs.
|
|
165
|
+
* @returns The requested logs.
|
|
166
|
+
*/
|
|
167
|
+
getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
|
|
168
|
+
/**
|
|
169
|
+
* Gets the number of the latest L2 block processed by the block source implementation.
|
|
170
|
+
* @returns The number of the latest L2 block processed by the block source implementation.
|
|
171
|
+
*/
|
|
172
|
+
getBlockNumber(): Promise<number>;
|
|
173
|
+
getProvenBlockNumber(): Promise<number>;
|
|
174
|
+
/** Forcefully updates the last proven block number. Use for testing. */
|
|
175
|
+
setProvenBlockNumber(blockNumber: number): Promise<void>;
|
|
176
|
+
getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
|
|
177
|
+
getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
|
|
178
|
+
getContract(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
179
|
+
/**
|
|
180
|
+
* Gets L1 to L2 message (to be) included in a given block.
|
|
181
|
+
* @param blockNumber - L2 block number to get messages for.
|
|
182
|
+
* @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
|
|
183
|
+
*/
|
|
184
|
+
getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
|
|
185
|
+
/**
|
|
186
|
+
* Gets the L1 to L2 message index in the L1 to L2 message tree.
|
|
187
|
+
* @param l1ToL2Message - The L1 to L2 message.
|
|
188
|
+
* @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
|
|
189
|
+
*/
|
|
190
|
+
getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
|
|
191
|
+
getContractClassIds(): Promise<Fr[]>;
|
|
192
|
+
addContractClass(contractClass: ContractClassPublic): Promise<void>;
|
|
193
|
+
registerContractFunctionSignatures(address: AztecAddress, signatures: string[]): Promise<void>;
|
|
194
|
+
getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
195
|
+
getL2Tips(): Promise<L2Tips>;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=archiver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAclE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EAEZ,KAAK,aAAa,EAElB,KAAK,MAAM,EACX,KAAK,wBAAwB,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,cAAc,EAKpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,iBAAiB,EAMvB,MAAM,6BAA6B,CAAC;AACrC,OAA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
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import type { InBlock, L2Block } from '@aztec/stdlib/block';
|
|
5
|
+
import type { ContractClassPublic, ContractInstanceUpdateWithAddress, ContractInstanceWithAddress, ExecutablePrivateFunctionWithMembershipProof, UnconstrainedFunctionWithMembershipProof } from '@aztec/stdlib/contract';
|
|
6
|
+
import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
|
|
7
|
+
import type { LogFilter, PrivateLog, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
8
|
+
import type { InboxLeaf } from '@aztec/stdlib/messaging';
|
|
9
|
+
import { BlockHeader, type TxEffect, type TxHash, type TxReceipt } from '@aztec/stdlib/tx';
|
|
10
|
+
import type { DataRetrieval } from './structs/data_retrieval.js';
|
|
11
|
+
import type { L1Published } from './structs/published.js';
|
|
12
|
+
/**
|
|
13
|
+
* Represents the latest L1 block processed by the archiver for various objects in L2.
|
|
14
|
+
*/
|
|
15
|
+
export type ArchiverL1SynchPoint = {
|
|
16
|
+
/** Number of the last L1 block that added a new L2 block metadata. */
|
|
17
|
+
blocksSynchedTo?: bigint;
|
|
18
|
+
/** Number of the last L1 block that added L1 -> L2 messages from the Inbox. */
|
|
19
|
+
messagesSynchedTo?: bigint;
|
|
20
|
+
/** Number of the last L1 block that added a new proven block. */
|
|
21
|
+
provenLogsSynchedTo?: bigint;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Interface describing a data store to be used by the archiver to store all its relevant data
|
|
25
|
+
* (blocks, encrypted logs, aztec contract data extended contract data).
|
|
26
|
+
*/
|
|
27
|
+
export interface ArchiverDataStore {
|
|
28
|
+
/**
|
|
29
|
+
* Append new blocks to the store's list.
|
|
30
|
+
* @param blocks - The L2 blocks to be added to the store and the last processed L1 block.
|
|
31
|
+
* @returns True if the operation is successful.
|
|
32
|
+
*/
|
|
33
|
+
addBlocks(blocks: L1Published<L2Block>[]): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Unwinds blocks from the database
|
|
36
|
+
* @param from - The tip of the chain, passed for verification purposes,
|
|
37
|
+
* ensuring that we don't end up deleting something we did not intend
|
|
38
|
+
* @param blocksToUnwind - The number of blocks we are to unwind
|
|
39
|
+
* @returns True if the operation is successful
|
|
40
|
+
*/
|
|
41
|
+
unwindBlocks(from: number, blocksToUnwind: number): Promise<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Gets up to `limit` amount of L2 blocks starting from `from`.
|
|
44
|
+
* @param from - Number of the first block to return (inclusive).
|
|
45
|
+
* @param limit - The number of blocks to return.
|
|
46
|
+
* @returns The requested L2 blocks.
|
|
47
|
+
*/
|
|
48
|
+
getBlocks(from: number, limit: number): Promise<L1Published<L2Block>[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Gets up to `limit` amount of L2 block headers starting from `from`.
|
|
51
|
+
* @param from - Number of the first block to return (inclusive).
|
|
52
|
+
* @param limit - The number of blocks to return.
|
|
53
|
+
* @returns The requested L2 block headers.
|
|
54
|
+
*/
|
|
55
|
+
getBlockHeaders(from: number, limit: number): Promise<BlockHeader[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Gets a tx effect.
|
|
58
|
+
* @param txHash - The txHash of the tx corresponding to the tx effect.
|
|
59
|
+
* @returns The requested tx effect (or undefined if not found).
|
|
60
|
+
*/
|
|
61
|
+
getTxEffect(txHash: TxHash): Promise<InBlock<TxEffect> | undefined>;
|
|
62
|
+
/**
|
|
63
|
+
* Gets a receipt of a settled tx.
|
|
64
|
+
* @param txHash - The hash of a tx we try to get the receipt for.
|
|
65
|
+
* @returns The requested tx receipt (or undefined if not found).
|
|
66
|
+
*/
|
|
67
|
+
getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
|
|
68
|
+
/**
|
|
69
|
+
* Append new logs to the store's list.
|
|
70
|
+
* @param blocks - The blocks for which to add the logs.
|
|
71
|
+
* @returns True if the operation is successful.
|
|
72
|
+
*/
|
|
73
|
+
addLogs(blocks: L2Block[]): Promise<boolean>;
|
|
74
|
+
deleteLogs(blocks: L2Block[]): Promise<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* Append new nullifiers to the store's list.
|
|
77
|
+
* @param blocks - The blocks for which to add the nullifiers.
|
|
78
|
+
* @returns True if the operation is successful.
|
|
79
|
+
*/
|
|
80
|
+
addNullifiers(blocks: L2Block[]): Promise<boolean>;
|
|
81
|
+
deleteNullifiers(blocks: L2Block[]): Promise<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Returns the provided nullifier indexes scoped to the block
|
|
84
|
+
* they were first included in, or undefined if they're not present in the tree
|
|
85
|
+
* @param blockNumber Max block number to search for the nullifiers
|
|
86
|
+
* @param nullifiers Nullifiers to get
|
|
87
|
+
* @returns The block scoped indexes of the provided nullifiers, or undefined if the nullifier doesn't exist in the tree
|
|
88
|
+
*/
|
|
89
|
+
findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
|
|
90
|
+
/**
|
|
91
|
+
* Append L1 to L2 messages to the store.
|
|
92
|
+
* @param messages - The L1 to L2 messages to be added to the store and the last processed L1 block.
|
|
93
|
+
* @returns True if the operation is successful.
|
|
94
|
+
*/
|
|
95
|
+
addL1ToL2Messages(messages: DataRetrieval<InboxLeaf>): Promise<boolean>;
|
|
96
|
+
/**
|
|
97
|
+
* Gets L1 to L2 message (to be) included in a given block.
|
|
98
|
+
* @param blockNumber - L2 block number to get messages for.
|
|
99
|
+
* @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
|
|
100
|
+
*/
|
|
101
|
+
getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Gets the L1 to L2 message index in the L1 to L2 message tree.
|
|
104
|
+
* @param l1ToL2Message - The L1 to L2 message.
|
|
105
|
+
* @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
|
|
106
|
+
*/
|
|
107
|
+
getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* Get the total number of L1 to L2 messages
|
|
110
|
+
* @returns The number of L1 to L2 messages in the store
|
|
111
|
+
*/
|
|
112
|
+
getTotalL1ToL2MessageCount(): Promise<bigint>;
|
|
113
|
+
/**
|
|
114
|
+
* Retrieves all private logs from up to `limit` blocks, starting from the block number `from`.
|
|
115
|
+
* @param from - The block number from which to begin retrieving logs.
|
|
116
|
+
* @param limit - The maximum number of blocks to retrieve logs from.
|
|
117
|
+
* @returns An array of private logs from the specified range of blocks.
|
|
118
|
+
*/
|
|
119
|
+
getPrivateLogs(from: number, limit: number): Promise<PrivateLog[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
|
|
122
|
+
* @param tags - The tags to filter the logs by.
|
|
123
|
+
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
124
|
+
* that tag.
|
|
125
|
+
*/
|
|
126
|
+
getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
|
|
127
|
+
/**
|
|
128
|
+
* Gets public logs based on the provided filter.
|
|
129
|
+
* @param filter - The filter to apply to the logs.
|
|
130
|
+
* @returns The requested logs.
|
|
131
|
+
*/
|
|
132
|
+
getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Gets contract class logs based on the provided filter.
|
|
135
|
+
* @param filter - The filter to apply to the logs.
|
|
136
|
+
* @returns The requested logs.
|
|
137
|
+
*/
|
|
138
|
+
getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Gets the number of the latest L2 block processed.
|
|
141
|
+
* @returns The number of the latest L2 block processed.
|
|
142
|
+
*/
|
|
143
|
+
getSynchedL2BlockNumber(): Promise<number>;
|
|
144
|
+
/**
|
|
145
|
+
* Gets the number of the latest proven L2 block processed.
|
|
146
|
+
* @returns The number of the latest proven L2 block processed.
|
|
147
|
+
*/
|
|
148
|
+
getProvenL2BlockNumber(): Promise<number>;
|
|
149
|
+
/**
|
|
150
|
+
* Stores the number of the latest proven L2 block processed.
|
|
151
|
+
* @param l2BlockNumber - The number of the latest proven L2 block processed.
|
|
152
|
+
*/
|
|
153
|
+
setProvenL2BlockNumber(l2BlockNumber: number): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Stores the l1 block number that blocks have been synched until
|
|
156
|
+
* @param l1BlockNumber - The l1 block number
|
|
157
|
+
*/
|
|
158
|
+
setBlockSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Stores the l1 block number that messages have been synched until
|
|
161
|
+
* @param l1BlockNumber - The l1 block number
|
|
162
|
+
*/
|
|
163
|
+
setMessageSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Gets the synch point of the archiver
|
|
166
|
+
*/
|
|
167
|
+
getSynchPoint(): Promise<ArchiverL1SynchPoint>;
|
|
168
|
+
/**
|
|
169
|
+
* Add new contract classes from an L2 block to the store's list.
|
|
170
|
+
* @param data - List of contract classes to be added.
|
|
171
|
+
* @param blockNumber - Number of the L2 block the contracts were registered in.
|
|
172
|
+
* @returns True if the operation is successful.
|
|
173
|
+
*/
|
|
174
|
+
addContractClasses(data: ContractClassPublic[], bytecodeCommitments: Fr[], blockNumber: number): Promise<boolean>;
|
|
175
|
+
deleteContractClasses(data: ContractClassPublic[], blockNumber: number): Promise<boolean>;
|
|
176
|
+
getBytecodeCommitment(contractClassId: Fr): Promise<Fr | undefined>;
|
|
177
|
+
/**
|
|
178
|
+
* Returns a contract class given its id, or undefined if not exists.
|
|
179
|
+
* @param id - Id of the contract class.
|
|
180
|
+
*/
|
|
181
|
+
getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
|
|
182
|
+
/**
|
|
183
|
+
* Add new contract instances from an L2 block to the store's list.
|
|
184
|
+
* @param data - List of contract instances to be added.
|
|
185
|
+
* @param blockNumber - Number of the L2 block the instances were deployed in.
|
|
186
|
+
* @returns True if the operation is successful.
|
|
187
|
+
*/
|
|
188
|
+
addContractInstances(data: ContractInstanceWithAddress[], blockNumber: number): Promise<boolean>;
|
|
189
|
+
deleteContractInstances(data: ContractInstanceWithAddress[], blockNumber: number): Promise<boolean>;
|
|
190
|
+
/**
|
|
191
|
+
* Add new contract instance updates
|
|
192
|
+
* @param data - List of contract updates to be added.
|
|
193
|
+
* @param blockNumber - Number of the L2 block the updates were scheduled in.
|
|
194
|
+
* @returns True if the operation is successful.
|
|
195
|
+
*/
|
|
196
|
+
addContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], blockNumber: number): Promise<boolean>;
|
|
197
|
+
deleteContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], blockNumber: number): Promise<boolean>;
|
|
198
|
+
/**
|
|
199
|
+
* Adds private functions to a contract class.
|
|
200
|
+
*/
|
|
201
|
+
addFunctions(contractClassId: Fr, privateFunctions: ExecutablePrivateFunctionWithMembershipProof[], unconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
|
|
202
|
+
/**
|
|
203
|
+
* Returns a contract instance given its address and the given block number, or undefined if not exists.
|
|
204
|
+
* @param address - Address of the contract.
|
|
205
|
+
*/
|
|
206
|
+
getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
207
|
+
/** Returns the list of all class ids known by the archiver. */
|
|
208
|
+
getContractClassIds(): Promise<Fr[]>;
|
|
209
|
+
registerContractFunctionSignatures(address: AztecAddress, signatures: string[]): Promise<void>;
|
|
210
|
+
getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
211
|
+
/**
|
|
212
|
+
* Estimates the size of the store in bytes.
|
|
213
|
+
*/
|
|
214
|
+
estimateSize(): Promise<{
|
|
215
|
+
mappingSize: number;
|
|
216
|
+
actualSize: number;
|
|
217
|
+
numItems: number;
|
|
218
|
+
}>;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=archiver_store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archiver_store.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,iCAAiC,EACjC,2BAA2B,EAC3B,4CAA4C,EAC5C,wCAAwC,EACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3G,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,iBAAiB,CAAC,E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AE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAE7F,+DAA+D;IAC/D,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IAKrC,kCAAkC,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAExG;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '@aztec/stdlib/testing/jest';
|
|
2
|
+
import type { ArchiverDataStore } from './archiver_store.js';
|
|
3
|
+
/**
|
|
4
|
+
* @param testName - The name of the test suite.
|
|
5
|
+
* @param getStore - Returns an instance of a store that's already been initialized.
|
|
6
|
+
*/
|
|
7
|
+
export declare function describeArchiverDataStore(testName: string, getStore: () => ArchiverDataStore | Promise<ArchiverDataStore>): void;
|
|
8
|
+
//# sourceMappingURL=archiver_store_test_suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archiver_store_test_suite.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store_test_suite.ts"],"names":[],"mappings":"AAyBA,OAAO,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AAGnF;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,QAowB/D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type BlobSinkConfig } from '@aztec/blob-sink/client';
|
|
2
|
+
import { type L1ContractAddresses, type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum';
|
|
3
|
+
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
4
|
+
import { type ChainConfig } from '@aztec/stdlib/config';
|
|
5
|
+
/**
|
|
6
|
+
* There are 2 polling intervals used in this configuration. The first is the archiver polling interval, archiverPollingIntervalMS.
|
|
7
|
+
* This is the interval between successive calls to eth_blockNumber via viem.
|
|
8
|
+
* Results of calls to eth_blockNumber are cached by viem with this cache being updated periodically at the interval specified by viemPollingIntervalMS.
|
|
9
|
+
* As a result the maximum observed polling time for new blocks will be viemPollingIntervalMS + archiverPollingIntervalMS.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The archiver configuration.
|
|
13
|
+
*/
|
|
14
|
+
export type ArchiverConfig = {
|
|
15
|
+
/** URL for an archiver service. If set, will return an archiver client as opposed to starting a new one. */
|
|
16
|
+
archiverUrl?: string;
|
|
17
|
+
/** URL for an L1 consensus client */
|
|
18
|
+
l1ConsensusHostUrl?: string;
|
|
19
|
+
/** The polling interval in ms for retrieving new L2 blocks and encrypted logs. */
|
|
20
|
+
archiverPollingIntervalMS?: number;
|
|
21
|
+
/** The number of L2 blocks the archiver will attempt to download at a time. */
|
|
22
|
+
archiverBatchSize?: number;
|
|
23
|
+
/** The polling interval viem uses in ms */
|
|
24
|
+
viemPollingIntervalMS?: number;
|
|
25
|
+
/** The deployed L1 contract addresses */
|
|
26
|
+
l1Contracts: L1ContractAddresses;
|
|
27
|
+
/** The max number of logs that can be obtained in 1 "getPublicLogs" call. */
|
|
28
|
+
maxLogs?: number;
|
|
29
|
+
} & L1ReaderConfig & L1ContractsConfig & BlobSinkConfig & ChainConfig;
|
|
30
|
+
export declare const archiverConfigMappings: ConfigMappingsType<ArchiverConfig>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the archiver configuration from the environment variables.
|
|
33
|
+
* Note: If an environment variable is not set, the default value is used.
|
|
34
|
+
* @returns The archiver configuration.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getArchiverConfigFromEnv(): ArchiverConfig;
|
|
37
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/archiver/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAE7E;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,4GAA4G;IAC5G,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,qCAAqC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,kFAAkF;IAClF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,yCAAyC;IACzC,WAAW,EAAE,mBAAmB,CAAC;IAEjC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,cAAc,GAChB,iBAAiB,GACjB,cAAc,GACd,WAAW,CAAC;AAEd,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,CAmCrE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { ViemPublicClient } from '@aztec/ethereum';
|
|
5
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
7
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
8
|
+
import { type InboxAbi, RollupAbi } from '@aztec/l1-artifacts';
|
|
9
|
+
import { L2Block } from '@aztec/stdlib/block';
|
|
10
|
+
import { InboxLeaf } from '@aztec/stdlib/messaging';
|
|
11
|
+
import { Proof } from '@aztec/stdlib/proofs';
|
|
12
|
+
import { type GetContractEventsReturnType, type GetContractReturnType, type Hex } from 'viem';
|
|
13
|
+
import type { DataRetrieval } from './structs/data_retrieval.js';
|
|
14
|
+
import type { L1Published } from './structs/published.js';
|
|
15
|
+
/**
|
|
16
|
+
* Fetches new L2 blocks.
|
|
17
|
+
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
18
|
+
* @param rollupAddress - The address of the rollup contract.
|
|
19
|
+
* @param searchStartBlock - The block number to use for starting the search.
|
|
20
|
+
* @param searchEndBlock - The highest block number that we should search up to.
|
|
21
|
+
* @param expectedNextL2BlockNum - The next L2 block number that we expect to find.
|
|
22
|
+
* @returns An array of block; as well as the next eth block to search from.
|
|
23
|
+
*/
|
|
24
|
+
export declare function retrieveBlocksFromRollup(rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>, publicClient: ViemPublicClient, blobSinkClient: BlobSinkClientInterface, searchStartBlock: bigint, searchEndBlock: bigint, logger?: Logger): Promise<L1Published<L2Block>[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Processes newly received L2BlockProposed logs.
|
|
27
|
+
* @param rollup - The rollup contract
|
|
28
|
+
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
29
|
+
* @param logs - L2BlockProposed logs.
|
|
30
|
+
* @returns - An array blocks.
|
|
31
|
+
*/
|
|
32
|
+
export declare function processL2BlockProposedLogs(rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>, publicClient: ViemPublicClient, blobSinkClient: BlobSinkClientInterface, logs: GetContractEventsReturnType<typeof RollupAbi, 'L2BlockProposed'>, logger: Logger): Promise<L1Published<L2Block>[]>;
|
|
33
|
+
export declare function getL1BlockTime(publicClient: ViemPublicClient, blockNumber: bigint): Promise<bigint>;
|
|
34
|
+
/**
|
|
35
|
+
* Fetch L1 to L2 messages.
|
|
36
|
+
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
37
|
+
* @param inboxAddress - The address of the inbox contract to fetch messages from.
|
|
38
|
+
* @param blockUntilSynced - If true, blocks until the archiver has fully synced.
|
|
39
|
+
* @param searchStartBlock - The block number to use for starting the search.
|
|
40
|
+
* @param searchEndBlock - The highest block number that we should search up to.
|
|
41
|
+
* @returns An array of InboxLeaf and next eth block to search from.
|
|
42
|
+
*/
|
|
43
|
+
export declare function retrieveL1ToL2Messages(inbox: GetContractReturnType<typeof InboxAbi, ViemPublicClient>, searchStartBlock: bigint, searchEndBlock: bigint): Promise<DataRetrieval<InboxLeaf>>;
|
|
44
|
+
/** Retrieves L2ProofVerified events from the rollup contract. */
|
|
45
|
+
export declare function retrieveL2ProofVerifiedEvents(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<{
|
|
46
|
+
l1BlockNumber: bigint;
|
|
47
|
+
l2BlockNumber: bigint;
|
|
48
|
+
proverId: Fr;
|
|
49
|
+
txHash: Hex;
|
|
50
|
+
}[]>;
|
|
51
|
+
/** Retrieve submitted proofs from the rollup contract */
|
|
52
|
+
export declare function retrieveL2ProofsFromRollup(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<DataRetrieval<{
|
|
53
|
+
proof: Proof;
|
|
54
|
+
proverId: Fr;
|
|
55
|
+
l2BlockNumber: bigint;
|
|
56
|
+
txHash: `0x${string}`;
|
|
57
|
+
}>>;
|
|
58
|
+
export type SubmitBlockProof = {
|
|
59
|
+
archiveRoot: Fr;
|
|
60
|
+
proverId: Fr;
|
|
61
|
+
aggregationObject: Buffer;
|
|
62
|
+
proof: Proof;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Gets block metadata (header and archive snapshot) from the calldata of an L1 transaction.
|
|
66
|
+
* Assumes that the block was published from an EOA.
|
|
67
|
+
* TODO: Add retries and error management.
|
|
68
|
+
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
69
|
+
* @param txHash - Hash of the tx that published it.
|
|
70
|
+
* @param l2BlockNum - L2 block number.
|
|
71
|
+
* @returns L2 block metadata (header and archive) from the calldata, deserialized
|
|
72
|
+
*/
|
|
73
|
+
export declare function getProofFromSubmitProofTx(publicClient: ViemPublicClient, txHash: `0x${string}`, expectedProverId: Fr): Promise<SubmitBlockProof>;
|
|
74
|
+
//# sourceMappingURL=data_retrieval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data_retrieval.d.ts","sourceRoot":"","sources":["../../src/archiver/data_retrieval.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,KAAK,EAA6B,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAgB,KAAK,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAQ,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAI7C,OAAO,EACL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,EAAE,MAAM,EACxB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,EAAE,CAAC,CAexF;AAED,yDAAyD;AACzD,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EAAE,UAAU,EACzB,gBAAgB,EAAE,MAAM,EACxB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,aAAa,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC,CAatG;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,EAAE,CAAC;IAChB,QAAQ,EAAE,EAAE,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,gBAAgB,EAC9B,MAAM,EAAE,KAAK,MAAM,EAAE,EACrB,gBAAgB,EAAE,EAAE,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAuC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/archiver/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,UAAU,EAAE,MAAM;CAG/B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './archiver.js';
|
|
2
|
+
export * from './config.js';
|
|
3
|
+
export { type L1Published, type L1PublishedData } from './structs/published.js';
|
|
4
|
+
export { MemoryArchiverStore } from './memory_archiver_store/memory_archiver_store.js';
|
|
5
|
+
export type { ArchiverDataStore } from './archiver_store.js';
|
|
6
|
+
export { KVArchiverDataStore } from './kv_archiver_store/kv_archiver_store.js';
|
|
7
|
+
export { ContractInstanceStore } from './kv_archiver_store/contract_instance_store.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/archiver/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { L2Block } from '@aztec/stdlib/block';
|
|
2
|
+
import { type LmdbStatsCallback, type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
3
|
+
export declare class ArchiverInstrumentation {
|
|
4
|
+
private telemetry;
|
|
5
|
+
readonly tracer: Tracer;
|
|
6
|
+
private blockHeight;
|
|
7
|
+
private txCount;
|
|
8
|
+
private syncDuration;
|
|
9
|
+
private l1BlocksSynced;
|
|
10
|
+
private l1BlockHeight;
|
|
11
|
+
private proofsSubmittedDelay;
|
|
12
|
+
private proofsSubmittedCount;
|
|
13
|
+
private dbMetrics;
|
|
14
|
+
private pruneCount;
|
|
15
|
+
private log;
|
|
16
|
+
private constructor();
|
|
17
|
+
static new(telemetry: TelemetryClient, lmdbStats?: LmdbStatsCallback): Promise<ArchiverInstrumentation>;
|
|
18
|
+
isEnabled(): boolean;
|
|
19
|
+
processNewBlocks(syncTimePerBlock: number, blocks: L2Block[]): void;
|
|
20
|
+
processPrune(): void;
|
|
21
|
+
updateLastProvenBlock(blockNumber: number): void;
|
|
22
|
+
processProofsVerified(logs: {
|
|
23
|
+
proverId: string;
|
|
24
|
+
l2BlockNumber: bigint;
|
|
25
|
+
delay: bigint;
|
|
26
|
+
}[]): void;
|
|
27
|
+
updateL1BlockHeight(blockNumber: bigint): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/archiver/instrumentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAKL,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACpB,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,uBAAuB;IAed,OAAO,CAAC,SAAS;IAdrC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,YAAY,CAAY;IAChC,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,oBAAoB,CAAY;IACxC,OAAO,CAAC,oBAAoB,CAAgB;IAC5C,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,UAAU,CAAgB;IAElC,OAAO,CAAC,GAAG,CAA4C;IAEvD,OAAO;WAsDa,GAAG,CAAC,SAAS,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,iBAAiB;IAU1E,SAAS,IAAI,OAAO;IAIpB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;IAS5D,YAAY;IAIZ,qBAAqB,CAAC,WAAW,EAAE,MAAM;IAIzC,qBAAqB,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE;IAaxF,mBAAmB,CAAC,WAAW,EAAE,MAAM;CAG/C"}
|