@aztec/txe 3.0.3 → 4.0.0-devnet.1-patch.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/constants.d.ts +3 -0
- package/dest/constants.d.ts.map +1 -0
- package/dest/constants.js +2 -0
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +3 -2
- package/dest/oracle/interfaces.d.ts +6 -4
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.d.ts +4 -4
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +9 -11
- package/dest/oracle/txe_oracle_top_level_context.d.ts +20 -11
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +164 -65
- package/dest/rpc_translator.d.ts +27 -15
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +108 -53
- package/dest/state_machine/archiver.d.ts +20 -55
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +62 -103
- package/dest/state_machine/dummy_p2p_client.d.ts +14 -12
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +29 -21
- package/dest/state_machine/global_variable_builder.d.ts +4 -3
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +13 -1
- package/dest/state_machine/index.d.ts +7 -7
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +40 -23
- package/dest/state_machine/mock_epoch_cache.d.ts +9 -6
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +14 -7
- package/dest/state_machine/synchronizer.d.ts +3 -3
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/txe_session.d.ts +17 -9
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +147 -45
- package/dest/util/encoding.d.ts +617 -18
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/txe_account_store.d.ts +10 -0
- package/dest/util/txe_account_store.d.ts.map +1 -0
- package/dest/util/{txe_account_data_provider.js → txe_account_store.js} +1 -1
- package/dest/util/txe_contract_store.d.ts +12 -0
- package/dest/util/txe_contract_store.d.ts.map +1 -0
- package/dest/util/{txe_contract_data_provider.js → txe_contract_store.js} +3 -3
- package/dest/util/txe_public_contract_data_source.d.ts +4 -4
- package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.js +10 -10
- package/dest/utils/block_creation.d.ts +18 -4
- package/dest/utils/block_creation.d.ts.map +1 -1
- package/dest/utils/block_creation.js +37 -3
- package/dest/utils/tx_effect_creation.d.ts +2 -3
- package/dest/utils/tx_effect_creation.d.ts.map +1 -1
- package/dest/utils/tx_effect_creation.js +3 -6
- package/package.json +16 -16
- package/src/constants.ts +3 -0
- package/src/index.ts +15 -12
- package/src/oracle/interfaces.ts +5 -3
- package/src/oracle/txe_oracle_public_context.ts +9 -16
- package/src/oracle/txe_oracle_top_level_context.ts +196 -105
- package/src/rpc_translator.ts +123 -55
- package/src/state_machine/archiver.ts +58 -126
- package/src/state_machine/dummy_p2p_client.ts +40 -27
- package/src/state_machine/global_variable_builder.ts +19 -2
- package/src/state_machine/index.ts +60 -22
- package/src/state_machine/mock_epoch_cache.ts +15 -11
- package/src/state_machine/synchronizer.ts +2 -2
- package/src/txe_session.ts +197 -87
- package/src/util/{txe_account_data_provider.ts → txe_account_store.ts} +1 -1
- package/src/util/{txe_contract_data_provider.ts → txe_contract_store.ts} +3 -3
- package/src/util/txe_public_contract_data_source.ts +9 -9
- package/src/utils/block_creation.ts +47 -14
- package/src/utils/tx_effect_creation.ts +3 -11
- package/dest/util/txe_account_data_provider.d.ts +0 -10
- package/dest/util/txe_account_data_provider.d.ts.map +0 -1
- package/dest/util/txe_contract_data_provider.d.ts +0 -12
- package/dest/util/txe_contract_data_provider.d.ts.map +0 -1
package/dest/rpc_translator.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Fr, Point } from '@aztec/aztec.js/fields';
|
|
2
2
|
import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX } from '@aztec/constants';
|
|
3
3
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
4
|
-
import {
|
|
5
|
-
import { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
4
|
+
import { packAsHintedNote } from '@aztec/pxe/simulator';
|
|
5
|
+
import { EventSelector, FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
6
6
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import {
|
|
7
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
8
8
|
import { addressFromSingle, arrayOfArraysToBoundedVecOfArrays, arrayToBoundedVec, bufferToU8Array, fromArray, fromSingle, fromUintArray, fromUintBoundedVec, toArray, toForeignCallResult, toSingle } from './util/encoding.js';
|
|
9
|
+
const MAX_EVENT_LEN = 12; // This is MAX_MESSAGE_CONTENT_LEN - PRIVATE_EVENT_RESERVED_FIELDS
|
|
10
|
+
const MAX_PRIVATE_EVENTS_PER_TXE_QUERY = 5;
|
|
9
11
|
export class UnavailableOracleError extends Error {
|
|
10
12
|
constructor(oracleName){
|
|
11
13
|
super(`${oracleName} oracles not available with the current handler`);
|
|
@@ -81,6 +83,12 @@ export class RPCTranslator {
|
|
|
81
83
|
}
|
|
82
84
|
// Other oracles - these get handled by the oracle handler
|
|
83
85
|
// TXE-specific oracles
|
|
86
|
+
txeGetDefaultAddress() {
|
|
87
|
+
const defaultAddress = this.handlerAsTxe().txeGetDefaultAddress();
|
|
88
|
+
return toForeignCallResult([
|
|
89
|
+
toSingle(defaultAddress)
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
84
92
|
async txeGetNextBlockNumber() {
|
|
85
93
|
const nextBlockNumber = await this.handlerAsTxe().txeGetNextBlockNumber();
|
|
86
94
|
return toForeignCallResult([
|
|
@@ -164,6 +172,28 @@ export class RPCTranslator {
|
|
|
164
172
|
...arrayToBoundedVec(toArray(nullifiers), MAX_NULLIFIERS_PER_TX)
|
|
165
173
|
]);
|
|
166
174
|
}
|
|
175
|
+
async txeGetPrivateEvents(foreignSelector, foreignContractAddress, foreignScope) {
|
|
176
|
+
const selector = EventSelector.fromField(fromSingle(foreignSelector));
|
|
177
|
+
const contractAddress = addressFromSingle(foreignContractAddress);
|
|
178
|
+
const scope = addressFromSingle(foreignScope);
|
|
179
|
+
const events = await this.handlerAsTxe().txeGetPrivateEvents(selector, contractAddress, scope);
|
|
180
|
+
if (events.length > MAX_PRIVATE_EVENTS_PER_TXE_QUERY) {
|
|
181
|
+
throw new Error(`Array of length ${events.length} larger than maxLen ${MAX_PRIVATE_EVENTS_PER_TXE_QUERY}`);
|
|
182
|
+
}
|
|
183
|
+
if (events.some((e)=>e.length > MAX_EVENT_LEN)) {
|
|
184
|
+
throw new Error(`Some private event has length larger than maxLen ${MAX_EVENT_LEN}`);
|
|
185
|
+
}
|
|
186
|
+
// This is a workaround as Noir does not currently let us return nested structs with arrays. We instead return a raw
|
|
187
|
+
// multidimensional array in get_private_events_oracle and create the BoundedVecs here.
|
|
188
|
+
const rawArrayStorage = events.map((e)=>e.concat(Array(MAX_EVENT_LEN - e.length).fill(new Fr(0)))).concat(Array(MAX_PRIVATE_EVENTS_PER_TXE_QUERY - events.length).fill(Array(MAX_EVENT_LEN).fill(new Fr(0)))).flat();
|
|
189
|
+
const eventLengths = events.map((e)=>new Fr(e.length)).concat(Array(MAX_PRIVATE_EVENTS_PER_TXE_QUERY - events.length).fill(new Fr(0)));
|
|
190
|
+
const queryLength = new Fr(events.length);
|
|
191
|
+
return toForeignCallResult([
|
|
192
|
+
toArray(rawArrayStorage),
|
|
193
|
+
toArray(eventLengths),
|
|
194
|
+
toSingle(queryLength)
|
|
195
|
+
]);
|
|
196
|
+
}
|
|
167
197
|
privateStoreInExecutionCache(foreignValues, foreignHash) {
|
|
168
198
|
const values = fromArray(foreignValues);
|
|
169
199
|
const hash = fromSingle(foreignHash);
|
|
@@ -179,33 +209,33 @@ export class RPCTranslator {
|
|
|
179
209
|
}
|
|
180
210
|
// When the argument is a slice, noir automatically adds a length field to oracle call.
|
|
181
211
|
// When the argument is an array, we add the field length manually to the signature.
|
|
182
|
-
utilityDebugLog(foreignLevel, foreignMessage, _foreignLength, foreignFields) {
|
|
212
|
+
async utilityDebugLog(foreignLevel, foreignMessage, _foreignLength, foreignFields) {
|
|
183
213
|
const level = fromSingle(foreignLevel).toNumber();
|
|
184
214
|
const message = fromArray(foreignMessage).map((field)=>String.fromCharCode(field.toNumber())).join('');
|
|
185
215
|
const fields = fromArray(foreignFields);
|
|
186
|
-
this.handlerAsMisc().utilityDebugLog(level, message, fields);
|
|
216
|
+
await this.handlerAsMisc().utilityDebugLog(level, message, fields);
|
|
187
217
|
return toForeignCallResult([]);
|
|
188
218
|
}
|
|
189
|
-
async utilityStorageRead(foreignContractAddress, foreignStartStorageSlot,
|
|
219
|
+
async utilityStorageRead(foreignBlockHash, foreignContractAddress, foreignStartStorageSlot, foreignNumberOfElements) {
|
|
220
|
+
const blockHash = new BlockHash(fromSingle(foreignBlockHash));
|
|
190
221
|
const contractAddress = addressFromSingle(foreignContractAddress);
|
|
191
222
|
const startStorageSlot = fromSingle(foreignStartStorageSlot);
|
|
192
|
-
const blockNumber = BlockNumber(fromSingle(foreignBlockNumber).toNumber());
|
|
193
223
|
const numberOfElements = fromSingle(foreignNumberOfElements).toNumber();
|
|
194
|
-
const values = await this.handlerAsUtility().utilityStorageRead(contractAddress, startStorageSlot,
|
|
224
|
+
const values = await this.handlerAsUtility().utilityStorageRead(blockHash, contractAddress, startStorageSlot, numberOfElements);
|
|
195
225
|
return toForeignCallResult([
|
|
196
226
|
toArray(values)
|
|
197
227
|
]);
|
|
198
228
|
}
|
|
199
|
-
async utilityGetPublicDataWitness(
|
|
200
|
-
const
|
|
229
|
+
async utilityGetPublicDataWitness(foreignBlockHash, foreignLeafSlot) {
|
|
230
|
+
const blockHash = new BlockHash(fromSingle(foreignBlockHash));
|
|
201
231
|
const leafSlot = fromSingle(foreignLeafSlot);
|
|
202
|
-
const witness = await this.handlerAsUtility().utilityGetPublicDataWitness(
|
|
232
|
+
const witness = await this.handlerAsUtility().utilityGetPublicDataWitness(blockHash, leafSlot);
|
|
203
233
|
if (!witness) {
|
|
204
|
-
throw new Error(`Public data witness not found for slot ${leafSlot} at block ${
|
|
234
|
+
throw new Error(`Public data witness not found for slot ${leafSlot} at block ${blockHash.toString()}.`);
|
|
205
235
|
}
|
|
206
236
|
return toForeignCallResult(witness.toNoirRepresentation());
|
|
207
237
|
}
|
|
208
|
-
async utilityGetNotes(foreignOwnerIsSome, foreignOwnerValue, foreignStorageSlot, foreignNumSelects, foreignSelectByIndexes, foreignSelectByOffsets, foreignSelectByLengths, foreignSelectValues, foreignSelectComparators, foreignSortByIndexes, foreignSortByOffsets, foreignSortByLengths, foreignSortOrder, foreignLimit, foreignOffset, foreignStatus, foreignMaxNotes,
|
|
238
|
+
async utilityGetNotes(foreignOwnerIsSome, foreignOwnerValue, foreignStorageSlot, foreignNumSelects, foreignSelectByIndexes, foreignSelectByOffsets, foreignSelectByLengths, foreignSelectValues, foreignSelectComparators, foreignSortByIndexes, foreignSortByOffsets, foreignSortByLengths, foreignSortOrder, foreignLimit, foreignOffset, foreignStatus, foreignMaxNotes, foreignPackedHintedNoteLength) {
|
|
209
239
|
// Parse Option<AztecAddress>: ownerIsSome is 0 for None, 1 for Some
|
|
210
240
|
const owner = fromSingle(foreignOwnerIsSome).toBool() ? AztecAddress.fromField(fromSingle(foreignOwnerValue)) : undefined;
|
|
211
241
|
const storageSlot = fromSingle(foreignStorageSlot);
|
|
@@ -223,21 +253,21 @@ export class RPCTranslator {
|
|
|
223
253
|
const offset = fromSingle(foreignOffset).toNumber();
|
|
224
254
|
const status = fromSingle(foreignStatus).toNumber();
|
|
225
255
|
const maxNotes = fromSingle(foreignMaxNotes).toNumber();
|
|
226
|
-
const
|
|
256
|
+
const packedHintedNoteLength = fromSingle(foreignPackedHintedNoteLength).toNumber();
|
|
227
257
|
const noteDatas = await this.handlerAsUtility().utilityGetNotes(owner, storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status);
|
|
228
|
-
const returnDataAsArrayOfArrays = noteDatas.map((noteData)=>
|
|
258
|
+
const returnDataAsArrayOfArrays = noteDatas.map((noteData)=>packAsHintedNote({
|
|
229
259
|
contractAddress: noteData.contractAddress,
|
|
230
260
|
owner: noteData.owner,
|
|
231
261
|
randomness: noteData.randomness,
|
|
232
262
|
storageSlot: noteData.storageSlot,
|
|
233
263
|
noteNonce: noteData.noteNonce,
|
|
234
|
-
|
|
264
|
+
isPending: noteData.isPending,
|
|
235
265
|
note: noteData.note
|
|
236
266
|
}));
|
|
237
267
|
// Now we convert each sub-array to an array of ForeignCallSingles
|
|
238
268
|
const returnDataAsArrayOfForeignCallSingleArrays = returnDataAsArrayOfArrays.map((subArray)=>subArray.map(toSingle));
|
|
239
269
|
// At last we convert the array of arrays to a bounded vec of arrays
|
|
240
|
-
return toForeignCallResult(arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfForeignCallSingleArrays, maxNotes,
|
|
270
|
+
return toForeignCallResult(arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfForeignCallSingleArrays, maxNotes, packedHintedNoteLength));
|
|
241
271
|
}
|
|
242
272
|
privateNotifyCreatedNote(foreignOwner, foreignStorageSlot, foreignRandomness, foreignNoteTypeId, foreignNote, foreignNoteHash, foreignCounter) {
|
|
243
273
|
const owner = addressFromSingle(foreignOwner);
|
|
@@ -262,6 +292,14 @@ export class RPCTranslator {
|
|
|
262
292
|
await this.handlerAsPrivate().privateNotifyCreatedNullifier(innerNullifier);
|
|
263
293
|
return toForeignCallResult([]);
|
|
264
294
|
}
|
|
295
|
+
async privateIsNullifierPending(foreignInnerNullifier, foreignContractAddress) {
|
|
296
|
+
const innerNullifier = fromSingle(foreignInnerNullifier);
|
|
297
|
+
const contractAddress = addressFromSingle(foreignContractAddress);
|
|
298
|
+
const isPending = await this.handlerAsPrivate().privateIsNullifierPending(innerNullifier, contractAddress);
|
|
299
|
+
return toForeignCallResult([
|
|
300
|
+
toSingle(new Fr(isPending))
|
|
301
|
+
]);
|
|
302
|
+
}
|
|
265
303
|
async utilityCheckNullifierExists(foreignInnerNullifier) {
|
|
266
304
|
const innerNullifier = fromSingle(foreignInnerNullifier);
|
|
267
305
|
const exists = await this.handlerAsUtility().utilityCheckNullifierExists(innerNullifier);
|
|
@@ -280,15 +318,27 @@ export class RPCTranslator {
|
|
|
280
318
|
...instance.publicKeys.toFields()
|
|
281
319
|
].map(toSingle));
|
|
282
320
|
}
|
|
283
|
-
async
|
|
321
|
+
async utilityTryGetPublicKeysAndPartialAddress(foreignAddress) {
|
|
284
322
|
const address = addressFromSingle(foreignAddress);
|
|
285
|
-
const
|
|
286
|
-
return
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
323
|
+
const result = await this.handlerAsUtility().utilityTryGetPublicKeysAndPartialAddress(address);
|
|
324
|
+
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
325
|
+
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
326
|
+
if (result === undefined) {
|
|
327
|
+
// No data was found so we set `some` to 0 and pad `value` with zeros get the correct return size.
|
|
328
|
+
return toForeignCallResult([
|
|
329
|
+
toSingle(new Fr(0)),
|
|
330
|
+
toArray(Array(13).fill(new Fr(0)))
|
|
331
|
+
]);
|
|
332
|
+
} else {
|
|
333
|
+
// Data was found so we set `some` to 1 and return it along with `value`.
|
|
334
|
+
return toForeignCallResult([
|
|
335
|
+
toSingle(new Fr(1)),
|
|
336
|
+
toArray([
|
|
337
|
+
...result.publicKeys.toFields(),
|
|
338
|
+
result.partialAddress
|
|
339
|
+
])
|
|
340
|
+
]);
|
|
341
|
+
}
|
|
292
342
|
}
|
|
293
343
|
async utilityGetKeyValidationRequest(foreignPkMHash) {
|
|
294
344
|
const pkMHash = fromSingle(foreignPkMHash);
|
|
@@ -298,12 +348,12 @@ export class RPCTranslator {
|
|
|
298
348
|
privateCallPrivateFunction(_foreignTargetContractAddress, _foreignFunctionSelector, _foreignArgsHash, _foreignSideEffectCounter, _foreignIsStaticCall) {
|
|
299
349
|
throw new Error('Contract calls are forbidden inside a `TestEnvironment::private_context`, use `private_call` instead');
|
|
300
350
|
}
|
|
301
|
-
async utilityGetNullifierMembershipWitness(
|
|
302
|
-
const
|
|
351
|
+
async utilityGetNullifierMembershipWitness(foreignBlockHash, foreignNullifier) {
|
|
352
|
+
const blockHash = new BlockHash(fromSingle(foreignBlockHash));
|
|
303
353
|
const nullifier = fromSingle(foreignNullifier);
|
|
304
|
-
const witness = await this.handlerAsUtility().utilityGetNullifierMembershipWitness(
|
|
354
|
+
const witness = await this.handlerAsUtility().utilityGetNullifierMembershipWitness(blockHash, nullifier);
|
|
305
355
|
if (!witness) {
|
|
306
|
-
throw new Error(`Nullifier membership witness not found at block ${
|
|
356
|
+
throw new Error(`Nullifier membership witness not found at block ${blockHash}.`);
|
|
307
357
|
}
|
|
308
358
|
return toForeignCallResult(witness.toNoirRepresentation());
|
|
309
359
|
}
|
|
@@ -333,8 +383,8 @@ export class RPCTranslator {
|
|
|
333
383
|
toSingle(new Fr(isRevertible))
|
|
334
384
|
]);
|
|
335
385
|
}
|
|
336
|
-
|
|
337
|
-
const context =
|
|
386
|
+
utilityGetUtilityContext() {
|
|
387
|
+
const context = this.handlerAsUtility().utilityGetUtilityContext();
|
|
338
388
|
return toForeignCallResult(context.toNoirRepresentation());
|
|
339
389
|
}
|
|
340
390
|
async utilityGetBlockHeader(foreignBlockNumber) {
|
|
@@ -345,25 +395,30 @@ export class RPCTranslator {
|
|
|
345
395
|
}
|
|
346
396
|
return toForeignCallResult(header.toFields().map(toSingle));
|
|
347
397
|
}
|
|
348
|
-
async
|
|
349
|
-
const
|
|
350
|
-
const
|
|
351
|
-
const
|
|
352
|
-
const witness = await this.handlerAsUtility().utilityGetMembershipWitness(blockNumber, treeId, leafValue);
|
|
398
|
+
async utilityGetNoteHashMembershipWitness(foreignAnchorBlockHash, foreignNoteHash) {
|
|
399
|
+
const blockHash = new BlockHash(fromSingle(foreignAnchorBlockHash));
|
|
400
|
+
const noteHash = fromSingle(foreignNoteHash);
|
|
401
|
+
const witness = await this.handlerAsUtility().utilityGetNoteHashMembershipWitness(blockHash, noteHash);
|
|
353
402
|
if (!witness) {
|
|
354
|
-
throw new Error(`
|
|
403
|
+
throw new Error(`Note hash ${noteHash} not found in the note hash tree at block ${blockHash.toString()}.`);
|
|
355
404
|
}
|
|
356
|
-
return toForeignCallResult(
|
|
357
|
-
toSingle(witness[0]),
|
|
358
|
-
toArray(witness.slice(1))
|
|
359
|
-
]);
|
|
405
|
+
return toForeignCallResult(witness.toNoirRepresentation());
|
|
360
406
|
}
|
|
361
|
-
async
|
|
362
|
-
const
|
|
407
|
+
async utilityGetBlockHashMembershipWitness(foreignAnchorBlockHash, foreignBlockHash) {
|
|
408
|
+
const anchorBlockHash = new BlockHash(fromSingle(foreignAnchorBlockHash));
|
|
409
|
+
const blockHash = new BlockHash(fromSingle(foreignBlockHash));
|
|
410
|
+
const witness = await this.handlerAsUtility().utilityGetBlockHashMembershipWitness(anchorBlockHash, blockHash);
|
|
411
|
+
if (!witness) {
|
|
412
|
+
throw new Error(`Block hash ${blockHash.toString()} not found in the archive tree at anchor block ${anchorBlockHash.toString()}.`);
|
|
413
|
+
}
|
|
414
|
+
return toForeignCallResult(witness.toNoirRepresentation());
|
|
415
|
+
}
|
|
416
|
+
async utilityGetLowNullifierMembershipWitness(foreignBlockHash, foreignNullifier) {
|
|
417
|
+
const blockHash = new BlockHash(fromSingle(foreignBlockHash));
|
|
363
418
|
const nullifier = fromSingle(foreignNullifier);
|
|
364
|
-
const witness = await this.handlerAsUtility().utilityGetLowNullifierMembershipWitness(
|
|
419
|
+
const witness = await this.handlerAsUtility().utilityGetLowNullifierMembershipWitness(blockHash, nullifier);
|
|
365
420
|
if (!witness) {
|
|
366
|
-
throw new Error(`Low nullifier witness not found for nullifier ${nullifier} at block ${
|
|
421
|
+
throw new Error(`Low nullifier witness not found for nullifier ${nullifier} at block ${blockHash}.`);
|
|
367
422
|
}
|
|
368
423
|
return toForeignCallResult(witness.toNoirRepresentation());
|
|
369
424
|
}
|
|
@@ -372,11 +427,11 @@ export class RPCTranslator {
|
|
|
372
427
|
await this.handlerAsUtility().utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot);
|
|
373
428
|
return toForeignCallResult([]);
|
|
374
429
|
}
|
|
375
|
-
async
|
|
430
|
+
async utilityValidateAndStoreEnqueuedNotesAndEvents(foreignContractAddress, foreignNoteValidationRequestsArrayBaseSlot, foreignEventValidationRequestsArrayBaseSlot) {
|
|
376
431
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
377
432
|
const noteValidationRequestsArrayBaseSlot = fromSingle(foreignNoteValidationRequestsArrayBaseSlot);
|
|
378
433
|
const eventValidationRequestsArrayBaseSlot = fromSingle(foreignEventValidationRequestsArrayBaseSlot);
|
|
379
|
-
await this.handlerAsUtility().
|
|
434
|
+
await this.handlerAsUtility().utilityValidateAndStoreEnqueuedNotesAndEvents(contractAddress, noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot);
|
|
380
435
|
return toForeignCallResult([]);
|
|
381
436
|
}
|
|
382
437
|
async utilityBulkRetrieveLogs(foreignContractAddress, foreignLogRetrievalRequestsArrayBaseSlot, foreignLogRetrievalResponsesArrayBaseSlot) {
|
|
@@ -457,9 +512,10 @@ export class RPCTranslator {
|
|
|
457
512
|
// TODO(#8811): Implement
|
|
458
513
|
return toForeignCallResult([]);
|
|
459
514
|
}
|
|
460
|
-
async avmOpcodeStorageRead(foreignSlot) {
|
|
515
|
+
async avmOpcodeStorageRead(foreignSlot, foreignContractAddress) {
|
|
461
516
|
const slot = fromSingle(foreignSlot);
|
|
462
|
-
const
|
|
517
|
+
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
518
|
+
const value = (await this.handlerAsAvm().avmOpcodeStorageRead(slot, contractAddress)).value;
|
|
463
519
|
return toForeignCallResult([
|
|
464
520
|
toSingle(new Fr(value))
|
|
465
521
|
]);
|
|
@@ -513,10 +569,9 @@ export class RPCTranslator {
|
|
|
513
569
|
await this.handlerAsAvm().avmOpcodeEmitNoteHash(noteHash);
|
|
514
570
|
return toForeignCallResult([]);
|
|
515
571
|
}
|
|
516
|
-
async avmOpcodeNullifierExists(
|
|
517
|
-
const
|
|
518
|
-
const
|
|
519
|
-
const exists = await this.handlerAsAvm().avmOpcodeNullifierExists(innerNullifier, targetAddress);
|
|
572
|
+
async avmOpcodeNullifierExists(foreignSiloedNullifier) {
|
|
573
|
+
const siloedNullifier = fromSingle(foreignSiloedNullifier);
|
|
574
|
+
const exists = await this.handlerAsAvm().avmOpcodeNullifierExists(siloedNullifier);
|
|
520
575
|
return toForeignCallResult([
|
|
521
576
|
toSingle(new Fr(exists))
|
|
522
577
|
]);
|
|
@@ -1,66 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ArchiverDataSourceBase } from '@aztec/archiver';
|
|
2
|
+
import { type EpochNumber, type SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
5
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type { Checkpoint, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
9
|
-
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
|
+
import type { L2Tips, ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
7
|
+
import type { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
10
8
|
import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/**
|
|
10
|
+
* TXE Archiver implementation.
|
|
11
|
+
* Provides most of the endpoints needed by the node for reading from and writing to state,
|
|
12
|
+
* without needing any of the extra overhead that the Archiver itself requires (i.e. an L1 client).
|
|
13
|
+
*/
|
|
14
|
+
export declare class TXEArchiver extends ArchiverDataSourceBase {
|
|
15
|
+
private readonly updater;
|
|
14
16
|
constructor(db: AztecAsyncKVStore);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @returns The number of the latest L2 block processed by the block source implementation.
|
|
19
|
-
*/
|
|
20
|
-
getBlockNumber(): Promise<BlockNumber>;
|
|
21
|
-
/**
|
|
22
|
-
* Gets the number of the latest L2 block proven seen by the block source implementation.
|
|
23
|
-
* @returns The number of the latest L2 block proven seen by the block source implementation.
|
|
24
|
-
*/
|
|
25
|
-
getProvenBlockNumber(): Promise<BlockNumber>;
|
|
26
|
-
/**
|
|
27
|
-
* Gets a published l2 block. If a negative number is passed, the block returned is the most recent.
|
|
28
|
-
* @param number - The block number to return (inclusive).
|
|
29
|
-
* @returns The requested L2 block.
|
|
30
|
-
*/
|
|
31
|
-
getPublishedBlock(number: number): Promise<PublishedL2Block | undefined>;
|
|
32
|
-
/**
|
|
33
|
-
* Gets an l2 block. If a negative number is passed, the block returned is the most recent.
|
|
34
|
-
* @param number - The block number to return (inclusive).
|
|
35
|
-
* @returns The requested L2 block.
|
|
36
|
-
*/
|
|
37
|
-
getBlock(number: number | 'latest'): Promise<L2Block | undefined>;
|
|
38
|
-
/**
|
|
39
|
-
* Gets an l2 block header.
|
|
40
|
-
* @param number - The block number to return or 'latest' for the most recent one.
|
|
41
|
-
* @returns The requested L2 block header.
|
|
42
|
-
*/
|
|
43
|
-
getBlockHeader(number: number | 'latest'): Promise<BlockHeader | undefined>;
|
|
44
|
-
getBlocks(from: number, limit: number, _proven?: boolean): Promise<L2Block[]>;
|
|
45
|
-
getPublishedCheckpoints(_from: CheckpointNumber, _limit: number): Promise<PublishedCheckpoint[]>;
|
|
46
|
-
getCheckpointByArchive(_archive: Fr): Promise<Checkpoint | undefined>;
|
|
47
|
-
getL2SlotNumber(): Promise<SlotNumber | undefined>;
|
|
48
|
-
getL2EpochNumber(): Promise<EpochNumber>;
|
|
49
|
-
getCheckpointsForEpoch(_epochNumber: EpochNumber): Promise<Checkpoint[]>;
|
|
50
|
-
getBlocksForEpoch(_epochNumber: EpochNumber): Promise<L2Block[]>;
|
|
51
|
-
getBlockHeadersForEpoch(_epochNumber: EpochNumber): Promise<BlockHeader[]>;
|
|
52
|
-
isEpochComplete(_epochNumber: EpochNumber): Promise<boolean>;
|
|
53
|
-
getL2Tips(): Promise<L2Tips>;
|
|
17
|
+
addCheckpoints(checkpoints: PublishedCheckpoint[], result?: ValidateCheckpointResult): Promise<void>;
|
|
18
|
+
getRollupAddress(): Promise<EthAddress>;
|
|
19
|
+
getRegistryAddress(): Promise<EthAddress>;
|
|
54
20
|
getL1Constants(): Promise<L1RollupConstants>;
|
|
55
21
|
getGenesisValues(): Promise<{
|
|
56
22
|
genesisArchiveRoot: Fr;
|
|
57
23
|
}>;
|
|
24
|
+
getL1Timestamp(): Promise<bigint | undefined>;
|
|
25
|
+
getL2Tips(): Promise<L2Tips>;
|
|
26
|
+
getL2SlotNumber(): Promise<SlotNumber | undefined>;
|
|
27
|
+
getL2EpochNumber(): Promise<EpochNumber | undefined>;
|
|
28
|
+
isEpochComplete(_epochNumber: EpochNumber): Promise<boolean>;
|
|
58
29
|
syncImmediate(): Promise<void>;
|
|
59
|
-
getContract(_address: AztecAddress, _timestamp?: UInt64): Promise<ContractInstanceWithAddress | undefined>;
|
|
60
|
-
getRollupAddress(): Promise<EthAddress>;
|
|
61
|
-
getRegistryAddress(): Promise<EthAddress>;
|
|
62
|
-
getL1Timestamp(): Promise<bigint>;
|
|
63
|
-
isPendingChainInvalid(): Promise<boolean>;
|
|
64
|
-
getPendingChainValidationStatus(): Promise<ValidateBlockResult>;
|
|
65
30
|
}
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJjaGl2ZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdGF0ZV9tYWNoaW5lL2FyY2hpdmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxzQkFBc0IsRUFBaUQsTUFBTSxpQkFBaUIsQ0FBQztBQUV4RyxPQUFPLEVBQW9CLEtBQUssV0FBVyxFQUFFLEtBQUssVUFBVSxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDdEcsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQW9DLE1BQU0sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzlHLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDcEUsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUVyRTs7OztHQUlHO0FBQ0gscUJBQWEsV0FBWSxTQUFRLHNCQUFzQjtJQUNyRCxPQUFPLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBNEM7SUFFcEUsWUFBWSxFQUFFLEVBQUUsaUJBQWlCLEVBR2hDO0lBRVksY0FBYyxDQUFDLFdBQVcsRUFBRSxtQkFBbUIsRUFBRSxFQUFFLE1BQU0sQ0FBQyxFQUFFLHdCQUF3QixHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFaEg7SUFFTSxnQkFBZ0IsSUFBSSxPQUFPLENBQUMsVUFBVSxDQUFDLENBRTdDO0lBRU0sa0JBQWtCLElBQUksT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUUvQztJQUVNLGNBQWMsSUFBSSxPQUFPLENBQUMsaUJBQWlCLENBQUMsQ0FFbEQ7SUFFTSxnQkFBZ0IsSUFBSSxPQUFPLENBQUM7UUFBRSxrQkFBa0IsRUFBRSxFQUFFLENBQUE7S0FBRSxDQUFDLENBRTdEO0lBRU0sY0FBYyxJQUFJLE9BQU8sQ0FBQyxNQUFNLEdBQUcsU0FBUyxDQUFDLENBRW5EO0lBRVksU0FBUyxJQUFJLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FnQ3hDO0lBRU0sZUFBZSxJQUFJLE9BQU8sQ0FBQyxVQUFVLEdBQUcsU0FBUyxDQUFDLENBRXhEO0lBRU0sZ0JBQWdCLElBQUksT0FBTyxDQUFDLFdBQVcsR0FBRyxTQUFTLENBQUMsQ0FFMUQ7SUFFTSxlQUFlLENBQUMsWUFBWSxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLENBRWxFO0lBRU0sYUFBYSxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFcEM7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/state_machine/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/state_machine/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAiD,MAAM,iBAAiB,CAAC;AAExG,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACtG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAoC,MAAM,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC9G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,sBAAsB;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4C;IAEpE,YAAY,EAAE,EAAE,iBAAiB,EAGhC;IAEY,cAAc,CAAC,WAAW,EAAE,mBAAmB,EAAE,EAAE,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhH;IAEM,gBAAgB,IAAI,OAAO,CAAC,UAAU,CAAC,CAE7C;IAEM,kBAAkB,IAAI,OAAO,CAAC,UAAU,CAAC,CAE/C;IAEM,cAAc,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAElD;IAEM,gBAAgB,IAAI,OAAO,CAAC;QAAE,kBAAkB,EAAE,EAAE,CAAA;KAAE,CAAC,CAE7D;IAEM,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEnD;IAEY,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAgCxC;IAEM,eAAe,IAAI,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAExD;IAEM,gBAAgB,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAE1D;IAEM,eAAe,CAAC,YAAY,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAElE;IAEM,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpC;CACF"}
|
|
@@ -1,77 +1,76 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArchiverDataSourceBase, ArchiverDataStoreUpdater, KVArchiverDataStore } from '@aztec/archiver';
|
|
2
2
|
import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants';
|
|
3
|
-
import {
|
|
3
|
+
import { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* TXE Archiver implementation.
|
|
7
|
+
* Provides most of the endpoints needed by the node for reading from and writing to state,
|
|
8
|
+
* without needing any of the extra overhead that the Archiver itself requires (i.e. an L1 client).
|
|
9
|
+
*/ export class TXEArchiver extends ArchiverDataSourceBase {
|
|
10
|
+
updater = new ArchiverDataStoreUpdater(this.store);
|
|
9
11
|
constructor(db){
|
|
10
|
-
|
|
12
|
+
const store = new KVArchiverDataStore(db, 9999, {
|
|
13
|
+
epochDuration: 32
|
|
14
|
+
});
|
|
15
|
+
super(store);
|
|
11
16
|
}
|
|
12
|
-
async
|
|
13
|
-
|
|
14
|
-
this.store.addLogs(blocks.map((block)=>block.block)),
|
|
15
|
-
this.store.addBlocks(blocks)
|
|
16
|
-
]);
|
|
17
|
-
return opResults.every(Boolean);
|
|
17
|
+
async addCheckpoints(checkpoints, result) {
|
|
18
|
+
await this.updater.addCheckpoints(checkpoints, result);
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* @returns The number of the latest L2 block processed by the block source implementation.
|
|
22
|
-
*/ getBlockNumber() {
|
|
23
|
-
return this.store.getSynchedL2BlockNumber();
|
|
20
|
+
getRollupAddress() {
|
|
21
|
+
throw new Error('TXE Archiver does not implement "getRollupAddress"');
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* @returns The number of the latest L2 block proven seen by the block source implementation.
|
|
28
|
-
*/ getProvenBlockNumber() {
|
|
29
|
-
return this.store.getSynchedL2BlockNumber();
|
|
23
|
+
getRegistryAddress() {
|
|
24
|
+
throw new Error('TXE Archiver does not implement "getRegistryAddress"');
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
number = await this.store.getSynchedL2BlockNumber();
|
|
39
|
-
}
|
|
40
|
-
if (number == 0) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
const blocks = await this.store.getPublishedBlocks(BlockNumber(number), 1);
|
|
44
|
-
return blocks.length === 0 ? undefined : blocks[0];
|
|
26
|
+
getL1Constants() {
|
|
27
|
+
throw new Error('TXE Archiver does not implement "getL1Constants"');
|
|
28
|
+
}
|
|
29
|
+
getGenesisValues() {
|
|
30
|
+
return Promise.resolve({
|
|
31
|
+
genesisArchiveRoot: new Fr(GENESIS_ARCHIVE_ROOT)
|
|
32
|
+
});
|
|
45
33
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* @param number - The block number to return (inclusive).
|
|
49
|
-
* @returns The requested L2 block.
|
|
50
|
-
*/ getBlock(number) {
|
|
51
|
-
return this.getPublishedBlock(number != 'latest' ? number : -1).then((block)=>block?.block);
|
|
34
|
+
getL1Timestamp() {
|
|
35
|
+
throw new Error('TXE Archiver does not implement "getL1Timestamp"');
|
|
52
36
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
number = await this.store.getSynchedL2BlockNumber();
|
|
37
|
+
async getL2Tips() {
|
|
38
|
+
// In TXE there is no possibility of reorgs and no blocks are ever getting proven so we just set 'latest', 'proven'
|
|
39
|
+
// and 'finalized' to the latest block.
|
|
40
|
+
const blockHeader = await this.getBlockHeader('latest');
|
|
41
|
+
if (!blockHeader) {
|
|
42
|
+
throw new Error('L2Tips requested from TXE Archiver but no block header found');
|
|
60
43
|
}
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
const number = blockHeader.globalVariables.blockNumber;
|
|
45
|
+
const hash = (await blockHeader.hash()).toString();
|
|
46
|
+
const checkpointedBlock = await this.getCheckpointedBlock(number);
|
|
47
|
+
if (!checkpointedBlock) {
|
|
48
|
+
throw new Error(`L2Tips requested from TXE Archiver but no checkpointed block found for block number ${number}`);
|
|
63
49
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
50
|
+
// TXE uses 1-block-per-checkpoint for testing simplicity, so we can use block number as checkpoint number.
|
|
51
|
+
// This uses the deprecated fromBlockNumber method intentionally for the TXE testing environment.
|
|
52
|
+
const checkpoint = await this.store.getRangeOfCheckpoints(CheckpointNumber.fromBlockNumber(number), 1);
|
|
53
|
+
if (checkpoint.length === 0) {
|
|
54
|
+
throw new Error(`L2Tips requested from TXE Archiver but no checkpoint found for block number ${number}`);
|
|
55
|
+
}
|
|
56
|
+
const blockId = {
|
|
57
|
+
number,
|
|
58
|
+
hash
|
|
59
|
+
};
|
|
60
|
+
const checkpointId = {
|
|
61
|
+
number: checkpoint[0].checkpointNumber,
|
|
62
|
+
hash: checkpoint[0].header.hash().toString()
|
|
63
|
+
};
|
|
64
|
+
const tipId = {
|
|
65
|
+
block: blockId,
|
|
66
|
+
checkpoint: checkpointId
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
proposed: blockId,
|
|
70
|
+
proven: tipId,
|
|
71
|
+
finalized: tipId,
|
|
72
|
+
checkpointed: tipId
|
|
73
|
+
};
|
|
75
74
|
}
|
|
76
75
|
getL2SlotNumber() {
|
|
77
76
|
throw new Error('TXE Archiver does not implement "getL2SlotNumber"');
|
|
@@ -79,50 +78,10 @@ export class TXEArchiver extends ArchiverStoreHelper {
|
|
|
79
78
|
getL2EpochNumber() {
|
|
80
79
|
throw new Error('TXE Archiver does not implement "getL2EpochNumber"');
|
|
81
80
|
}
|
|
82
|
-
getCheckpointsForEpoch(_epochNumber) {
|
|
83
|
-
throw new Error('TXE Archiver does not implement "getCheckpointsForEpoch"');
|
|
84
|
-
}
|
|
85
|
-
getBlocksForEpoch(_epochNumber) {
|
|
86
|
-
throw new Error('TXE Archiver does not implement "getBlocksForEpoch"');
|
|
87
|
-
}
|
|
88
|
-
getBlockHeadersForEpoch(_epochNumber) {
|
|
89
|
-
throw new Error('TXE Archiver does not implement "getBlockHeadersForEpoch"');
|
|
90
|
-
}
|
|
91
81
|
isEpochComplete(_epochNumber) {
|
|
92
82
|
throw new Error('TXE Archiver does not implement "isEpochComplete"');
|
|
93
83
|
}
|
|
94
|
-
getL2Tips() {
|
|
95
|
-
throw new Error('TXE Archiver does not implement "getL2Tips"');
|
|
96
|
-
}
|
|
97
|
-
getL1Constants() {
|
|
98
|
-
throw new Error('TXE Archiver does not implement "getL2Constants"');
|
|
99
|
-
}
|
|
100
|
-
getGenesisValues() {
|
|
101
|
-
return Promise.resolve({
|
|
102
|
-
genesisArchiveRoot: new Fr(GENESIS_ARCHIVE_ROOT)
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
84
|
syncImmediate() {
|
|
106
85
|
throw new Error('TXE Archiver does not implement "syncImmediate"');
|
|
107
86
|
}
|
|
108
|
-
getContract(_address, _timestamp) {
|
|
109
|
-
throw new Error('TXE Archiver does not implement "getContract"');
|
|
110
|
-
}
|
|
111
|
-
getRollupAddress() {
|
|
112
|
-
throw new Error('TXE Archiver does not implement "getRollupAddress"');
|
|
113
|
-
}
|
|
114
|
-
getRegistryAddress() {
|
|
115
|
-
throw new Error('TXE Archiver does not implement "getRegistryAddress"');
|
|
116
|
-
}
|
|
117
|
-
getL1Timestamp() {
|
|
118
|
-
throw new Error('TXE Archiver does not implement "getL1Timestamp"');
|
|
119
|
-
}
|
|
120
|
-
isPendingChainInvalid() {
|
|
121
|
-
return Promise.resolve(false);
|
|
122
|
-
}
|
|
123
|
-
getPendingChainValidationStatus() {
|
|
124
|
-
return Promise.resolve({
|
|
125
|
-
valid: true
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
87
|
}
|