@aztec/p2p 4.0.0-devnet.2-patch.4 → 4.0.0-devnet.3-patch.0
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/README.md +129 -3
- package/dest/client/factory.d.ts +4 -5
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +30 -28
- package/dest/client/interface.d.ts +8 -13
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +6 -13
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +22 -88
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +2 -4
- package/dest/config.d.ts +29 -10
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +80 -31
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.js +2 -1
- package/dest/mem_pools/tx_pool/priority.d.ts +2 -2
- package/dest/mem_pools/tx_pool/priority.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/priority.js +4 -4
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts +1 -1
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.js +3 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +3 -2
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +2 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +7 -1
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +10 -6
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +8 -6
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +2 -2
- package/dest/mem_pools/tx_pool_v2/index.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/index.js +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +9 -5
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.js +2 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +46 -8
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +81 -17
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +9 -10
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +5 -3
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +3 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +179 -151
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +6 -4
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/block_proposal_validator.js +10 -2
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +6 -4
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +16 -2
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +13 -8
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator.js +48 -36
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +2 -2
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +3 -3
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts +2 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.js +24 -20
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts +17 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.js +24 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts +9 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.js +48 -0
- package/dest/msg_validators/tx_validator/data_validator.d.ts +1 -1
- package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/data_validator.js +35 -2
- package/dest/msg_validators/tx_validator/factory.d.ts +133 -6
- package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/factory.js +247 -60
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.js +6 -2
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +67 -3
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.js +104 -37
- package/dest/msg_validators/tx_validator/index.d.ts +3 -1
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +2 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.d.ts +14 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.js +24 -0
- package/dest/msg_validators/tx_validator/phases_validator.d.ts +22 -2
- package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/phases_validator.js +72 -24
- package/dest/services/dummy_service.d.ts +4 -4
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +4 -4
- package/dest/services/encoding.d.ts +6 -2
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +14 -8
- package/dest/services/gossipsub/topic_score_params.d.ts +18 -6
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
- package/dest/services/gossipsub/topic_score_params.js +32 -10
- package/dest/services/libp2p/libp2p_service.d.ts +16 -13
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +97 -93
- package/dest/services/reqresp/batch-tx-requester/tx_validator.js +2 -2
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts +5 -4
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts.map +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limiter.js +10 -8
- package/dest/services/reqresp/reqresp.d.ts +1 -1
- package/dest/services/reqresp/reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/reqresp.js +16 -8
- package/dest/services/service.d.ts +5 -3
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_source.d.ts +5 -4
- package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_source.js +39 -29
- package/dest/services/tx_collection/tx_source.d.ts +6 -5
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_source.js +9 -7
- package/dest/services/tx_provider.d.ts +3 -3
- package/dest/services/tx_provider.d.ts.map +1 -1
- package/dest/services/tx_provider.js +4 -4
- package/dest/test-helpers/make-test-p2p-clients.d.ts +5 -6
- package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
- package/dest/test-helpers/make-test-p2p-clients.js +1 -2
- package/dest/test-helpers/mock-pubsub.d.ts +4 -4
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +8 -2
- package/dest/test-helpers/reqresp-nodes.d.ts +2 -3
- package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
- package/dest/test-helpers/reqresp-nodes.js +2 -2
- package/dest/test-helpers/testbench-utils.d.ts +2 -2
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +2 -1
- package/dest/testbench/p2p_client_testbench_worker.js +7 -6
- package/dest/testbench/worker_client_manager.d.ts +3 -1
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +4 -1
- package/dest/util.d.ts +2 -2
- package/dest/util.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/client/factory.ts +49 -45
- package/src/client/interface.ts +8 -13
- package/src/client/p2p_client.ts +24 -117
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +2 -3
- package/src/config.ts +115 -33
- package/src/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.ts +2 -1
- package/src/mem_pools/tx_pool/priority.ts +4 -4
- package/src/mem_pools/tx_pool/tx_pool_test_suite.ts +3 -1
- package/src/mem_pools/tx_pool_v2/README.md +9 -1
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +3 -2
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +3 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +11 -1
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +2 -2
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +10 -6
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +15 -6
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +2 -1
- package/src/mem_pools/tx_pool_v2/index.ts +1 -1
- package/src/mem_pools/tx_pool_v2/interfaces.ts +9 -4
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +113 -18
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +11 -11
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +14 -2
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +188 -153
- package/src/msg_validators/attestation_validator/README.md +49 -0
- package/src/msg_validators/proposal_validator/README.md +123 -0
- package/src/msg_validators/proposal_validator/block_proposal_validator.ts +14 -4
- package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +20 -7
- package/src/msg_validators/proposal_validator/proposal_validator.ts +63 -40
- package/src/msg_validators/tx_validator/README.md +119 -0
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -3
- package/src/msg_validators/tx_validator/allowed_public_setup.ts +22 -27
- package/src/msg_validators/tx_validator/allowed_setup_helpers.ts +31 -0
- package/src/msg_validators/tx_validator/contract_instance_validator.ts +56 -0
- package/src/msg_validators/tx_validator/data_validator.ts +42 -1
- package/src/msg_validators/tx_validator/factory.ts +394 -78
- package/src/msg_validators/tx_validator/fee_payer_balance.ts +6 -2
- package/src/msg_validators/tx_validator/gas_validator.ts +123 -27
- package/src/msg_validators/tx_validator/index.ts +2 -0
- package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
- package/src/msg_validators/tx_validator/phases_validator.ts +82 -27
- package/src/services/dummy_service.ts +6 -6
- package/src/services/encoding.ts +14 -7
- package/src/services/gossipsub/README.md +29 -14
- package/src/services/gossipsub/topic_score_params.ts +49 -13
- package/src/services/libp2p/libp2p_service.ts +111 -101
- package/src/services/reqresp/README.md +229 -0
- package/src/services/reqresp/batch-tx-requester/tx_validator.ts +2 -2
- package/src/services/reqresp/rate-limiter/rate_limiter.ts +13 -9
- package/src/services/reqresp/reqresp.ts +18 -10
- package/src/services/service.ts +11 -2
- package/src/services/tx_collection/file_store_tx_source.ts +43 -31
- package/src/services/tx_collection/tx_source.ts +8 -7
- package/src/services/tx_provider.ts +2 -2
- package/src/test-helpers/make-test-p2p-clients.ts +0 -2
- package/src/test-helpers/mock-pubsub.ts +13 -6
- package/src/test-helpers/reqresp-nodes.ts +2 -5
- package/src/test-helpers/testbench-utils.ts +2 -1
- package/src/testbench/p2p_client_testbench_worker.ts +3 -6
- package/src/testbench/worker_client_manager.ts +11 -4
- package/src/util.ts +7 -1
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +0 -23
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +0 -1
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +0 -212
- package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +0 -230
package/src/client/factory.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
3
4
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
4
5
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
5
6
|
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
6
7
|
import { AztecLMDBStoreV2, createStore } from '@aztec/kv-store/lmdb-v2';
|
|
7
|
-
import type {
|
|
8
|
+
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
8
9
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
9
10
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
10
11
|
import type { AztecNode, ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
11
|
-
import { P2PClientType } from '@aztec/stdlib/p2p';
|
|
12
|
-
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
13
12
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
14
13
|
|
|
15
14
|
import { P2PClient } from '../client/p2p_client.js';
|
|
@@ -17,11 +16,13 @@ import type { P2PConfig } from '../config.js';
|
|
|
17
16
|
import { AttestationPool, type AttestationPoolApi } from '../mem_pools/attestation_pool/attestation_pool.js';
|
|
18
17
|
import type { MemPools } from '../mem_pools/interface.js';
|
|
19
18
|
import type { TxPoolV2 } from '../mem_pools/tx_pool_v2/interfaces.js';
|
|
20
|
-
import type { TxMetaData } from '../mem_pools/tx_pool_v2/tx_metadata.js';
|
|
21
19
|
import { AztecKVTxPoolV2 } from '../mem_pools/tx_pool_v2/tx_pool_v2.js';
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
import {
|
|
21
|
+
createCheckAllowedSetupCalls,
|
|
22
|
+
createTxValidatorForReqResponseReceivedTxs,
|
|
23
|
+
createTxValidatorForTransactionsEnteringPendingTxPool,
|
|
24
|
+
getDefaultAllowedSetupFunctions,
|
|
25
|
+
} from '../msg_validators/index.js';
|
|
25
26
|
import { DummyP2PService } from '../services/dummy_service.js';
|
|
26
27
|
import { LibP2PService } from '../services/index.js';
|
|
27
28
|
import { createFileStoreTxSources } from '../services/tx_collection/file_store_tx_source.js';
|
|
@@ -30,14 +31,14 @@ import { NodeRpcTxSource, type TxSource, createNodeRpcTxSources } from '../servi
|
|
|
30
31
|
import { TxFileStore } from '../services/tx_file_store/tx_file_store.js';
|
|
31
32
|
import { configureP2PClientAddresses, createLibP2PPeerIdFromPrivateKey, getPeerIdPrivateKey } from '../util.js';
|
|
32
33
|
|
|
33
|
-
export type P2PClientDeps
|
|
34
|
+
export type P2PClientDeps = {
|
|
34
35
|
txPool?: TxPoolV2;
|
|
35
36
|
store?: AztecAsyncKVStore;
|
|
36
37
|
attestationPool?: AttestationPoolApi;
|
|
37
38
|
logger?: Logger;
|
|
38
39
|
txCollectionNodeSources?: TxSource[];
|
|
39
40
|
rpcTxProviders?: AztecNode[];
|
|
40
|
-
p2pServiceFactory?: (...args: Parameters<(typeof LibP2PService)['new']>) => Promise<LibP2PService
|
|
41
|
+
p2pServiceFactory?: (...args: Parameters<(typeof LibP2PService)['new']>) => Promise<LibP2PService>;
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
export const P2P_STORE_NAME = 'p2p';
|
|
@@ -45,8 +46,7 @@ export const P2P_ARCHIVE_STORE_NAME = 'p2p-archive';
|
|
|
45
46
|
export const P2P_PEER_STORE_NAME = 'p2p-peers';
|
|
46
47
|
export const P2P_ATTESTATION_STORE_NAME = 'p2p-attestation';
|
|
47
48
|
|
|
48
|
-
export async function createP2PClient
|
|
49
|
-
clientType: T,
|
|
49
|
+
export async function createP2PClient(
|
|
50
50
|
inputConfig: P2PConfig & DataStoreConfig & ChainConfig,
|
|
51
51
|
archiver: L2BlockSource & ContractDataSource,
|
|
52
52
|
proofVerifier: ClientProtocolCircuitVerifier,
|
|
@@ -55,7 +55,7 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
55
55
|
packageVersion: string,
|
|
56
56
|
dateProvider: DateProvider = new DateProvider(),
|
|
57
57
|
telemetry: TelemetryClient = getTelemetryClient(),
|
|
58
|
-
deps: P2PClientDeps
|
|
58
|
+
deps: P2PClientDeps = {},
|
|
59
59
|
) {
|
|
60
60
|
const config = await configureP2PClientAddresses({
|
|
61
61
|
...inputConfig,
|
|
@@ -80,29 +80,30 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
80
80
|
const rollupAddress = inputConfig.l1Contracts.rollupAddress.toString().toLowerCase().replace(/^0x/, '');
|
|
81
81
|
const txFileStoreBasePath = `aztec-${inputConfig.l1ChainId}-${inputConfig.rollupVersion}-0x${rollupAddress}`;
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
83
|
+
const allowedInSetup = [
|
|
84
|
+
...(await getDefaultAllowedSetupFunctions()),
|
|
85
|
+
...(inputConfig.txPublicSetupAllowListExtend ?? []),
|
|
86
|
+
];
|
|
87
|
+
const checkAllowedSetupCalls = createCheckAllowedSetupCalls(
|
|
88
|
+
archiver,
|
|
89
|
+
allowedInSetup,
|
|
90
|
+
() => epochCache.getEpochAndSlotInNextL1Slot().ts,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const createTxValidator = async () => {
|
|
94
|
+
// We accept transactions if they are not expired by the next slot and block number (checked based on the ExpirationTimestamp field)
|
|
95
|
+
const currentBlockNumber = await archiver.getBlockNumber();
|
|
96
|
+
const { ts: nextSlotTimestamp } = epochCache.getEpochAndSlotInNextL1Slot();
|
|
97
|
+
const l1Constants = await archiver.getL1Constants();
|
|
98
|
+
return createTxValidatorForTransactionsEnteringPendingTxPool(
|
|
99
|
+
worldStateSynchronizer,
|
|
100
|
+
nextSlotTimestamp,
|
|
101
|
+
BlockNumber(currentBlockNumber + 1),
|
|
102
|
+
{
|
|
103
|
+
rollupManaLimit: l1Constants.rollupManaLimit,
|
|
104
|
+
maxBlockL2Gas: config.validateMaxL2BlockGas,
|
|
105
|
+
maxBlockDAGas: config.validateMaxDABlockGas,
|
|
106
|
+
},
|
|
106
107
|
);
|
|
107
108
|
};
|
|
108
109
|
|
|
@@ -114,13 +115,15 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
114
115
|
{
|
|
115
116
|
l2BlockSource: archiver,
|
|
116
117
|
worldStateSynchronizer,
|
|
117
|
-
|
|
118
|
+
checkAllowedSetupCalls,
|
|
119
|
+
createTxValidator,
|
|
118
120
|
},
|
|
119
121
|
telemetry,
|
|
120
122
|
{
|
|
121
123
|
maxPendingTxCount: config.maxPendingTxCount,
|
|
122
124
|
archivedTxLimit: config.archivedTxLimit,
|
|
123
125
|
minTxPoolAgeMs: config.minTxPoolAgeMs,
|
|
126
|
+
priceBumpPercentage: config.priceBumpPercentage,
|
|
124
127
|
},
|
|
125
128
|
dateProvider,
|
|
126
129
|
);
|
|
@@ -130,9 +133,8 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
130
133
|
attestationPool: deps.attestationPool ?? new AttestationPool(attestationStore, telemetry),
|
|
131
134
|
};
|
|
132
135
|
|
|
133
|
-
const p2pService = await createP2PService
|
|
136
|
+
const p2pService = await createP2PService(
|
|
134
137
|
config,
|
|
135
|
-
clientType,
|
|
136
138
|
archiver,
|
|
137
139
|
proofVerifier,
|
|
138
140
|
worldStateSynchronizer,
|
|
@@ -146,9 +148,12 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
146
148
|
telemetry,
|
|
147
149
|
);
|
|
148
150
|
|
|
151
|
+
const txValidatorForTxCollection = createTxValidatorForReqResponseReceivedTxs(proofVerifier, config);
|
|
149
152
|
const nodeSources = [
|
|
150
|
-
...createNodeRpcTxSources(config.txCollectionNodeRpcUrls, config),
|
|
151
|
-
...(deps.rpcTxProviders ?? []).map(
|
|
153
|
+
...createNodeRpcTxSources(config.txCollectionNodeRpcUrls, txValidatorForTxCollection, config),
|
|
154
|
+
...(deps.rpcTxProviders ?? []).map(
|
|
155
|
+
(node, i) => new NodeRpcTxSource(node, txValidatorForTxCollection, `node-rpc-provider-${i}`),
|
|
156
|
+
),
|
|
152
157
|
...(deps.txCollectionNodeSources ?? []),
|
|
153
158
|
];
|
|
154
159
|
if (nodeSources.length > 0) {
|
|
@@ -160,6 +165,7 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
160
165
|
const fileStoreSources = await createFileStoreTxSources(
|
|
161
166
|
config.txCollectionFileStoreUrls,
|
|
162
167
|
txFileStoreBasePath,
|
|
168
|
+
txValidatorForTxCollection,
|
|
163
169
|
logger.createChild('file-store-tx-source'),
|
|
164
170
|
telemetry,
|
|
165
171
|
);
|
|
@@ -190,7 +196,6 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
190
196
|
);
|
|
191
197
|
|
|
192
198
|
return new P2PClient(
|
|
193
|
-
clientType,
|
|
194
199
|
store,
|
|
195
200
|
archiver,
|
|
196
201
|
mempools,
|
|
@@ -204,9 +209,8 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
204
209
|
);
|
|
205
210
|
}
|
|
206
211
|
|
|
207
|
-
async function createP2PService
|
|
212
|
+
async function createP2PService(
|
|
208
213
|
config: P2PConfig & DataStoreConfig,
|
|
209
|
-
clientType: T,
|
|
210
214
|
archiver: L2BlockSource & ContractDataSource,
|
|
211
215
|
proofVerifier: ClientProtocolCircuitVerifier,
|
|
212
216
|
worldStateSynchronizer: WorldStateSynchronizer,
|
|
@@ -214,7 +218,7 @@ async function createP2PService<T extends P2PClientType>(
|
|
|
214
218
|
store: AztecAsyncKVStore,
|
|
215
219
|
peerStore: AztecLMDBStoreV2,
|
|
216
220
|
mempools: MemPools,
|
|
217
|
-
p2pServiceFactory: P2PClientDeps
|
|
221
|
+
p2pServiceFactory: P2PClientDeps['p2pServiceFactory'],
|
|
218
222
|
packageVersion: string,
|
|
219
223
|
logger: Logger,
|
|
220
224
|
telemetry: TelemetryClient,
|
|
@@ -230,7 +234,7 @@ async function createP2PService<T extends P2PClientType>(
|
|
|
230
234
|
const peerIdPrivateKey = await getPeerIdPrivateKey(config, store, logger);
|
|
231
235
|
const peerId = await createLibP2PPeerIdFromPrivateKey(peerIdPrivateKey.getValue());
|
|
232
236
|
|
|
233
|
-
const p2pService = await (p2pServiceFactory ?? LibP2PService.new
|
|
237
|
+
const p2pService = await (p2pServiceFactory ?? LibP2PService.new)(config, peerId, {
|
|
234
238
|
packageVersion,
|
|
235
239
|
mempools,
|
|
236
240
|
l2BlockSource: archiver,
|
package/src/client/interface.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { EthAddress, L2BlockId } from '@aztec/stdlib/block';
|
|
3
|
-
import type { ITxProvider,
|
|
4
|
-
import type { BlockProposal, CheckpointAttestation, CheckpointProposal,
|
|
3
|
+
import type { ITxProvider, P2PClient } from '@aztec/stdlib/interfaces/server';
|
|
4
|
+
import type { BlockProposal, CheckpointAttestation, CheckpointProposal, TopicType } from '@aztec/stdlib/p2p';
|
|
5
5
|
import type { BlockHeader, Tx, TxHash } from '@aztec/stdlib/tx';
|
|
6
6
|
|
|
7
7
|
import type { PeerId } from '@libp2p/interface';
|
|
@@ -48,7 +48,7 @@ export interface P2PSyncState {
|
|
|
48
48
|
/**
|
|
49
49
|
* Interface of a P2P client.
|
|
50
50
|
**/
|
|
51
|
-
export type P2P
|
|
51
|
+
export type P2P = P2PClient & {
|
|
52
52
|
/**
|
|
53
53
|
* Broadcasts a block proposal to other peers.
|
|
54
54
|
*
|
|
@@ -134,14 +134,6 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
134
134
|
*/
|
|
135
135
|
hasTxsInPool(txHashes: TxHash[]): Promise<boolean[]>;
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
* Returns transactions in the transaction pool by hash, requesting from the network if not found.
|
|
139
|
-
* @param txHashes - Hashes of tx to return.
|
|
140
|
-
* @param pinnedPeerId - An optional peer id that will be used to request the tx from (in addition to other random peers).
|
|
141
|
-
* @returns An array of tx or undefined.
|
|
142
|
-
*/
|
|
143
|
-
getTxsByHash(txHashes: TxHash[], pinnedPeerId: PeerId | undefined): Promise<(Tx | undefined)[]>;
|
|
144
|
-
|
|
145
137
|
/**
|
|
146
138
|
* Returns an archived transaction from the transaction pool by its hash.
|
|
147
139
|
* @param txHash - Hash of tx to return.
|
|
@@ -218,8 +210,8 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
218
210
|
|
|
219
211
|
updateP2PConfig(config: Partial<P2PConfig>): Promise<void>;
|
|
220
212
|
|
|
221
|
-
/** Validates a set of txs. */
|
|
222
|
-
|
|
213
|
+
/** Validates a set of txs received in a block proposal. */
|
|
214
|
+
validateTxsReceivedInBlockProposal(txs: Tx[]): Promise<void>;
|
|
223
215
|
|
|
224
216
|
/** Clears the db. */
|
|
225
217
|
clear(): Promise<void>;
|
|
@@ -237,4 +229,7 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
237
229
|
|
|
238
230
|
/** If node running this P2P stack is validator, passes in validator address to P2P layer */
|
|
239
231
|
registerThisValidatorAddresses(address: EthAddress[]): void;
|
|
232
|
+
|
|
233
|
+
/** Returns the number of peers in the GossipSub mesh for a given topic type. */
|
|
234
|
+
getGossipMeshPeerCount(topicType: TopicType): Promise<number>;
|
|
240
235
|
};
|
package/src/client/p2p_client.ts
CHANGED
|
@@ -18,14 +18,8 @@ import {
|
|
|
18
18
|
type L2TipsStore,
|
|
19
19
|
} from '@aztec/stdlib/block';
|
|
20
20
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
21
|
-
import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
22
21
|
import { type PeerInfo, tryStop } from '@aztec/stdlib/interfaces/server';
|
|
23
|
-
import {
|
|
24
|
-
type BlockProposal,
|
|
25
|
-
CheckpointAttestation,
|
|
26
|
-
type CheckpointProposal,
|
|
27
|
-
type P2PClientType,
|
|
28
|
-
} from '@aztec/stdlib/p2p';
|
|
22
|
+
import { type BlockProposal, CheckpointAttestation, type CheckpointProposal, type TopicType } from '@aztec/stdlib/p2p';
|
|
29
23
|
import type { BlockHeader, Tx, TxHash } from '@aztec/stdlib/tx';
|
|
30
24
|
import { Attributes, type TelemetryClient, WithTracer, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
31
25
|
|
|
@@ -43,7 +37,6 @@ import {
|
|
|
43
37
|
type ReqRespSubProtocolHandler,
|
|
44
38
|
type ReqRespSubProtocolValidators,
|
|
45
39
|
} from '../services/reqresp/interface.js';
|
|
46
|
-
import { chunkTxHashesRequest } from '../services/reqresp/protocols/tx.js';
|
|
47
40
|
import type {
|
|
48
41
|
DuplicateAttestationInfo,
|
|
49
42
|
DuplicateProposalInfo,
|
|
@@ -59,10 +52,7 @@ import { type P2P, P2PClientState, type P2PSyncState } from './interface.js';
|
|
|
59
52
|
/**
|
|
60
53
|
* The P2P client implementation.
|
|
61
54
|
*/
|
|
62
|
-
export class P2PClient
|
|
63
|
-
extends WithTracer
|
|
64
|
-
implements P2P, P2P<P2PClientType.Prover>
|
|
65
|
-
{
|
|
55
|
+
export class P2PClient extends WithTracer implements P2P {
|
|
66
56
|
/** The JS promise that will be running to keep the client's data in sync. Can be interrupted if the client is stopped. */
|
|
67
57
|
private runningPromise!: Promise<void>;
|
|
68
58
|
|
|
@@ -94,7 +84,6 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
94
84
|
private slotMonitor: RunningPromise | undefined;
|
|
95
85
|
|
|
96
86
|
constructor(
|
|
97
|
-
_clientType: T,
|
|
98
87
|
private store: AztecAsyncKVStore,
|
|
99
88
|
private l2BlockSource: L2BlockSource & ContractDataSource,
|
|
100
89
|
mempools: MemPools,
|
|
@@ -121,27 +110,6 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
121
110
|
this.telemetry,
|
|
122
111
|
);
|
|
123
112
|
|
|
124
|
-
// Default to collecting all txs when we see a valid proposal
|
|
125
|
-
// This can be overridden by the validator client to validate, and it will call getTxsForBlockProposal on its own
|
|
126
|
-
// Note: Validators do NOT attest to individual blocks - attestations are only for checkpoint proposals.
|
|
127
|
-
// TODO(palla/txs): We should not trigger a request for txs on a proposal before fully validating it. We need to bring
|
|
128
|
-
// validator-client code into here so we can validate a proposal is reasonable.
|
|
129
|
-
this.registerBlockProposalHandler(async (block, sender) => {
|
|
130
|
-
this.log.debug(`Received block proposal from ${sender.toString()}`);
|
|
131
|
-
// TODO(palla/txs): Need to subtract validatorReexecuteDeadlineMs from this deadline (see ValidatorClient.getReexecutionDeadline)
|
|
132
|
-
const constants = this.txCollection.getConstants();
|
|
133
|
-
const nextSlotTimestampSeconds = Number(getTimestampForSlot(SlotNumber(block.slotNumber + 1), constants));
|
|
134
|
-
const deadline = new Date(nextSlotTimestampSeconds * 1000);
|
|
135
|
-
const parentBlock = await this.l2BlockSource.getBlockHeaderByArchive(block.blockHeader.lastArchive.root);
|
|
136
|
-
if (!parentBlock) {
|
|
137
|
-
this.log.debug(`Cannot collect txs for proposal as parent block not found`);
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
const blockNumber = BlockNumber(parentBlock.getBlockNumber() + 1);
|
|
141
|
-
await this.txProvider.getTxsForBlockProposal(block, blockNumber, { pinnedPeer: sender, deadline });
|
|
142
|
-
return true;
|
|
143
|
-
});
|
|
144
|
-
|
|
145
113
|
this.l2Tips = new L2TipsKVStore(store, 'p2p_client');
|
|
146
114
|
this.synchedLatestSlot = store.openSingleton('p2p_pool_last_l2_slot');
|
|
147
115
|
}
|
|
@@ -167,6 +135,10 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
167
135
|
return Promise.resolve(this.p2pService.getPeers(includePending));
|
|
168
136
|
}
|
|
169
137
|
|
|
138
|
+
public getGossipMeshPeerCount(topicType: TopicType): Promise<number> {
|
|
139
|
+
return Promise.resolve(this.p2pService.getGossipMeshPeerCount(topicType));
|
|
140
|
+
}
|
|
141
|
+
|
|
170
142
|
public getL2BlockHash(number: BlockNumber): Promise<string | undefined> {
|
|
171
143
|
return this.l2Tips.getL2BlockHash(number);
|
|
172
144
|
}
|
|
@@ -428,36 +400,6 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
428
400
|
this.p2pService.registerDuplicateAttestationCallback(callback);
|
|
429
401
|
}
|
|
430
402
|
|
|
431
|
-
/**
|
|
432
|
-
* Uses the batched Request Response protocol to request a set of transactions from the network.
|
|
433
|
-
*/
|
|
434
|
-
private async requestTxsByHash(txHashes: TxHash[], pinnedPeerId: PeerId | undefined): Promise<Tx[]> {
|
|
435
|
-
const timeoutMs = 8000; // Longer timeout for now
|
|
436
|
-
const maxRetryAttempts = 10; // Keep retrying within the timeout
|
|
437
|
-
const requests = chunkTxHashesRequest(txHashes);
|
|
438
|
-
const maxPeers = Math.min(Math.ceil(requests.length / 3), 10);
|
|
439
|
-
|
|
440
|
-
const txBatches = await this.p2pService.sendBatchRequest(
|
|
441
|
-
ReqRespSubProtocol.TX,
|
|
442
|
-
requests,
|
|
443
|
-
pinnedPeerId,
|
|
444
|
-
timeoutMs,
|
|
445
|
-
maxPeers,
|
|
446
|
-
maxRetryAttempts,
|
|
447
|
-
);
|
|
448
|
-
|
|
449
|
-
const txs = txBatches.flat();
|
|
450
|
-
if (txs.length > 0) {
|
|
451
|
-
await this.txPool.addPendingTxs(txs);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
const txHashesStr = txHashes.map(tx => tx.toString()).join(', ');
|
|
455
|
-
this.log.debug(`Requested txs ${txHashesStr} (${txs.length} / ${txHashes.length}) from peers`);
|
|
456
|
-
|
|
457
|
-
// We return all transactions, even the not found ones to the caller, such they can handle missing items themselves.
|
|
458
|
-
return txs;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
403
|
public async getPendingTxs(limit?: number, after?: TxHash): Promise<Tx[]> {
|
|
462
404
|
if (limit !== undefined && limit <= 0) {
|
|
463
405
|
throw new TypeError('limit must be greater than 0');
|
|
@@ -525,49 +467,6 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
525
467
|
return this.txPool.hasTxs(txHashes);
|
|
526
468
|
}
|
|
527
469
|
|
|
528
|
-
/**
|
|
529
|
-
* Returns transactions in the transaction pool by hash.
|
|
530
|
-
* If a transaction is not in the pool, it will be requested from the network.
|
|
531
|
-
* @param txHashes - Hashes of the transactions to look for.
|
|
532
|
-
* @returns The txs found, or undefined if not found in the order requested.
|
|
533
|
-
*/
|
|
534
|
-
async getTxsByHash(txHashes: TxHash[], pinnedPeerId: PeerId | undefined): Promise<(Tx | undefined)[]> {
|
|
535
|
-
const txs = await Promise.all(txHashes.map(txHash => this.txPool.getTxByHash(txHash)));
|
|
536
|
-
const missingTxHashes = txs
|
|
537
|
-
.map((tx, index) => [tx, index] as const)
|
|
538
|
-
.filter(([tx, _index]) => !tx)
|
|
539
|
-
.map(([_tx, index]) => txHashes[index]);
|
|
540
|
-
|
|
541
|
-
if (missingTxHashes.length === 0) {
|
|
542
|
-
return txs as Tx[];
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
const missingTxs = await this.requestTxsByHash(missingTxHashes, pinnedPeerId);
|
|
546
|
-
// TODO: optimize
|
|
547
|
-
// Merge the found txs in order
|
|
548
|
-
const mergingTxs = txHashes.map(txHash => {
|
|
549
|
-
// Is it in the txs list from the mempool?
|
|
550
|
-
for (const tx of txs) {
|
|
551
|
-
if (tx !== undefined && tx.getTxHash().equals(txHash)) {
|
|
552
|
-
return tx;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
// Is it in the fetched missing txs?
|
|
557
|
-
// Note: this is an O(n^2) operation, but we expect the number of missing txs to be small.
|
|
558
|
-
for (const tx of missingTxs) {
|
|
559
|
-
if (tx.getTxHash().equals(txHash)) {
|
|
560
|
-
return tx;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
// Otherwise return undefined
|
|
565
|
-
return undefined;
|
|
566
|
-
});
|
|
567
|
-
|
|
568
|
-
return mergingTxs;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
470
|
/**
|
|
572
471
|
* Returns an archived transaction in the transaction pool by its hash.
|
|
573
472
|
* @param txHash - Hash of the archived transaction to look for.
|
|
@@ -770,20 +669,28 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
770
669
|
}
|
|
771
670
|
|
|
772
671
|
/**
|
|
773
|
-
* Returns true if the prune
|
|
774
|
-
* If the
|
|
775
|
-
* If they differ, the prune spans across checkpoints (epoch prune).
|
|
672
|
+
* Returns true if the prune is an epoch prune (new checkpoint number is less than old).
|
|
673
|
+
* If the checkpoint number stays the same or increases, the prune is within a checkpoint.
|
|
776
674
|
*/
|
|
777
675
|
private async isEpochPrune(newCheckpoint: CheckpointId): Promise<boolean> {
|
|
778
676
|
const tips = await this.l2Tips.getL2Tips();
|
|
779
677
|
const oldCheckpointNumber = tips.checkpointed.checkpoint.number;
|
|
780
|
-
if (oldCheckpointNumber <= CheckpointNumber.
|
|
678
|
+
if (oldCheckpointNumber <= CheckpointNumber.INITIAL) {
|
|
781
679
|
return false;
|
|
782
680
|
}
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
681
|
+
const newCheckpointNumber = newCheckpoint.number;
|
|
682
|
+
// We check that the new checkpoint number is less than the old checkpoint number in order to consider it an epoch prune.
|
|
683
|
+
// To be more certain that it is an epoch prune, we will check that at least 2 checkpoints were removed.
|
|
684
|
+
// This means we should avoid thinking checkpoints removed by L1 re-orgs are epoch prunes
|
|
685
|
+
const thresholdForEpochPrune = CheckpointNumber(oldCheckpointNumber - 2);
|
|
686
|
+
const isEpochPrune = newCheckpointNumber <= thresholdForEpochPrune;
|
|
687
|
+
if (isEpochPrune) {
|
|
688
|
+
this.log.info(`Detected epoch prune to ${newCheckpointNumber}`, {
|
|
689
|
+
oldCheckpointNumber,
|
|
690
|
+
newCheckpointNumber,
|
|
691
|
+
thresholdForEpochPrune,
|
|
692
|
+
});
|
|
693
|
+
}
|
|
787
694
|
return isEpochPrune;
|
|
788
695
|
}
|
|
789
696
|
|
|
@@ -834,8 +741,8 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
834
741
|
this.log.debug(`Moved from state ${P2PClientState[oldState]} to ${P2PClientState[this.currentState]}`);
|
|
835
742
|
}
|
|
836
743
|
|
|
837
|
-
public
|
|
838
|
-
return this.p2pService.
|
|
744
|
+
public validateTxsReceivedInBlockProposal(txs: Tx[]): Promise<void> {
|
|
745
|
+
return this.p2pService.validateTxsReceivedInBlockProposal(txs);
|
|
839
746
|
}
|
|
840
747
|
|
|
841
748
|
/**
|
|
@@ -8,7 +8,7 @@ import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
|
8
8
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
9
9
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
10
10
|
import type { ClientProtocolCircuitVerifier } from '@aztec/stdlib/interfaces/server';
|
|
11
|
-
import {
|
|
11
|
+
import { PeerErrorSeverity } from '@aztec/stdlib/p2p';
|
|
12
12
|
import type { Tx, TxValidationResult } from '@aztec/stdlib/tx';
|
|
13
13
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
14
14
|
|
|
@@ -20,8 +20,8 @@ import { BatchTxRequesterCollector, SendBatchRequestCollector } from '../../../s
|
|
|
20
20
|
import type { IBatchRequestTxValidator } from '../../../services/reqresp/batch-tx-requester/tx_validator.js';
|
|
21
21
|
import { RateLimitStatus } from '../../../services/reqresp/rate-limiter/rate_limiter.js';
|
|
22
22
|
import { MissingTxsTracker } from '../../../services/tx_collection/missing_txs_tracker.js';
|
|
23
|
-
import { AlwaysTrueCircuitVerifier } from '../../../test-helpers/index.js';
|
|
24
23
|
import {
|
|
24
|
+
AlwaysTrueCircuitVerifier,
|
|
25
25
|
BENCHMARK_CONSTANTS,
|
|
26
26
|
InMemoryAttestationPool,
|
|
27
27
|
InMemoryTxPool,
|
|
@@ -114,7 +114,6 @@ async function startClient(config: P2PConfig, clientIndex: number) {
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
client = await createP2PClient(
|
|
117
|
-
P2PClientType.Full,
|
|
118
117
|
config as P2PConfig & DataStoreConfig,
|
|
119
118
|
l2BlockSource as L2BlockSource & ContractDataSource,
|
|
120
119
|
proofVerifier as ClientProtocolCircuitVerifier,
|