@aztec/txe 1.2.0 → 2.0.0-nightly.20250813

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.
@@ -2,7 +2,7 @@ import { ArchiverStoreHelper, KVArchiverDataStore, type PublishedL2Block } from
2
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
3
3
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { L2Block, L2Tips } from '@aztec/stdlib/block';
5
+ import type { L2Block, L2BlockSource, L2Tips, ValidateBlockResult } from '@aztec/stdlib/block';
6
6
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
7
7
  import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
8
8
  import type { BlockHeader } from '@aztec/stdlib/tx';
@@ -11,7 +11,7 @@ import type { UInt64 } from '@aztec/stdlib/types';
11
11
  // We are extending the ArchiverDataStoreHelper here because it provides most of the endpoints needed by the
12
12
  // node for reading from and writing to state, without needing any of the extra overhead that the Archiver itself
13
13
  // requires (i.e. an L1 client)
14
- export class TXEArchiver extends ArchiverStoreHelper {
14
+ export class TXEArchiver extends ArchiverStoreHelper implements L2BlockSource {
15
15
  constructor(db: AztecAsyncKVStore) {
16
16
  super(new KVArchiverDataStore(db, 9999));
17
17
  }
@@ -134,4 +134,12 @@ export class TXEArchiver extends ArchiverStoreHelper {
134
134
  public getL1Timestamp(): Promise<bigint> {
135
135
  throw new Error('TXE Archiver does not implement "getL1Timestamp"');
136
136
  }
137
+
138
+ public isPendingChainInvalid(): Promise<boolean> {
139
+ return Promise.resolve(false);
140
+ }
141
+
142
+ public getPendingChainValidationStatus(): Promise<ValidateBlockResult> {
143
+ return Promise.resolve({ valid: true });
144
+ }
137
145
  }
@@ -1,5 +1,17 @@
1
- import type { ENR, P2P, P2PBlockReceivedCallback, P2PConfig, P2PSyncState } from '@aztec/p2p';
2
- import type { L2BlockStreamEvent, L2Tips } from '@aztec/stdlib/block';
1
+ import type {
2
+ AuthRequest,
3
+ ENR,
4
+ P2P,
5
+ P2PBlockReceivedCallback,
6
+ P2PConfig,
7
+ P2PSyncState,
8
+ PeerId,
9
+ ReqRespSubProtocol,
10
+ ReqRespSubProtocolHandler,
11
+ ReqRespSubProtocolValidators,
12
+ StatusMessage,
13
+ } from '@aztec/p2p';
14
+ import type { EthAddress, L2BlockStreamEvent, L2Tips } from '@aztec/stdlib/block';
3
15
  import type { PeerInfo } from '@aztec/stdlib/interfaces/server';
4
16
  import type { BlockAttestation, BlockProposal } from '@aztec/stdlib/p2p';
5
17
  import type { Tx, TxHash } from '@aztec/stdlib/tx';
@@ -129,7 +141,7 @@ export class DummyP2P implements P2P {
129
141
  throw new Error('DummyP2P does not implement "sync"');
130
142
  }
131
143
 
132
- public requestTxsByHash(_txHashes: TxHash[]): Promise<(Tx | undefined)[]> {
144
+ public requestTxsByHash(_txHashes: TxHash[]): Promise<Tx[]> {
133
145
  throw new Error('DummyP2P does not implement "requestTxsByHash"');
134
146
  }
135
147
 
@@ -164,4 +176,18 @@ export class DummyP2P implements P2P {
164
176
  markTxsAsNonEvictable(_: TxHash[]): Promise<void> {
165
177
  throw new Error('DummyP2P does not implement "markTxsAsNonEvictable".');
166
178
  }
179
+
180
+ addReqRespSubProtocol(
181
+ _subProtocol: ReqRespSubProtocol,
182
+ _handler: ReqRespSubProtocolHandler,
183
+ _validator?: ReqRespSubProtocolValidators[ReqRespSubProtocol],
184
+ ): Promise<void> {
185
+ throw new Error('DummyP2P does not implement "addReqRespSubProtocol".');
186
+ }
187
+ handleAuthRequestFromPeer(_authRequest: AuthRequest, _peerId: PeerId): Promise<StatusMessage> {
188
+ throw new Error('DummyP2P does not implement "handleAuthRequestFromPeer".');
189
+ }
190
+
191
+ //This is no-op
192
+ public registerThisValidatorAddresses(_address: EthAddress[]): void {}
167
193
  }
@@ -1,4 +1,4 @@
1
- import type { EpochAndSlot, EpochCacheInterface, EpochCommitteeInfo } from '@aztec/epoch-cache';
1
+ import type { EpochAndSlot, EpochCacheInterface, EpochCommitteeInfo, SlotTag } from '@aztec/epoch-cache';
2
2
  import { EthAddress } from '@aztec/foundation/eth-address';
3
3
 
4
4
  /**
@@ -53,7 +53,15 @@ export class MockEpochCache implements EpochCacheInterface {
53
53
  });
54
54
  }
55
55
 
56
- isInCommittee(_validator: EthAddress): Promise<boolean> {
56
+ isInCommittee(_slot: SlotTag, _validator: EthAddress): Promise<boolean> {
57
57
  return Promise.resolve(false);
58
58
  }
59
+
60
+ getRegisteredValidators(): Promise<EthAddress[]> {
61
+ return Promise.resolve([]);
62
+ }
63
+
64
+ filterInCommittee(_slot: SlotTag, _validators: EthAddress[]): Promise<EthAddress[]> {
65
+ return Promise.resolve([]);
66
+ }
59
67
  }
@@ -4,8 +4,6 @@
4
4
  // in TestConstants.sol (they are loaded from config set at runtime). But loading these from oracles at this point
5
5
  // seems like an overkill.
6
6
 
7
- // Aztec slot duration is copied from TestConstants.sol.
8
- export const AZTEC_SLOT_DURATION = 36n;
9
7
  // Put here Thu Jan 01 2026 00:00:00 GMT+0000. If this file survives until mainnet launch, we would want to use the
10
8
  // actual genesis time here.
11
9
  export const GENESIS_TIMESTAMP = 1767225600n;