@aztec/txe 0.0.1-commit.f295ac2 → 0.0.1-commit.f8ca9b2f3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dest/oracle/interfaces.d.ts +3 -3
  2. package/dest/oracle/interfaces.d.ts.map +1 -1
  3. package/dest/oracle/txe_oracle_public_context.d.ts +5 -5
  4. package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
  5. package/dest/oracle/txe_oracle_public_context.js +6 -6
  6. package/dest/oracle/txe_oracle_top_level_context.d.ts +2 -2
  7. package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
  8. package/dest/oracle/txe_oracle_top_level_context.js +83 -21
  9. package/dest/rpc_translator.d.ts +15 -9
  10. package/dest/rpc_translator.d.ts.map +1 -1
  11. package/dest/rpc_translator.js +63 -39
  12. package/dest/state_machine/archiver.d.ts +2 -2
  13. package/dest/state_machine/archiver.d.ts.map +1 -1
  14. package/dest/state_machine/archiver.js +7 -6
  15. package/dest/state_machine/dummy_p2p_client.d.ts +9 -8
  16. package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
  17. package/dest/state_machine/dummy_p2p_client.js +15 -12
  18. package/dest/state_machine/index.d.ts +7 -7
  19. package/dest/state_machine/index.d.ts.map +1 -1
  20. package/dest/state_machine/index.js +30 -16
  21. package/dest/state_machine/mock_epoch_cache.d.ts +8 -6
  22. package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
  23. package/dest/state_machine/mock_epoch_cache.js +9 -6
  24. package/dest/state_machine/synchronizer.d.ts +3 -3
  25. package/dest/state_machine/synchronizer.d.ts.map +1 -1
  26. package/dest/txe_session.d.ts +1 -1
  27. package/dest/txe_session.d.ts.map +1 -1
  28. package/dest/txe_session.js +67 -10
  29. package/dest/utils/block_creation.d.ts +5 -5
  30. package/dest/utils/block_creation.d.ts.map +1 -1
  31. package/dest/utils/block_creation.js +7 -5
  32. package/package.json +15 -15
  33. package/src/oracle/interfaces.ts +2 -2
  34. package/src/oracle/txe_oracle_public_context.ts +8 -10
  35. package/src/oracle/txe_oracle_top_level_context.ts +100 -70
  36. package/src/rpc_translator.ts +65 -37
  37. package/src/state_machine/archiver.ts +6 -8
  38. package/src/state_machine/dummy_p2p_client.ts +21 -15
  39. package/src/state_machine/index.ts +48 -19
  40. package/src/state_machine/mock_epoch_cache.ts +10 -11
  41. package/src/state_machine/synchronizer.ts +2 -2
  42. package/src/txe_session.ts +72 -65
  43. package/src/utils/block_creation.ts +8 -6
@@ -1,11 +1,13 @@
1
1
  import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
2
2
  import { TestCircuitVerifier } from '@aztec/bb-prover/test';
3
+ import { CheckpointNumber } from '@aztec/foundation/branded-types';
4
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
5
  import { createLogger } from '@aztec/foundation/log';
