@aztec/p2p 0.0.1-commit.7cf39cb55 → 0.0.1-commit.808bf7f90
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/client/factory.d.ts +3 -2
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +5 -3
- package/dest/client/interface.d.ts +7 -9
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +4 -7
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +38 -14
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +5 -5
- package/dest/config.d.ts +4 -6
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +0 -5
- package/dest/errors/tx-pool.error.d.ts +8 -0
- package/dest/errors/tx-pool.error.d.ts.map +1 -0
- package/dest/errors/tx-pool.error.js +9 -0
- package/dest/mem_pools/attestation_pool/mocks.d.ts +2 -2
- package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/mocks.js +2 -2
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.js +3 -3
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +3 -1
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/deleted_pool.js +9 -0
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts +3 -3
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.js +18 -9
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +3 -3
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +3 -3
- 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 +10 -4
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/index.js +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +48 -5
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.js +8 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.js +4 -4
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +5 -5
- 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 +12 -6
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +4 -4
- 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 +14 -4
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +3 -3
- 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/instrumentation.d.ts +15 -0
- package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/instrumentation.js +43 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +12 -2
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.js +3 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +7 -5
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +29 -5
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +5 -2
- 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 +12 -2
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +5 -2
- 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 +6 -5
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +10 -4
- 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 +240 -124
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.js +3 -3
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +2 -2
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/timestamp_validator.js +6 -6
- package/dest/services/dummy_service.d.ts +3 -2
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +3 -0
- package/dest/services/encoding.d.ts +1 -1
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +2 -1
- 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 +2 -1
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +7 -3
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +4 -3
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +5 -9
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts +2 -6
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +10 -13
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.js +25 -46
- package/dest/services/service.d.ts +4 -2
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.d.ts +1 -1
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.js +39 -33
- package/dest/services/tx_collection/file_store_tx_collection.d.ts +1 -1
- package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_collection.js +4 -2
- package/dest/services/tx_collection/file_store_tx_source.d.ts +15 -6
- package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_source.js +47 -16
- package/dest/services/tx_collection/instrumentation.d.ts +1 -1
- package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
- package/dest/services/tx_collection/instrumentation.js +2 -1
- package/dest/services/tx_collection/missing_txs_tracker.d.ts +32 -0
- package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +1 -0
- package/dest/services/tx_collection/missing_txs_tracker.js +27 -0
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +7 -6
- package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -1
- package/dest/services/tx_collection/proposal_tx_collector.js +5 -4
- package/dest/services/tx_collection/slow_tx_collection.d.ts +2 -2
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/slow_tx_collection.js +10 -8
- package/dest/services/tx_collection/tx_collection.d.ts +5 -4
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection_sink.d.ts +6 -5
- package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection_sink.js +13 -22
- package/dest/services/tx_collection/tx_source.d.ts +8 -3
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_source.js +19 -2
- package/dest/services/tx_file_store/tx_file_store.js +1 -1
- package/dest/test-helpers/mock-pubsub.d.ts +3 -2
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +6 -0
- package/dest/test-helpers/testbench-utils.d.ts +5 -2
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +1 -1
- package/dest/testbench/p2p_client_testbench_worker.d.ts +2 -2
- package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
- package/dest/testbench/p2p_client_testbench_worker.js +8 -8
- 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 +6 -2
- package/src/client/interface.ts +14 -9
- package/src/client/p2p_client.ts +44 -17
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +18 -8
- package/src/config.ts +2 -10
- package/src/errors/tx-pool.error.ts +12 -0
- package/src/mem_pools/attestation_pool/mocks.ts +2 -1
- package/src/mem_pools/tx_pool/README.md +1 -1
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/README.md +1 -1
- package/src/mem_pools/tx_pool_v2/deleted_pool.ts +11 -0
- package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +21 -8
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +15 -4
- package/src/mem_pools/tx_pool_v2/eviction/index.ts +4 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +49 -4
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +4 -4
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +5 -5
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +12 -9
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +24 -6
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/instrumentation.ts +69 -0
- package/src/mem_pools/tx_pool_v2/interfaces.ts +11 -2
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +40 -9
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +14 -3
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +11 -6
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +262 -117
- package/src/msg_validators/tx_validator/gas_validator.ts +11 -3
- package/src/msg_validators/tx_validator/timestamp_validator.ts +7 -7
- package/src/services/dummy_service.ts +5 -1
- package/src/services/encoding.ts +2 -1
- 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 +7 -2
- package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +6 -6
- package/src/services/reqresp/batch-tx-requester/interface.ts +1 -5
- package/src/services/reqresp/batch-tx-requester/missing_txs.ts +23 -71
- package/src/services/service.ts +10 -1
- package/src/services/tx_collection/fast_tx_collection.ts +51 -30
- package/src/services/tx_collection/file_store_tx_collection.ts +7 -3
- package/src/services/tx_collection/file_store_tx_source.ts +61 -17
- package/src/services/tx_collection/instrumentation.ts +7 -1
- package/src/services/tx_collection/missing_txs_tracker.ts +52 -0
- package/src/services/tx_collection/proposal_tx_collector.ts +8 -7
- package/src/services/tx_collection/slow_tx_collection.ts +8 -9
- package/src/services/tx_collection/tx_collection.ts +4 -3
- package/src/services/tx_collection/tx_collection_sink.ts +15 -29
- package/src/services/tx_collection/tx_source.ts +22 -3
- package/src/services/tx_file_store/tx_file_store.ts +1 -1
- package/src/test-helpers/mock-pubsub.ts +10 -0
- package/src/test-helpers/testbench-utils.ts +2 -2
- package/src/testbench/p2p_client_testbench_worker.ts +20 -13
- package/src/util.ts +7 -1
|
@@ -6,9 +6,11 @@ import type { Tx, TxHash } from '@aztec/stdlib/tx';
|
|
|
6
6
|
import { type ComponentsVersions, getComponentsVersionsFromConfig } from '@aztec/stdlib/versioning';
|
|
7
7
|
import { makeTracedFetch } from '@aztec/telemetry-client';
|
|
8
8
|
|
|
9
|
+
export type TxSourceCollectionResult = { validTxs: Tx[]; invalidTxHashes: string[] };
|
|
10
|
+
|
|
9
11
|
export interface TxSource {
|
|
10
12
|
getInfo(): string;
|
|
11
|
-
getTxsByHash(txHashes: TxHash[]): Promise<
|
|
13
|
+
getTxsByHash(txHashes: TxHash[]): Promise<TxSourceCollectionResult>;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export class NodeRpcTxSource implements TxSource {
|
|
@@ -26,8 +28,25 @@ export class NodeRpcTxSource implements TxSource {
|
|
|
26
28
|
return this.info;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
public getTxsByHash(txHashes: TxHash[]): Promise<
|
|
30
|
-
return this.client.getTxsByHash(txHashes);
|
|
31
|
+
public async getTxsByHash(txHashes: TxHash[]): Promise<TxSourceCollectionResult> {
|
|
32
|
+
return this.verifyTxs(await this.client.getTxsByHash(txHashes));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private async verifyTxs(txs: Tx[]): Promise<TxSourceCollectionResult> {
|
|
36
|
+
// Validate tx hashes for all collected txs from external sources
|
|
37
|
+
const validTxs: Tx[] = [];
|
|
38
|
+
const invalidTxHashes: string[] = [];
|
|
39
|
+
await Promise.all(
|
|
40
|
+
txs.map(async tx => {
|
|
41
|
+
const isValid = await tx.validateTxHash();
|
|
42
|
+
if (isValid) {
|
|
43
|
+
validTxs.push(tx);
|
|
44
|
+
} else {
|
|
45
|
+
invalidTxHashes.push(tx.getTxHash().toString());
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
return { validTxs: validTxs, invalidTxHashes: invalidTxHashes };
|
|
31
50
|
}
|
|
32
51
|
}
|
|
33
52
|
|
|
@@ -146,7 +146,7 @@ export class TxFileStore {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
await retry(
|
|
149
|
-
() => this.fileStore.save(path, tx.toBuffer(), { compress:
|
|
149
|
+
() => this.fileStore.save(path, tx.toBuffer(), { compress: true }),
|
|
150
150
|
`Uploading tx ${txHash}`,
|
|
151
151
|
makeBackoff([0.1, 0.5, 2]),
|
|
152
152
|
this.log,
|
|
@@ -270,6 +270,16 @@ class MockGossipSubService extends TypedEventEmitter<GossipsubEvents> implements
|
|
|
270
270
|
{ msgId, propagationSource, acceptance },
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
+
|
|
274
|
+
getMeshPeers(topic?: TopicStr): PeerIdStr[] {
|
|
275
|
+
if (topic && !this.subscribedTopics.has(topic)) {
|
|
276
|
+
return [];
|
|
277
|
+
}
|
|
278
|
+
return this.network
|
|
279
|
+
.getPeers()
|
|
280
|
+
.filter(peer => !this.peerId.equals(peer))
|
|
281
|
+
.map(peer => peer.toString());
|
|
282
|
+
}
|
|
273
283
|
}
|
|
274
284
|
|
|
275
285
|
/**
|
|
@@ -59,7 +59,7 @@ export class InMemoryTxPool extends EventEmitter implements TxPoolV2 {
|
|
|
59
59
|
|
|
60
60
|
// === Core Operations (TxPoolV2) ===
|
|
61
61
|
|
|
62
|
-
addPendingTxs(txs: Tx[], opts?: { source?: string }): Promise<AddTxsResult> {
|
|
62
|
+
addPendingTxs(txs: Tx[], opts?: { source?: string; feeComparisonOnly?: boolean }): Promise<AddTxsResult> {
|
|
63
63
|
const accepted: TxHash[] = [];
|
|
64
64
|
const newTxs: Tx[] = [];
|
|
65
65
|
for (const tx of txs) {
|
|
@@ -123,7 +123,7 @@ export class InMemoryTxPool extends EventEmitter implements TxPoolV2 {
|
|
|
123
123
|
return Promise.resolve();
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
handlePrunedBlocks(_latestBlock: L2BlockId): Promise<void> {
|
|
126
|
+
handlePrunedBlocks(_latestBlock: L2BlockId, _options?: { deleteAllTxs?: boolean }): Promise<void> {
|
|
127
127
|
return Promise.resolve();
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -29,22 +29,19 @@ import type { Message, PeerId } from '@libp2p/interface';
|
|
|
29
29
|
import { TopicValidatorResult } from '@libp2p/interface';
|
|
30
30
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
31
31
|
|
|
32
|
-
import type { P2PClient } from '../client/
|
|
32
|
+
import type { P2PClient } from '../client/index.js';
|
|
33
33
|
import type { P2PConfig } from '../config.js';
|
|
34
34
|
import { createP2PClient } from '../index.js';
|
|
35
|
-
import type { MemPools } from '../mem_pools/
|
|
36
|
-
import { LibP2PService } from '../services/
|
|
35
|
+
import type { MemPools } from '../mem_pools/index.js';
|
|
36
|
+
import { BatchTxRequesterCollector, LibP2PService, SendBatchRequestCollector } from '../services/index.js';
|
|
37
37
|
import type { PeerManager } from '../services/peer-manager/peer_manager.js';
|
|
38
38
|
import type { BatchTxRequesterLibP2PService } from '../services/reqresp/batch-tx-requester/interface.js';
|
|
39
39
|
import type { IBatchRequestTxValidator } from '../services/reqresp/batch-tx-requester/tx_validator.js';
|
|
40
40
|
import { RateLimitStatus } from '../services/reqresp/rate-limiter/rate_limiter.js';
|
|
41
41
|
import type { ReqResp } from '../services/reqresp/reqresp.js';
|
|
42
42
|
import type { PeerDiscoveryService } from '../services/service.js';
|
|
43
|
-
import {
|
|
44
|
-
|
|
45
|
-
SendBatchRequestCollector,
|
|
46
|
-
} from '../services/tx_collection/proposal_tx_collector.js';
|
|
47
|
-
import { AlwaysTrueCircuitVerifier } from '../test-helpers/reqresp-nodes.js';
|
|
43
|
+
import { MissingTxsTracker } from '../services/tx_collection/missing_txs_tracker.js';
|
|
44
|
+
import { AlwaysTrueCircuitVerifier } from '../test-helpers/index.js';
|
|
48
45
|
import {
|
|
49
46
|
BENCHMARK_CONSTANTS,
|
|
50
47
|
type CollectorType,
|
|
@@ -55,7 +52,7 @@ import {
|
|
|
55
52
|
createMockEpochCache,
|
|
56
53
|
createMockWorldStateSynchronizer,
|
|
57
54
|
filterTxsByDistribution,
|
|
58
|
-
} from '../test-helpers/
|
|
55
|
+
} from '../test-helpers/index.js';
|
|
59
56
|
import type { PubSubLibp2p } from '../util.js';
|
|
60
57
|
|
|
61
58
|
export type { DistributionPattern, CollectorType } from '../test-helpers/testbench-utils.js';
|
|
@@ -166,7 +163,7 @@ async function generateDeterministicTxs(txCount: number, seed: number, config: P
|
|
|
166
163
|
return cached.slice(0, txCount);
|
|
167
164
|
}
|
|
168
165
|
|
|
169
|
-
const
|
|
166
|
+
const expirationTimestampBase = BigInt(seed);
|
|
170
167
|
for (let i = cached.length; i < txCount; i++) {
|
|
171
168
|
const txSeed = seed * 10000 + i;
|
|
172
169
|
const tx = await mockTx(txSeed, {
|
|
@@ -182,7 +179,7 @@ async function generateDeterministicTxs(txCount: number, seed: number, config: P
|
|
|
182
179
|
hasPublicTeardownCallRequest: false,
|
|
183
180
|
publicCalldataSize: 0,
|
|
184
181
|
});
|
|
185
|
-
tx.data.
|
|
182
|
+
tx.data.expirationTimestamp = expirationTimestampBase + BigInt(i);
|
|
186
183
|
await tx.recomputeHash();
|
|
187
184
|
cached.push(tx);
|
|
188
185
|
}
|
|
@@ -277,7 +274,12 @@ async function runAggregatorBenchmark(
|
|
|
277
274
|
new DateProvider(),
|
|
278
275
|
noopTxValidator,
|
|
279
276
|
);
|
|
280
|
-
const fetchedTxs = await collector.collectTxs(
|
|
277
|
+
const fetchedTxs = await collector.collectTxs(
|
|
278
|
+
MissingTxsTracker.fromArray(txHashes),
|
|
279
|
+
blockProposal,
|
|
280
|
+
pinnedPeer,
|
|
281
|
+
timeoutMs,
|
|
282
|
+
);
|
|
281
283
|
const durationMs = timer.ms();
|
|
282
284
|
return {
|
|
283
285
|
type: 'BENCH_RESULT',
|
|
@@ -292,7 +294,12 @@ async function runAggregatorBenchmark(
|
|
|
292
294
|
BENCHMARK_CONSTANTS.FIXED_MAX_PEERS,
|
|
293
295
|
BENCHMARK_CONSTANTS.FIXED_MAX_RETRY_ATTEMPTS,
|
|
294
296
|
);
|
|
295
|
-
const fetchedTxs = await collector.collectTxs(
|
|
297
|
+
const fetchedTxs = await collector.collectTxs(
|
|
298
|
+
MissingTxsTracker.fromArray(txHashes),
|
|
299
|
+
blockProposal,
|
|
300
|
+
pinnedPeer,
|
|
301
|
+
timeoutMs,
|
|
302
|
+
);
|
|
296
303
|
const durationMs = timer.ms();
|
|
297
304
|
return {
|
|
298
305
|
type: 'BENCH_RESULT',
|
package/src/util.ts
CHANGED
|
@@ -23,7 +23,13 @@ export interface PubSubLibp2p extends Pick<Libp2p, 'status' | 'start' | 'stop' |
|
|
|
23
23
|
services: {
|
|
24
24
|
pubsub: Pick<
|
|
25
25
|
GossipSub,
|
|
26
|
-
|
|
26
|
+
| 'addEventListener'
|
|
27
|
+
| 'removeEventListener'
|
|
28
|
+
| 'publish'
|
|
29
|
+
| 'subscribe'
|
|
30
|
+
| 'reportMessageValidationResult'
|
|
31
|
+
| 'direct'
|
|
32
|
+
| 'getMeshPeers'
|
|
27
33
|
> & { score: Pick<GossipSub['score'], 'score'> };
|
|
28
34
|
};
|
|
29
35
|
}
|