4
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
5
- import { AnchorBlockStore } from '@aztec/pxe/server';
6
- import { L2BlockNew } from '@aztec/stdlib/block';
6
+ import { type AnchorBlockStore, type ContractStore, ContractSyncService, type NoteStore } from '@aztec/pxe/server';
7
+ import { L2Block } from '@aztec/stdlib/block';
7
8
  import { Checkpoint, L1PublishedData, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
8
9
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
10
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
9
11
  import { getPackageVersion } from '@aztec/stdlib/update-checker';
10
12
 
11
13
  import { TXEArchiver } from './archiver.js';
@@ -23,13 +25,16 @@ export class TXEStateMachine {
23
25
  public synchronizer: TXESynchronizer,
24
26
  public archiver: TXEArchiver,
25
27
  public anchorBlockStore: AnchorBlockStore,
28
+ public contractSyncService: ContractSyncService,
26
29
  ) {}
27
30
 
28
- public static async create(db: AztecAsyncKVStore) {
29
- const archiver = new TXEArchiver(db);
31
+ public static async create(
32
+ archiver: TXEArchiver,
33
+ anchorBlockStore: AnchorBlockStore,
34
+ contractStore: ContractStore,
35
+ noteStore: NoteStore,
36
+ ) {
30
37
  const synchronizer = await TXESynchronizer.create();
31
- const anchorBlockStore = new AnchorBlockStore(db);
32
-
33
38
  const aztecNodeConfig = {} as AztecNodeConfig;
34
39
 
35
40
  const log = createLogger('txe_node');
@@ -55,18 +60,39 @@ export class TXEStateMachine {
55
60
  log,
56
61
  );
57
62
 
58
- return new this(node, synchronizer, archiver, anchorBlockStore);
63
+ const contractSyncService = new ContractSyncService(
64
+ node,
65
+ contractStore,
66
+ noteStore,
67
+ createLogger('txe:contract_sync'),
68
+ );
69
+
70
+ return new this(node, synchronizer, archiver, anchorBlockStore, contractSyncService);
59
71
  }
60
72
 
61
- public async handleL2Block(block: L2BlockNew) {
62
- // Create a checkpoint from the block - L2BlockNew doesn't have toCheckpoint() method
63
- // We need to construct the Checkpoint manually
64
- const checkpoint = await Checkpoint.random(block.checkpointNumber, {
65
- numBlocks: 1,
66
- startBlockNumber: Number(block.number),
67
- });
68
- // Replace the random block with our actual block
69
- checkpoint.blocks = [block];
73
+ public async handleL2Block(block: L2Block) {
74
+ // Create a checkpoint from the block manually.
75
+ // TXE uses 1-block-per-checkpoint for testing simplicity, so we can use block number as checkpoint number.
76
+ // This uses the deprecated fromBlockNumber method intentionally for the TXE testing environment.
77
+ const checkpointNumber = CheckpointNumber.fromBlockNumber(block.number);
78
+ const checkpoint = new Checkpoint(
79
+ block.archive,
80
+ CheckpointHeader.from({
81
+ lastArchiveRoot: block.header.lastArchive.root,
82
+ inHash: Fr.ZERO,
83
+ blobsHash: Fr.ZERO,
84
+ blockHeadersHash: Fr.ZERO,
85
+ epochOutHash: Fr.ZERO,
86
+ slotNumber: block.header.globalVariables.slotNumber,
87
+ timestamp: block.header.globalVariables.timestamp,
88
+ coinbase: block.header.globalVariables.coinbase,
89
+ feeRecipient: block.header.globalVariables.feeRecipient,
90
+ gasFees: block.header.globalVariables.gasFees,
91
+ totalManaUsed: block.header.totalManaUsed,
92
+ }),
93
+ [block],
94
+ checkpointNumber,
95
+ );
70
96
 
71
97
  const publishedCheckpoint = new PublishedCheckpoint(
72
98
  checkpoint,
@@ -77,10 +103,13 @@ export class TXEStateMachine {
77
103
  ),
78
104
  [],
79
105
  );
106
+ // Wipe contract sync cache when anchor block changes (mirrors BlockSynchronizer behavior)
107
+ this.contractSyncService.wipe();
108
+
80
109
  await Promise.all([
81
- this.synchronizer.handleL2Block(block), // L2BlockNew doesn't need toL2Block() conversion
110
+ this.synchronizer.handleL2Block(block),
82
111
  this.archiver.addCheckpoints([publishedCheckpoint], undefined),
83
- this.anchorBlockStore.setHeader(block.header), // Use .header property directly
112
+ this.anchorBlockStore.setHeader(block.header),
84
113
  ]);
85
114
  }
86
115
  }
@@ -1,6 +1,7 @@
1
1
  import type { EpochAndSlot, EpochCacheInterface, EpochCommitteeInfo, SlotTag } from '@aztec/epoch-cache';
2
2
  import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
+ import { EmptyL1RollupConstants, type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
4
5
 
5
6
  /**
6
7
  * Mock implementation of the EpochCacheInterface used to satisfy dependencies of AztecNodeService.
@@ -16,11 +17,12 @@ export class MockEpochCache implements EpochCacheInterface {
16
17
  });
17
18
  }
18
19
 
19
- getEpochAndSlotNow(): EpochAndSlot {
20
+ getEpochAndSlotNow(): EpochAndSlot & { nowMs: bigint } {
20
21
  return {
21
22
  epoch: EpochNumber.ZERO,
22
23
  slot: SlotNumber(0),
23
24
  ts: 0n,
25
+ nowMs: 0n,
24
26
  };
25
27
  }
26
28
 
@@ -41,18 +43,11 @@ export class MockEpochCache implements EpochCacheInterface {
41
43
  return 0n;
42
44
  }
43
45
 
44
- getProposerAttesterAddressInCurrentOrNextSlot(): Promise<{
45
- currentProposer: EthAddress | undefined;
46
- nextProposer: EthAddress | undefined;
47
- currentSlot: SlotNumber;
48
- nextSlot: SlotNumber;
49
- }> {
50
- return Promise.resolve({
51
- currentProposer: undefined,
52
- nextProposer: undefined,
46
+ getCurrentAndNextSlot(): { currentSlot: SlotNumber; nextSlot: SlotNumber } {
47
+ return {
53
48
  currentSlot: SlotNumber(0),
54
49
  nextSlot: SlotNumber(0),
55
- });
50
+ };
56
51
  }
57
52
 
58
53
  getProposerAttesterAddressInSlot(_slot: SlotNumber): Promise<EthAddress | undefined> {
@@ -70,4 +65,8 @@ export class MockEpochCache implements EpochCacheInterface {
70
65
  filterInCommittee(_slot: SlotTag, _validators: EthAddress[]): Promise<EthAddress[]> {
71
66
  return Promise.resolve([]);
72
67
  }
68
+
69
+ getL1Constants(): L1RollupConstants {
70
+ return EmptyL1RollupConstants;
71
+ }
73
72
  }
@@ -1,7 +1,7 @@
1
1
  import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
2
2
  import { BlockNumber } from '@aztec/foundation/branded-types';
3
3
  import { Fr } from '@aztec/foundation/curves/bn254';
4
- import type { L2BlockNew } from '@aztec/stdlib/block';
4
+ import type { L2Block } from '@aztec/stdlib/block';
5
5
  import type {
6
6
  MerkleTreeReadOperations,
7
7
  MerkleTreeWriteOperations,
@@ -23,7 +23,7 @@ export class TXESynchronizer implements WorldStateSynchronizer {
23
23
  return new this(nativeWorldStateService);
24
24
  }
25
25
 
26
- public async handleL2Block(block: L2BlockNew) {
26
+ public async handleL2Block(block: L2Block) {
27
27
  await this.nativeWorldStateService.handleL2BlockAndMessages(
28
28
  block,
29
29
  Array(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP).fill(0).map(Fr.zero),
@@ -6,6 +6,7 @@ import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
6
6
  import type { ProtocolContract } from '@aztec/protocol-contracts';
7
7
  import {
8
8
  AddressStore,
9
+ AnchorBlockStore,
9
10
  CapsuleStore,
10
11
  JobCoordinator,
11
12
  NoteService,
@@ -49,6 +50,7 @@ import type { IAvmExecutionOracle, ITxeExecutionOracle } from './oracle/interfac
49
50
  import { TXEOraclePublicContext } from './oracle/txe_oracle_public_context.js';
50
51
  import { TXEOracleTopLevelContext } from './oracle/txe_oracle_top_level_context.js';
51
52
  import { RPCTranslator } from './rpc_translator.js';
53
+ import { TXEArchiver } from './state_machine/archiver.js';
52
54
  import { TXEStateMachine } from './state_machine/index.js';
53
55
  import type { ForeignCallArgs, ForeignCallResult } from './util/encoding.js';
54
56
  import { TXEAccountStore } from './util/txe_account_store.js';
@@ -152,7 +154,7 @@ export class TXESession implements TXESessionStateHandler {
152
154
  const addressStore = new AddressStore(store);
153
155
  const privateEventStore = new PrivateEventStore(store);
154
156
  const contractStore = new TXEContractStore(store);
155
- const noteStore = await NoteStore.create(store);
157
+ const noteStore = new NoteStore(store);
156
158
  const senderTaggingStore = new SenderTaggingStore(store);
157
159
  const recipientTaggingStore = new RecipientTaggingStore(store);
158
160
  const senderAddressBookStore = new SenderAddressBookStore(store);
@@ -162,7 +164,13 @@ export class TXESession implements TXESessionStateHandler {
162
164
 
163
165
  // Create job coordinator and register staged stores
164
166
  const jobCoordinator = new JobCoordinator(store);
165
- jobCoordinator.registerStores([capsuleStore, senderTaggingStore, recipientTaggingStore, privateEventStore]);
167
+ jobCoordinator.registerStores([
168
+ capsuleStore,
169
+ senderTaggingStore,
170
+ recipientTaggingStore,
171
+ privateEventStore,
172
+ noteStore,
173
+ ]);
166
174
 
167
175
  // Register protocol contracts.
168
176
  for (const { contractClass, instance, artifact } of protocolContracts) {
@@ -170,7 +178,9 @@ export class TXESession implements TXESessionStateHandler {
170
178
  await contractStore.addContractInstance(instance);
171
179
  }
172
180
 
173
- const stateMachine = await TXEStateMachine.create(store);
181
+ const archiver = new TXEArchiver(store);
182
+ const anchorBlockStore = new AnchorBlockStore(store);
183
+ const stateMachine = await TXEStateMachine.create(archiver, anchorBlockStore, contractStore, noteStore);
174
184
 
175
185
  const nextBlockTimestamp = BigInt(Math.floor(new Date().getTime() / 1000));
176
186
  const version = new Fr(await stateMachine.node.getVersion());
@@ -306,16 +316,14 @@ export class TXESession implements TXESessionStateHandler {
306
316
  ): Promise<PrivateContextInputs> {
307
317
  this.exitTopLevelState();
308
318
 
309
- await new NoteService(
310
- this.noteStore,
311
- this.stateMachine.node,
312
- this.stateMachine.anchorBlockStore,
313
- ).syncNoteNullifiers(contractAddress);
314
-
315
319
  // Private execution has two associated block numbers: the anchor block (i.e. the historical block that is used to
316
320
  // build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
317
321
  // a single transaction with the effects of what was done in the test.
318
322
  const anchorBlock = await this.stateMachine.node.getBlockHeader(anchorBlockNumber ?? 'latest');
323
+
324
+ await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock!, this.currentJobId).syncNoteNullifiers(
325
+ contractAddress,
326
+ );
319
327
  const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
320
328
 
321
329
  const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
@@ -331,30 +339,30 @@ export class TXESession implements TXESessionStateHandler {
331
339
  const taggingIndexCache = new ExecutionTaggingIndexCache();
332
340
 
333
341
  const utilityExecutor = this.utilityExecutorForContractSync(anchorBlock);
334
- this.oracleHandler = new PrivateExecutionOracle(
335
- Fr.ZERO,
336
- new TxContext(this.chainId, this.version, GasSettings.empty()),
337
- new CallContext(AztecAddress.ZERO, contractAddress, FunctionSelector.empty(), false),
338
- anchorBlock!,
342
+ this.oracleHandler = new PrivateExecutionOracle({
343
+ argsHash: Fr.ZERO,
344
+ txContext: new TxContext(this.chainId, this.version, GasSettings.empty()),
345
+ callContext: new CallContext(AztecAddress.ZERO, contractAddress, FunctionSelector.empty(), false),
346
+ anchorBlockHeader: anchorBlock!,
339
347
  utilityExecutor,
340
- [],
341
- [],
342
- new HashedValuesCache(),
348
+ authWitnesses: [],
349
+ capsules: [],
350
+ executionCache: new HashedValuesCache(),
343
351
  noteCache,
344
352
  taggingIndexCache,
345
- this.contractStore,
346
- this.noteStore,
347
- this.keyStore,
348
- this.addressStore,
349
- this.stateMachine.node,
350
- this.stateMachine.anchorBlockStore,
351
- this.senderTaggingStore,
352
- this.recipientTaggingStore,
353
- this.senderAddressBookStore,
354
- this.capsuleStore,
355
- this.privateEventStore,
356
- this.currentJobId,
357
- );
353
+ contractStore: this.contractStore,
354
+ noteStore: this.noteStore,
355
+ keyStore: this.keyStore,
356
+ addressStore: this.addressStore,
357
+ aztecNode: this.stateMachine.node,
358
+ senderTaggingStore: this.senderTaggingStore,
359
+ recipientTaggingStore: this.recipientTaggingStore,
360
+ senderAddressBookStore: this.senderAddressBookStore,
361
+ capsuleStore: this.capsuleStore,
362
+ privateEventStore: this.privateEventStore,
363
+ contractSyncService: this.stateMachine.contractSyncService,
364
+ jobId: this.currentJobId,
365
+ });
358
366
 
359
367
  // We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
360
368
  // data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
@@ -394,6 +402,8 @@ export class TXESession implements TXESessionStateHandler {
394
402
  async enterUtilityState(contractAddress: AztecAddress = DEFAULT_ADDRESS) {
395
403
  this.exitTopLevelState();
396
404
 
405
+ const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
406
+
397
407
  // There is no automatic message discovery and contract-driven syncing process in inlined private or utility
398
408
  // contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
399
409
  // we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
@@ -402,28 +412,26 @@ export class TXESession implements TXESessionStateHandler {
402
412
  await new NoteService(
403
413
  this.noteStore,
404
414
  this.stateMachine.node,
405
- this.stateMachine.anchorBlockStore,
415
+ anchorBlockHeader,
416
+ this.currentJobId,
406
417
  ).syncNoteNullifiers(contractAddress);
407
418
 
408
- const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
409
-
410
- this.oracleHandler = new UtilityExecutionOracle(
419
+ this.oracleHandler = new UtilityExecutionOracle({
411
420
  contractAddress,
412
- [],
413
- [],
421
+ authWitnesses: [],
422
+ capsules: [],
414
423
  anchorBlockHeader,
415
- this.contractStore,
416
- this.noteStore,
417
- this.keyStore,
418
- this.addressStore,
419
- this.stateMachine.node,
420
- this.stateMachine.anchorBlockStore,
421
- this.recipientTaggingStore,
422
- this.senderAddressBookStore,
423
- this.capsuleStore,
424
- this.privateEventStore,
425
- this.currentJobId,
426
- );
424
+ contractStore: this.contractStore,
425
+ noteStore: this.noteStore,
426
+ keyStore: this.keyStore,
427
+ addressStore: this.addressStore,
428
+ aztecNode: this.stateMachine.node,
429
+ recipientTaggingStore: this.recipientTaggingStore,
430
+ senderAddressBookStore: this.senderAddressBookStore,
431
+ capsuleStore: this.capsuleStore,
432
+ privateEventStore: this.privateEventStore,
433
+ jobId: this.currentJobId,
434
+ });
427
435
 
428
436
  this.state = { name: 'UTILITY' };
429
437
  this.logger.debug(`Entered state ${this.state.name}`);
@@ -498,23 +506,22 @@ export class TXESession implements TXESessionStateHandler {
498
506
  }
499
507
 
500
508
  try {
501
- const oracle = new UtilityExecutionOracle(
502
- call.to,
503
- [],
504
- [],
505
- anchorBlock!,
506
- this.contractStore,
507
- this.noteStore,
508
- this.keyStore,
509
- this.addressStore,
510
- this.stateMachine.node,
511
- this.stateMachine.anchorBlockStore,
512
- this.recipientTaggingStore,
513
- this.senderAddressBookStore,
514
- this.capsuleStore,
515
- this.privateEventStore,
516
- this.currentJobId,
517
- );
509
+ const oracle = new UtilityExecutionOracle({
510
+ contractAddress: call.to,
511
+ authWitnesses: [],
512
+ capsules: [],
513
+ anchorBlockHeader: anchorBlock!,
514
+ contractStore: this.contractStore,
515
+ noteStore: this.noteStore,
516
+ keyStore: this.keyStore,
517
+ addressStore: this.addressStore,
518
+ aztecNode: this.stateMachine.node,
519
+ recipientTaggingStore: this.recipientTaggingStore,
520
+ senderAddressBookStore: this.senderAddressBookStore,
521
+ capsuleStore: this.capsuleStore,
522
+ privateEventStore: this.privateEventStore,
523
+ jobId: this.currentJobId,
524
+ });
518
525
  await new WASMSimulator()
519
526
  .executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, new Oracle(oracle).toACIRCallback())
520
527
  .catch((err: Error) => {
@@ -7,7 +7,7 @@ import {
7
7
  import { BlockNumber, CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
8
8
  import { padArrayEnd } from '@aztec/foundation/collection';
9
9
  import { Fr } from '@aztec/foundation/curves/bn254';
10
- import { Body, L2BlockNew } from '@aztec/stdlib/block';
10
+ import { Body, L2Block } from '@aztec/stdlib/block';
11
11
  import { AppendOnlyTreeSnapshot, MerkleTreeId, type MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
12
12
  import { BlockHeader, GlobalVariables, TxEffect } from '@aztec/stdlib/tx';
13
13
 
@@ -61,7 +61,7 @@ export async function makeTXEBlockHeader(
61
61
  }
62
62
 
63
63
  /**
64
- * Creates an L2BlockNew with proper archive chaining.
64
+ * Creates an L2Block with proper archive chaining.
65
65
  * This function:
66
66
  * 1. Gets the current archive state as lastArchive for the header
67
67
  * 2. Creates the block header
@@ -71,13 +71,13 @@ export async function makeTXEBlockHeader(
71
71
  * @param worldTrees - The world trees to read/write from
72
72
  * @param globalVariables - Global variables for the block
73
73
  * @param txEffects - Transaction effects to include in the block
74
- * @returns The created L2BlockNew with proper archive chaining
74
+ * @returns The created L2Block with proper archive chaining
75
75
  */
76
76
  export async function makeTXEBlock(
77
77
  worldTrees: MerkleTreeWriteOperations,
78
78
  globalVariables: GlobalVariables,
79
79
  txEffects: TxEffect[],
80
- ): Promise<L2BlockNew> {
80
+ ): Promise<L2Block> {
81
81
  const header = await makeTXEBlockHeader(worldTrees, globalVariables);
82
82
 
83
83
  // Update the archive tree with this block's header hash
@@ -87,9 +87,11 @@ export async function makeTXEBlock(
87
87
  const newArchiveInfo = await worldTrees.getTreeInfo(MerkleTreeId.ARCHIVE);
88
88
  const newArchive = new AppendOnlyTreeSnapshot(new Fr(newArchiveInfo.root), Number(newArchiveInfo.size));
89
89
 
90
- // L2BlockNew requires checkpointNumber and indexWithinCheckpoint
90
+ // L2Block requires checkpointNumber and indexWithinCheckpoint.
91
+ // TXE uses 1-block-per-checkpoint for testing simplicity, so we can use block number as checkpoint number.
92
+ // This uses the deprecated fromBlockNumber method intentionally for the TXE testing environment.
91
93
  const checkpointNumber = CheckpointNumber.fromBlockNumber(globalVariables.blockNumber);
92
94
  const indexWithinCheckpoint = IndexWithinCheckpoint(0);
93
95
 
94
- return new L2BlockNew(newArchive, header, new Body(txEffects), checkpointNumber, indexWithinCheckpoint);
96
+ return new L2Block(newArchive, header, new Body(txEffects), checkpointNumber, indexWithinCheckpoint);
95
97
  }