@aztec/p2p 0.0.1-commit.6230a0c → 0.0.1-commit.64b6bbb
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 +5 -5
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +40 -9
- package/dest/client/interface.d.ts +33 -15
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +33 -36
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +104 -139
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +1 -1
- package/dest/config.d.ts +14 -5
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +11 -1
- package/dest/index.d.ts +2 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -0
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +102 -88
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +436 -3
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +2 -2
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +353 -87
- package/dest/mem_pools/attestation_pool/index.d.ts +2 -3
- package/dest/mem_pools/attestation_pool/index.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/index.js +1 -2
- package/dest/mem_pools/index.d.ts +3 -2
- package/dest/mem_pools/index.d.ts.map +1 -1
- package/dest/mem_pools/index.js +1 -1
- package/dest/mem_pools/interface.d.ts +5 -5
- package/dest/mem_pools/interface.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/archive/index.d.ts +2 -0
- package/dest/mem_pools/tx_pool_v2/archive/index.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/archive/index.js +1 -0
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts +43 -0
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.js +103 -0
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +87 -0
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/deleted_pool.js +180 -0
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts +47 -0
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.js +119 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +17 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +90 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +19 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +89 -0
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +10 -0
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/index.js +11 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +131 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.js +17 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts +15 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.js +63 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts +17 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +91 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +16 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +70 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +20 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +63 -0
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +15 -0
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +19 -0
- package/dest/mem_pools/tx_pool_v2/index.d.ts +6 -0
- package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/index.js +5 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +197 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.js +6 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +93 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +127 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts +26 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.js +70 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +99 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +332 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +55 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +156 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +69 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +751 -0
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +3 -3
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +3 -3
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/block_header_validator.d.ts +16 -3
- package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/block_header_validator.js +1 -1
- package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +13 -3
- package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/double_spend_validator.js +4 -4
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +20 -4
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/timestamp_validator.js +2 -2
- package/dest/services/dummy_service.d.ts +10 -2
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +6 -0
- package/dest/services/encoding.d.ts +2 -2
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +2 -2
- package/dest/services/gossipsub/index.d.ts +3 -0
- package/dest/services/gossipsub/index.d.ts.map +1 -0
- package/dest/services/gossipsub/index.js +2 -0
- package/dest/services/gossipsub/scoring.d.ts +21 -3
- package/dest/services/gossipsub/scoring.d.ts.map +1 -1
- package/dest/services/gossipsub/scoring.js +24 -7
- package/dest/services/gossipsub/topic_score_params.d.ts +161 -0
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -0
- package/dest/services/gossipsub/topic_score_params.js +324 -0
- package/dest/services/libp2p/libp2p_service.d.ts +84 -35
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +368 -273
- package/dest/services/peer-manager/peer_scoring.d.ts +1 -1
- package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_scoring.js +25 -2
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +4 -4
- 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 +8 -8
- package/dest/services/reqresp/interface.d.ts +10 -1
- package/dest/services/reqresp/interface.d.ts.map +1 -1
- package/dest/services/reqresp/interface.js +15 -1
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +7 -5
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.js +16 -11
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +21 -10
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +27 -11
- package/dest/services/reqresp/protocols/tx.d.ts +7 -1
- package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/tx.js +20 -0
- 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 +11 -4
- package/dest/services/service.d.ts +35 -1
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/config.d.ts +10 -4
- package/dest/services/tx_collection/config.d.ts.map +1 -1
- package/dest/services/tx_collection/config.js +19 -3
- package/dest/services/tx_collection/fast_tx_collection.d.ts +6 -5
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.js +27 -17
- package/dest/services/tx_collection/file_store_tx_collection.d.ts +44 -0
- package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -0
- package/dest/services/tx_collection/file_store_tx_collection.js +118 -0
- package/dest/services/tx_collection/file_store_tx_source.d.ts +27 -0
- package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -0
- package/dest/services/tx_collection/file_store_tx_source.js +57 -0
- package/dest/services/tx_collection/index.d.ts +3 -2
- package/dest/services/tx_collection/index.d.ts.map +1 -1
- package/dest/services/tx_collection/index.js +1 -0
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +12 -12
- package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -1
- package/dest/services/tx_collection/proposal_tx_collector.js +4 -5
- package/dest/services/tx_collection/slow_tx_collection.d.ts +3 -1
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/slow_tx_collection.js +48 -19
- package/dest/services/tx_collection/tx_collection.d.ts +17 -7
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection.js +58 -2
- package/dest/services/tx_collection/tx_collection_sink.d.ts +15 -6
- package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection_sink.js +13 -7
- package/dest/services/tx_file_store/config.d.ts +1 -3
- package/dest/services/tx_file_store/config.d.ts.map +1 -1
- package/dest/services/tx_file_store/config.js +0 -4
- package/dest/services/tx_file_store/tx_file_store.d.ts +3 -3
- package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -1
- 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 +5 -4
- package/dest/test-helpers/make-test-p2p-clients.d.ts +3 -3
- package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.d.ts +27 -1
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +97 -2
- package/dest/test-helpers/reqresp-nodes.d.ts +1 -1
- package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
- package/dest/test-helpers/reqresp-nodes.js +2 -1
- package/dest/test-helpers/testbench-utils.d.ts +38 -38
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +124 -61
- package/dest/testbench/p2p_client_testbench_worker.js +2 -2
- package/package.json +14 -14
- package/src/client/factory.ts +68 -12
- package/src/client/interface.ts +39 -14
- package/src/client/p2p_client.ts +139 -162
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +1 -1
- package/src/config.ts +26 -2
- package/src/index.ts +1 -0
- package/src/mem_pools/attestation_pool/attestation_pool.ts +488 -91
- package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +442 -102
- package/src/mem_pools/attestation_pool/index.ts +9 -2
- package/src/mem_pools/index.ts +4 -1
- package/src/mem_pools/interface.ts +4 -4
- package/src/mem_pools/tx_pool_v2/README.md +259 -0
- package/src/mem_pools/tx_pool_v2/archive/index.ts +1 -0
- package/src/mem_pools/tx_pool_v2/archive/tx_archive.ts +120 -0
- package/src/mem_pools/tx_pool_v2/deleted_pool.ts +234 -0
- package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +147 -0
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +118 -0
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +111 -0
- package/src/mem_pools/tx_pool_v2/eviction/index.ts +23 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +164 -0
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +74 -0
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +101 -0
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +86 -0
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +72 -0
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +31 -0
- package/src/mem_pools/tx_pool_v2/index.ts +12 -0
- package/src/mem_pools/tx_pool_v2/interfaces.ts +227 -0
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +207 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_bench_metrics.ts +77 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +417 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +212 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +895 -0
- package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +2 -2
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +2 -2
- package/src/msg_validators/tx_validator/block_header_validator.ts +15 -3
- package/src/msg_validators/tx_validator/double_spend_validator.ts +11 -6
- package/src/msg_validators/tx_validator/timestamp_validator.ts +19 -14
- package/src/services/dummy_service.ts +12 -0
- package/src/services/encoding.ts +2 -2
- package/src/services/gossipsub/README.md +626 -0
- package/src/services/gossipsub/index.ts +2 -0
- package/src/services/gossipsub/scoring.ts +29 -5
- package/src/services/gossipsub/topic_score_params.ts +451 -0
- package/src/services/libp2p/libp2p_service.ts +370 -275
- package/src/services/peer-manager/peer_scoring.ts +25 -0
- package/src/services/reqresp/batch-tx-requester/README.md +7 -7
- package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +11 -11
- package/src/services/reqresp/interface.ts +26 -1
- package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +23 -14
- package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +38 -15
- package/src/services/reqresp/protocols/tx.ts +22 -0
- package/src/services/reqresp/reqresp.ts +13 -3
- package/src/services/service.ts +40 -0
- package/src/services/tx_collection/config.ts +32 -6
- package/src/services/tx_collection/fast_tx_collection.ts +28 -26
- package/src/services/tx_collection/file_store_tx_collection.ts +152 -0
- package/src/services/tx_collection/file_store_tx_source.ts +70 -0
- package/src/services/tx_collection/index.ts +2 -1
- package/src/services/tx_collection/proposal_tx_collector.ts +12 -14
- package/src/services/tx_collection/slow_tx_collection.ts +55 -26
- package/src/services/tx_collection/tx_collection.ts +78 -12
- package/src/services/tx_collection/tx_collection_sink.ts +17 -7
- package/src/services/tx_file_store/config.ts +0 -6
- package/src/services/tx_file_store/tx_file_store.ts +4 -4
- package/src/services/tx_provider.ts +8 -7
- package/src/test-helpers/make-test-p2p-clients.ts +3 -3
- package/src/test-helpers/mock-pubsub.ts +133 -3
- package/src/test-helpers/reqresp-nodes.ts +2 -1
- package/src/test-helpers/testbench-utils.ts +122 -74
- package/src/testbench/p2p_client_testbench_worker.ts +2 -2
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +0 -40
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +0 -1
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +0 -218
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +0 -31
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +0 -1
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.js +0 -180
- package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +0 -320
- package/src/mem_pools/attestation_pool/memory_attestation_pool.ts +0 -264
|
@@ -374,6 +374,7 @@ var _dec, _dec1, _initProto;
|
|
|
374
374
|
import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/constants';
|
|
375
375
|
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
376
376
|
import { createLogger } from '@aztec/foundation/log';
|
|
377
|
+
import { RunningPromise } from '@aztec/foundation/promise';
|
|
377
378
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
378
379
|
import { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
379
380
|
import { L2BlockStream } from '@aztec/stdlib/block';
|
|
@@ -402,6 +403,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
402
403
|
p2pService;
|
|
403
404
|
txCollection;
|
|
404
405
|
txFileStore;
|
|
406
|
+
epochCache;
|
|
405
407
|
_dateProvider;
|
|
406
408
|
telemetry;
|
|
407
409
|
log;
|
|
@@ -434,15 +436,10 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
434
436
|
blockStream;
|
|
435
437
|
txProvider;
|
|
436
438
|
validatorAddresses;
|
|
437
|
-
/**
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
* @param txPool - The client's instance of a transaction pool. Defaults to in-memory implementation.
|
|
442
|
-
* @param p2pService - The concrete instance of p2p networking to use.
|
|
443
|
-
* @param log - A logger.
|
|
444
|
-
*/ constructor(_clientType, store, l2BlockSource, mempools, p2pService, txCollection, txFileStore, config = {}, _dateProvider = new DateProvider(), telemetry = getTelemetryClient(), log = createLogger('p2p')){
|
|
445
|
-
super(telemetry, 'P2PClient'), this.store = store, this.l2BlockSource = l2BlockSource, this.p2pService = p2pService, this.txCollection = txCollection, this.txFileStore = txFileStore, this._dateProvider = _dateProvider, this.telemetry = telemetry, this.log = log, this.currentState = (_initProto(this), P2PClientState.IDLE), this.syncPromise = Promise.resolve(), this.syncResolve = undefined, this.latestBlockNumberAtStart = -1, this.provenBlockNumberAtStart = -1, this.finalizedBlockNumberAtStart = -1, this.validatorAddresses = [];
|
|
439
|
+
/** Tracks the last slot for which we called prepareForSlot */ lastSlotProcessed;
|
|
440
|
+
/** Polls for slot changes and calls prepareForSlot on the tx pool */ slotMonitor;
|
|
441
|
+
constructor(_clientType, store, l2BlockSource, mempools, p2pService, txCollection, txFileStore, epochCache, config = {}, _dateProvider = new DateProvider(), telemetry = getTelemetryClient(), log = createLogger('p2p')){
|
|
442
|
+
super(telemetry, 'P2PClient'), this.store = store, this.l2BlockSource = l2BlockSource, this.p2pService = p2pService, this.txCollection = txCollection, this.txFileStore = txFileStore, this.epochCache = epochCache, this._dateProvider = _dateProvider, this.telemetry = telemetry, this.log = log, this.currentState = (_initProto(this), P2PClientState.IDLE), this.syncPromise = Promise.resolve(), this.syncResolve = undefined, this.latestBlockNumberAtStart = -1, this.provenBlockNumberAtStart = -1, this.finalizedBlockNumberAtStart = -1, this.validatorAddresses = [], this.lastSlotProcessed = SlotNumber.ZERO;
|
|
446
443
|
this.config = {
|
|
447
444
|
...getP2PDefaultConfig(),
|
|
448
445
|
...config
|
|
@@ -497,10 +494,9 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
497
494
|
getL2BlockHash(number) {
|
|
498
495
|
return this.l2Tips.getL2BlockHash(number);
|
|
499
496
|
}
|
|
500
|
-
updateP2PConfig(config) {
|
|
501
|
-
this.txPool.updateConfig(config);
|
|
497
|
+
async updateP2PConfig(config) {
|
|
498
|
+
await this.txPool.updateConfig(config);
|
|
502
499
|
this.p2pService.updateConfig(config);
|
|
503
|
-
return Promise.resolve();
|
|
504
500
|
}
|
|
505
501
|
getL2Tips() {
|
|
506
502
|
return this.l2Tips.getL2Tips();
|
|
@@ -527,7 +523,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
527
523
|
break;
|
|
528
524
|
case 'chain-pruned':
|
|
529
525
|
this.txCollection.stopCollectingForBlocksAfter(event.block.number);
|
|
530
|
-
await this.handlePruneL2Blocks(event.block
|
|
526
|
+
await this.handlePruneL2Blocks(event.block);
|
|
531
527
|
break;
|
|
532
528
|
case 'chain-checkpointed':
|
|
533
529
|
break;
|
|
@@ -542,7 +538,6 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
542
538
|
await this.startServiceIfSynched();
|
|
543
539
|
}
|
|
544
540
|
#assertIsReady() {
|
|
545
|
-
// this.log.info('Checking if p2p client is ready, current state: ', this.currentState);
|
|
546
541
|
if (!this.isReady()) {
|
|
547
542
|
throw new Error('P2P client not ready');
|
|
548
543
|
}
|
|
@@ -557,6 +552,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
557
552
|
if (this.currentState !== P2PClientState.IDLE) {
|
|
558
553
|
return this.syncPromise;
|
|
559
554
|
}
|
|
555
|
+
// Start the tx pool first, as it needs to hydrate state from persistence
|
|
556
|
+
await this.txPool.start();
|
|
560
557
|
// get the current latest block numbers
|
|
561
558
|
const latestBlockNumbers = await this.l2BlockSource.getL2Tips();
|
|
562
559
|
this.latestBlockNumberAtStart = latestBlockNumbers.proposed.number;
|
|
@@ -600,6 +597,9 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
600
597
|
this.blockStream.start();
|
|
601
598
|
await this.txCollection.start();
|
|
602
599
|
this.txFileStore?.start();
|
|
600
|
+
// Start slot monitor to call prepareForSlot when the slot changes
|
|
601
|
+
this.slotMonitor = new RunningPromise(()=>this.maybeCallPrepareForSlot(), this.log, this.config.slotCheckIntervalMS);
|
|
602
|
+
this.slotMonitor.start();
|
|
603
603
|
return this.syncPromise;
|
|
604
604
|
}
|
|
605
605
|
addReqRespSubProtocol(subProtocol, handler, validator) {
|
|
@@ -620,6 +620,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
620
620
|
* 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
|
|
621
621
|
*/ async stop() {
|
|
622
622
|
this.log.debug('Stopping p2p client...');
|
|
623
|
+
await this.slotMonitor?.stop();
|
|
624
|
+
this.log.debug('Stopped slot monitor');
|
|
623
625
|
await tryStop(this.txCollection);
|
|
624
626
|
this.log.debug('Stopped tx collection service');
|
|
625
627
|
await this.txFileStore?.stop();
|
|
@@ -628,6 +630,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
628
630
|
this.log.debug('Stopped p2p service');
|
|
629
631
|
await this.blockStream?.stop();
|
|
630
632
|
this.log.debug('Stopped block downloader');
|
|
633
|
+
await this.txPool.stop();
|
|
634
|
+
this.log.debug('Stopped tx pool');
|
|
631
635
|
await this.runningPromise;
|
|
632
636
|
this.setCurrentState(P2PClientState.STOPPED);
|
|
633
637
|
this.log.info('P2P client stopped');
|
|
@@ -639,7 +643,18 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
639
643
|
async broadcastProposal(proposal) {
|
|
640
644
|
this.log.verbose(`Broadcasting proposal for slot ${proposal.slotNumber} to peers`);
|
|
641
645
|
// Store our own proposal so we can respond to req/resp requests for it
|
|
642
|
-
await this.attestationPool.
|
|
646
|
+
const { count } = await this.attestationPool.tryAddBlockProposal(proposal);
|
|
647
|
+
if (count > 1) {
|
|
648
|
+
if (this.config.broadcastEquivocatedProposals) {
|
|
649
|
+
this.log.warn(`Broadcasting equivocated block proposal for slot ${proposal.slotNumber}`, {
|
|
650
|
+
slot: proposal.slotNumber,
|
|
651
|
+
archive: proposal.archive.toString(),
|
|
652
|
+
count
|
|
653
|
+
});
|
|
654
|
+
} else {
|
|
655
|
+
throw new Error(`Attempted to broadcast a duplicate block proposal for slot ${proposal.slotNumber}`);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
643
658
|
return this.p2pService.propagate(proposal);
|
|
644
659
|
}
|
|
645
660
|
async broadcastCheckpointProposal(proposal) {
|
|
@@ -647,7 +662,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
647
662
|
const blockProposal = proposal.getBlockProposal();
|
|
648
663
|
if (blockProposal) {
|
|
649
664
|
// Store our own last-block proposal so we can respond to req/resp requests for it.
|
|
650
|
-
await this.attestationPool.
|
|
665
|
+
await this.attestationPool.tryAddBlockProposal(blockProposal);
|
|
651
666
|
}
|
|
652
667
|
return this.p2pService.propagate(proposal);
|
|
653
668
|
}
|
|
@@ -658,8 +673,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
658
673
|
async getCheckpointAttestationsForSlot(slot, proposalId) {
|
|
659
674
|
return await (proposalId ? this.attestationPool.getCheckpointAttestationsForSlotAndProposal(slot, proposalId) : this.attestationPool.getCheckpointAttestationsForSlot(slot));
|
|
660
675
|
}
|
|
661
|
-
|
|
662
|
-
return this.attestationPool.
|
|
676
|
+
addOwnCheckpointAttestations(attestations) {
|
|
677
|
+
return this.attestationPool.addOwnCheckpointAttestations(attestations);
|
|
663
678
|
}
|
|
664
679
|
// REVIEW: https://github.com/AztecProtocol/aztec-packages/issues/7963
|
|
665
680
|
// ^ This pattern is not my favorite (md)
|
|
@@ -669,6 +684,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
669
684
|
registerCheckpointProposalHandler(handler) {
|
|
670
685
|
this.p2pService.registerCheckpointReceivedCallback(handler);
|
|
671
686
|
}
|
|
687
|
+
registerDuplicateProposalCallback(callback) {
|
|
688
|
+
this.p2pService.registerDuplicateProposalCallback(callback);
|
|
689
|
+
}
|
|
690
|
+
registerDuplicateAttestationCallback(callback) {
|
|
691
|
+
this.p2pService.registerDuplicateAttestationCallback(callback);
|
|
692
|
+
}
|
|
672
693
|
/**
|
|
673
694
|
* Uses the batched Request Response protocol to request a set of transactions from the network.
|
|
674
695
|
*/ async requestTxsByHash(txHashes, pinnedPeerId) {
|
|
@@ -679,73 +700,41 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
679
700
|
const txBatches = await this.p2pService.sendBatchRequest(ReqRespSubProtocol.TX, requests, pinnedPeerId, timeoutMs, maxPeers, maxRetryAttempts);
|
|
680
701
|
const txs = txBatches.flat();
|
|
681
702
|
if (txs.length > 0) {
|
|
682
|
-
await this.txPool.
|
|
703
|
+
await this.txPool.addPendingTxs(txs);
|
|
683
704
|
}
|
|
684
705
|
const txHashesStr = txHashes.map((tx)=>tx.toString()).join(', ');
|
|
685
706
|
this.log.debug(`Requested txs ${txHashesStr} (${txs.length} / ${txHashes.length}) from peers`);
|
|
686
707
|
// We return all transactions, even the not found ones to the caller, such they can handle missing items themselves.
|
|
687
708
|
return txs;
|
|
688
709
|
}
|
|
689
|
-
getPendingTxs(limit, after) {
|
|
690
|
-
return this.getTxs('pending', limit, after);
|
|
691
|
-
}
|
|
692
|
-
getPendingTxCount() {
|
|
693
|
-
return this.txPool.getPendingTxCount();
|
|
694
|
-
}
|
|
695
|
-
async *iteratePendingTxs() {
|
|
696
|
-
for (const txHash of (await this.txPool.getPendingTxHashes())){
|
|
697
|
-
const tx = await this.txPool.getTxByHash(txHash);
|
|
698
|
-
if (tx) {
|
|
699
|
-
yield tx;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
|
-
* Returns all transactions in the transaction pool.
|
|
705
|
-
* @param filter - The type of txs to return
|
|
706
|
-
* @param limit - How many txs to return
|
|
707
|
-
* @param after - If paginating, the last known tx hash. Will return txs after this hash
|
|
708
|
-
* @returns An array of Txs.
|
|
709
|
-
*/ async getTxs(filter, limit, after) {
|
|
710
|
+
async getPendingTxs(limit, after) {
|
|
710
711
|
if (limit !== undefined && limit <= 0) {
|
|
711
712
|
throw new TypeError('limit must be greater than 0');
|
|
712
713
|
}
|
|
713
|
-
let
|
|
714
|
-
let txHashes;
|
|
715
|
-
if (filter === 'all') {
|
|
716
|
-
txs = await this.txPool.getAllTxs();
|
|
717
|
-
txHashes = await Promise.all(txs.map((tx)=>tx.getTxHash()));
|
|
718
|
-
} else if (filter === 'mined') {
|
|
719
|
-
const minedTxHashes = await this.txPool.getMinedTxHashes();
|
|
720
|
-
txHashes = minedTxHashes.map(([txHash])=>txHash);
|
|
721
|
-
} else if (filter === 'pending') {
|
|
722
|
-
txHashes = await this.txPool.getPendingTxHashes();
|
|
723
|
-
} else {
|
|
724
|
-
const _ = filter;
|
|
725
|
-
throw new Error(`Unknown filter ${filter}`);
|
|
726
|
-
}
|
|
714
|
+
let txHashes = await this.txPool.getPendingTxHashes();
|
|
727
715
|
let startIndex = 0;
|
|
728
|
-
let endIndex = undefined;
|
|
729
716
|
if (after) {
|
|
730
717
|
startIndex = txHashes.findIndex((txHash)=>after.equals(txHash));
|
|
731
|
-
// if we can't find the last tx in our set then return an empty array as pagination is no longer valid.
|
|
732
718
|
if (startIndex === -1) {
|
|
733
719
|
return [];
|
|
734
720
|
}
|
|
735
|
-
// increment by one because we don't want to return the same tx again
|
|
736
721
|
startIndex++;
|
|
737
722
|
}
|
|
738
|
-
|
|
739
|
-
endIndex = startIndex + limit;
|
|
740
|
-
}
|
|
723
|
+
const endIndex = limit !== undefined ? startIndex + limit : undefined;
|
|
741
724
|
txHashes = txHashes.slice(startIndex, endIndex);
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
725
|
+
const maybeTxs = await Promise.all(txHashes.map((txHash)=>this.txPool.getTxByHash(txHash)));
|
|
726
|
+
return maybeTxs.filter((tx)=>!!tx);
|
|
727
|
+
}
|
|
728
|
+
getPendingTxCount() {
|
|
729
|
+
return this.txPool.getPendingTxCount();
|
|
730
|
+
}
|
|
731
|
+
async *iteratePendingTxs() {
|
|
732
|
+
for (const txHash of (await this.txPool.getPendingTxHashes())){
|
|
733
|
+
const tx = await this.txPool.getTxByHash(txHash);
|
|
734
|
+
if (tx) {
|
|
735
|
+
yield tx;
|
|
736
|
+
}
|
|
747
737
|
}
|
|
748
|
-
return txs;
|
|
749
738
|
}
|
|
750
739
|
/**
|
|
751
740
|
* Returns a transaction in the transaction pool by its hash.
|
|
@@ -808,16 +797,18 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
808
797
|
return this.txPool.getArchivedTxByHash(txHash);
|
|
809
798
|
}
|
|
810
799
|
/**
|
|
811
|
-
*
|
|
812
|
-
* @param tx - The tx to
|
|
800
|
+
* Accepts a transaction, adds it to local tx pool and forwards it to other peers.
|
|
801
|
+
* @param tx - The tx to send.
|
|
813
802
|
* @returns Empty promise.
|
|
814
803
|
**/ async sendTx(tx) {
|
|
815
|
-
|
|
804
|
+
this.#assertIsReady();
|
|
805
|
+
const result = await this.txPool.addPendingTxs([
|
|
816
806
|
tx
|
|
817
807
|
]);
|
|
818
|
-
|
|
819
|
-
if (txAddedSuccessfully) {
|
|
808
|
+
if (result.accepted.length === 1) {
|
|
820
809
|
await this.p2pService.propagate(tx);
|
|
810
|
+
} else {
|
|
811
|
+
this.log.warn(`Tx ${tx.getTxHash()} not propagated: accepted=${result.accepted.length} ignored=${result.ignored.length} rejected=${result.rejected.length}`);
|
|
821
812
|
}
|
|
822
813
|
}
|
|
823
814
|
/**
|
|
@@ -825,14 +816,15 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
825
816
|
* @param txs - The transactions.
|
|
826
817
|
**/ async addTxsToPool(txs) {
|
|
827
818
|
this.#assertIsReady();
|
|
828
|
-
return await this.txPool.
|
|
819
|
+
return (await this.txPool.addPendingTxs(txs)).accepted.length;
|
|
829
820
|
}
|
|
830
821
|
/**
|
|
831
822
|
* Returns whether the given tx hash is flagged as pending or mined.
|
|
832
823
|
* @param txHash - Hash of the tx to query.
|
|
833
824
|
* @returns Pending or mined depending on its status, or undefined if not found.
|
|
834
|
-
*/ getTxStatus(txHash) {
|
|
835
|
-
|
|
825
|
+
*/ async getTxStatus(txHash) {
|
|
826
|
+
const status = await this.txPool.getTxStatus(txHash);
|
|
827
|
+
return status === 'protected' ? 'pending' : status;
|
|
836
828
|
}
|
|
837
829
|
getEnr() {
|
|
838
830
|
return this.p2pService.getEnr();
|
|
@@ -841,13 +833,11 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
841
833
|
return Promise.resolve(this.p2pService.getEnr()?.encodeTxt());
|
|
842
834
|
}
|
|
843
835
|
/**
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
|
|
847
|
-
* @returns Empty promise.
|
|
848
|
-
**/ async deleteTxs(txHashes) {
|
|
836
|
+
* Handles failed transaction execution by removing txs from the pool.
|
|
837
|
+
* @param txHashes - Hashes of the transactions that failed execution.
|
|
838
|
+
**/ async handleFailedExecution(txHashes) {
|
|
849
839
|
this.#assertIsReady();
|
|
850
|
-
await this.txPool.
|
|
840
|
+
await this.txPool.handleFailedExecution(txHashes);
|
|
851
841
|
}
|
|
852
842
|
/**
|
|
853
843
|
* Public function to check if the p2p client is fully synced and ready to receive txs.
|
|
@@ -891,13 +881,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
891
881
|
};
|
|
892
882
|
}
|
|
893
883
|
/**
|
|
894
|
-
*
|
|
884
|
+
* Handles mined blocks by marking the txs in them as mined.
|
|
895
885
|
* @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
|
|
896
886
|
* @returns Empty promise.
|
|
897
|
-
*/ async
|
|
887
|
+
*/ async handleMinedBlocks(blocks) {
|
|
898
888
|
for (const block of blocks){
|
|
899
|
-
|
|
900
|
-
await this.txPool.markAsMined(txHashes, block.header);
|
|
889
|
+
await this.txPool.handleMinedBlock(block);
|
|
901
890
|
}
|
|
902
891
|
}
|
|
903
892
|
/**
|
|
@@ -906,14 +895,13 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
906
895
|
* @returns Empty promise.
|
|
907
896
|
*/ async handleLatestL2Blocks(blocks) {
|
|
908
897
|
if (!blocks.length) {
|
|
909
|
-
return
|
|
898
|
+
return;
|
|
910
899
|
}
|
|
911
|
-
await this.
|
|
912
|
-
await this.
|
|
900
|
+
await this.handleMinedBlocks(blocks);
|
|
901
|
+
await this.maybeCallPrepareForSlot();
|
|
913
902
|
await this.startCollectingMissingTxs(blocks);
|
|
914
903
|
const lastBlock = blocks.at(-1);
|
|
915
904
|
await this.synchedLatestSlot.set(BigInt(lastBlock.header.getSlot()));
|
|
916
|
-
this.log.verbose(`Synched to latest block ${lastBlock.number}`);
|
|
917
905
|
}
|
|
918
906
|
/** Request txs for unproven blocks so the prover node has more chances to get them. */ async startCollectingMissingTxs(blocks) {
|
|
919
907
|
try {
|
|
@@ -947,59 +935,26 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
947
935
|
* @returns Empty promise.
|
|
948
936
|
*/ async handleFinalizedL2Blocks(blocks) {
|
|
949
937
|
if (!blocks.length) {
|
|
950
|
-
return
|
|
938
|
+
return;
|
|
951
939
|
}
|
|
952
|
-
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
this.log.debug(`Deleting ${txHashes.length} txs from pool from finalized blocks up to ${lastBlockNum}`);
|
|
957
|
-
await this.txPool.deleteTxs(txHashes, {
|
|
958
|
-
permanently: true
|
|
959
|
-
});
|
|
960
|
-
await this.txPool.cleanupDeletedMinedTxs(lastBlockNum);
|
|
961
|
-
await this.attestationPool.deleteCheckpointAttestationsOlderThan(lastBlockSlot);
|
|
962
|
-
this.log.debug(`Synched to finalized block ${lastBlockNum} at slot ${lastBlockSlot}`);
|
|
940
|
+
// Finalization is monotonic, so we only need to call with the last block
|
|
941
|
+
const lastBlock = blocks.at(-1);
|
|
942
|
+
await this.txPool.handleFinalizedBlock(lastBlock.header);
|
|
943
|
+
await this.attestationPool.deleteOlderThan(lastBlock.header.getSlot());
|
|
963
944
|
}
|
|
964
945
|
/**
|
|
965
946
|
* Updates the tx pool after a chain prune.
|
|
966
|
-
* @param latestBlock - The block
|
|
947
|
+
* @param latestBlock - The block ID the chain was pruned to.
|
|
967
948
|
*/ async handlePruneL2Blocks(latestBlock) {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
const txHash = tx.getTxHash();
|
|
975
|
-
txsToDelete.set(txHash.toString(), txHash);
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
this.log.info(`Detected chain prune. Removing ${txsToDelete.size} txs built against pruned blocks.`, {
|
|
979
|
-
newLatestBlock: latestBlock,
|
|
980
|
-
previousLatestBlock: await this.getSyncedLatestBlockNum(),
|
|
981
|
-
txsToDelete: Array.from(txsToDelete.keys())
|
|
982
|
-
});
|
|
983
|
-
// delete invalid txs (both pending and mined)
|
|
984
|
-
await this.txPool.deleteTxs(Array.from(txsToDelete.values()));
|
|
985
|
-
// everything left in the mined set was built against a block on the proven chain so its still valid
|
|
986
|
-
// move back to pending the txs that were reorged out of the chain, unless txPoolDeleteTxsAfterReorg is set,
|
|
987
|
-
// in which case we clean them up to avoid potential reorg loops
|
|
988
|
-
// NOTE: we can't move _all_ txs back to pending because the tx pool could keep hold of mined txs for longer
|
|
989
|
-
// (see this.keepProvenTxsFor)
|
|
990
|
-
const minedTxsFromReorg = [];
|
|
991
|
-
for (const [txHash, blockNumber] of minedTxs){
|
|
992
|
-
// We keep the txsToDelete out of this list as they have already been deleted above
|
|
993
|
-
if (blockNumber > latestBlock && !txsToDelete.has(txHash.toString())) {
|
|
994
|
-
minedTxsFromReorg.push(txHash);
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
if (this.config.txPoolDeleteTxsAfterReorg) {
|
|
998
|
-
this.log.info(`Deleting ${minedTxsFromReorg.length} mined txs from reorg`);
|
|
999
|
-
await this.txPool.deleteTxs(minedTxsFromReorg);
|
|
1000
|
-
} else {
|
|
1001
|
-
await this.txPool.markMinedAsPending(minedTxsFromReorg, latestBlock);
|
|
949
|
+
await this.txPool.handlePrunedBlocks(latestBlock);
|
|
950
|
+
}
|
|
951
|
+
/** Checks if the slot has changed and calls prepareForSlot if so. */ async maybeCallPrepareForSlot() {
|
|
952
|
+
const { currentSlot } = this.epochCache.getCurrentAndNextSlot();
|
|
953
|
+
if (currentSlot <= this.lastSlotProcessed) {
|
|
954
|
+
return;
|
|
1002
955
|
}
|
|
956
|
+
this.lastSlotProcessed = currentSlot;
|
|
957
|
+
await this.txPool.prepareForSlot(currentSlot);
|
|
1003
958
|
}
|
|
1004
959
|
async startServiceIfSynched() {
|
|
1005
960
|
if (this.currentState !== P2PClientState.SYNCHING) {
|
|
@@ -1034,10 +989,20 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
1034
989
|
return this.p2pService.validate(txs);
|
|
1035
990
|
}
|
|
1036
991
|
/**
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1039
|
-
|
|
1040
|
-
|
|
992
|
+
* Protects existing transactions by hash for a given slot.
|
|
993
|
+
* Returns hashes of transactions that weren't found in the pool.
|
|
994
|
+
* @param txHashes - Hashes of the transactions to protect.
|
|
995
|
+
* @param blockHeader - The block header providing slot context.
|
|
996
|
+
* @returns Hashes of transactions not found in the pool.
|
|
997
|
+
*/ protectTxs(txHashes, blockHeader) {
|
|
998
|
+
return this.txPool.protectTxs(txHashes, blockHeader);
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Prepares the pool for a new slot.
|
|
1002
|
+
* Unprotects transactions from earlier slots and validates them.
|
|
1003
|
+
* @param slotNumber - The slot number to prepare for
|
|
1004
|
+
*/ async prepareForSlot(slotNumber) {
|
|
1005
|
+
await this.txPool.prepareForSlot(slotNumber);
|
|
1041
1006
|
}
|
|
1042
1007
|
handleAuthRequestFromPeer(authRequest, peerId) {
|
|
1043
1008
|
return this.p2pService.handleAuthRequestFromPeer(authRequest, peerId);
|
|
@@ -246,7 +246,7 @@ process.on('message', (msg)=>{
|
|
|
246
246
|
throw new Error('Attestation pool not initialized');
|
|
247
247
|
}
|
|
248
248
|
const proposal = deserializeBlockProposal(msg.blockProposal);
|
|
249
|
-
await attestationPool.
|
|
249
|
+
await attestationPool.tryAddBlockProposal(proposal);
|
|
250
250
|
await sendMessage({
|
|
251
251
|
type: 'BLOCK_PROPOSAL_SET',
|
|
252
252
|
requestId,
|
package/dest/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ConfigMappingsType, SecretValue } from '@aztec/foundation/config';
|
|
2
2
|
import { type DataStoreConfig } from '@aztec/kv-store/config';
|
|
3
|
-
import { type AllowedElement, type ChainConfig } from '@aztec/stdlib/config';
|
|
3
|
+
import { type AllowedElement, type ChainConfig, type SequencerConfig } from '@aztec/stdlib/config';
|
|
4
4
|
import { type BatchTxRequesterConfig } from './services/reqresp/batch-tx-requester/config.js';
|
|
5
5
|
import { type P2PReqRespConfig } from './services/reqresp/config.js';
|
|
6
6
|
import { type TxCollectionConfig } from './services/tx_collection/config.js';
|
|
@@ -8,11 +8,13 @@ import { type TxFileStoreConfig } from './services/tx_file_store/config.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* P2P client configuration values.
|
|
10
10
|
*/
|
|
11
|
-
export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, ChainConfig, TxCollectionConfig, TxFileStoreConfig {
|
|
11
|
+
export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, ChainConfig, TxCollectionConfig, TxFileStoreConfig, Pick<SequencerConfig, 'blockDurationMs'> {
|
|
12
12
|
/** A flag dictating whether the P2P subsystem should be enabled. */
|
|
13
13
|
p2pEnabled: boolean;
|
|
14
14
|
/** The frequency in which to check for new L2 blocks. */
|
|
15
15
|
blockCheckIntervalMS: number;
|
|
16
|
+
/** The frequency in which to check for new L2 slots. */
|
|
17
|
+
slotCheckIntervalMS: number;
|
|
16
18
|
/** The number of blocks to fetch in a single batch. */
|
|
17
19
|
blockRequestBatchSize: number;
|
|
18
20
|
/** DEBUG: Disable colocation penalty - for testing purposes only */
|
|
@@ -107,6 +109,8 @@ export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, Cha
|
|
|
107
109
|
debugP2PInstrumentMessages: boolean;
|
|
108
110
|
/** Whether to run in fisherman mode: validates all proposals and attestations but does not broadcast attestations or participate in consensus */
|
|
109
111
|
fishermanMode: boolean;
|
|
112
|
+
/** Broadcast block proposals even when a conflicting proposal for the same slot already exists in the pool (for testing purposes only). */
|
|
113
|
+
broadcastEquivocatedProposals?: boolean;
|
|
110
114
|
}
|
|
111
115
|
export declare const DEFAULT_P2P_PORT = 40400;
|
|
112
116
|
export declare const p2pConfigMappings: ConfigMappingsType<P2PConfig>;
|
|
@@ -127,10 +131,12 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
127
131
|
batchTxRequesterSmartParallelWorkerCount: unknown;
|
|
128
132
|
batchTxRequesterTxBatchSize: unknown;
|
|
129
133
|
blockCheckIntervalMS: unknown;
|
|
134
|
+
blockDurationMs: unknown;
|
|
130
135
|
blockRequestBatchSize: unknown;
|
|
131
136
|
bootstrapNodeEnrVersionCheck: unknown;
|
|
132
137
|
bootstrapNodes: unknown;
|
|
133
138
|
bootstrapNodesAsFullPeers: unknown;
|
|
139
|
+
broadcastEquivocatedProposals: unknown;
|
|
134
140
|
dataDirectory: unknown;
|
|
135
141
|
dataStoreMapSizeKb: unknown;
|
|
136
142
|
debugDisableColocationPenalty: unknown;
|
|
@@ -180,19 +186,22 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
180
186
|
queryForIp: unknown;
|
|
181
187
|
rollupVersion: unknown;
|
|
182
188
|
seenMessageCacheSize: unknown;
|
|
189
|
+
slotCheckIntervalMS: unknown;
|
|
183
190
|
trustedPeers: unknown;
|
|
184
191
|
txCollectionDisableSlowDuringFastRequests: unknown;
|
|
185
192
|
txCollectionFastMaxParallelRequestsPerNode: unknown;
|
|
186
193
|
txCollectionFastNodeIntervalMs: unknown;
|
|
187
194
|
txCollectionFastNodesTimeoutBeforeReqRespMs: unknown;
|
|
195
|
+
txCollectionFileStoreFastDelayMs: unknown;
|
|
196
|
+
txCollectionFileStoreSlowDelayMs: unknown;
|
|
197
|
+
txCollectionFileStoreUrls: unknown;
|
|
198
|
+
txCollectionMissingTxsCollectorType: unknown;
|
|
188
199
|
txCollectionNodeRpcMaxBatchSize: unknown;
|
|
189
200
|
txCollectionNodeRpcUrls: unknown;
|
|
190
|
-
txCollectionProposalTxCollectorType: unknown;
|
|
191
201
|
txCollectionReconcileIntervalMs: unknown;
|
|
192
202
|
txCollectionSlowNodesIntervalMs: unknown;
|
|
193
203
|
txCollectionSlowReqRespIntervalMs: unknown;
|
|
194
204
|
txCollectionSlowReqRespTimeoutMs: unknown;
|
|
195
|
-
txFileStoreDownloadUrl: unknown;
|
|
196
205
|
txFileStoreEnabled: unknown;
|
|
197
206
|
txFileStoreMaxQueueSize: unknown;
|
|
198
207
|
txFileStoreUploadConcurrency: unknown;
|
|
@@ -212,4 +221,4 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
212
221
|
* @returns A list of allowed elements
|
|
213
222
|
*/
|
|
214
223
|
export declare function parseAllowList(value: string): AllowedElement[];
|
|
215
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
224
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLGtCQUFrQixFQUN2QixXQUFXLEVBUVosTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQXNCLE1BQU0sd0JBQXdCLENBQUM7QUFHbEYsT0FBTyxFQUNMLEtBQUssY0FBYyxFQUNuQixLQUFLLFdBQVcsRUFDaEIsS0FBSyxlQUFlLEVBR3JCLE1BQU0sc0JBQXNCLENBQUM7QUFFOUIsT0FBTyxFQUNMLEtBQUssc0JBQXNCLEVBRTVCLE1BQU0saURBQWlELENBQUM7QUFDekQsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQTRCLE1BQU0sOEJBQThCLENBQUM7QUFDL0YsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQThCLE1BQU0sb0NBQW9D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f,GACC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC,GAC9C,IAAI,CAAC,eAAe,EAAE,eAAe,GAAG,oBAAoB,CAAC,GAC7D,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAgBjC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sMAGlC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAqC9D"}
|
package/dest/config.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
4
4
|
import { FunctionSelector } from '@aztec/stdlib/abi/function-selector';
|
|
5
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
6
|
+
import { chainConfigMappings, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
|
|
7
7
|
import { batchTxRequesterConfigMappings } from './services/reqresp/batch-tx-requester/config.js';
|
|
8
8
|
import { p2pReqRespConfigMappings } from './services/reqresp/config.js';
|
|
9
9
|
import { txCollectionConfigMappings } from './services/tx_collection/config.js';
|
|
@@ -25,6 +25,11 @@ export const p2pConfigMappings = {
|
|
|
25
25
|
description: 'The frequency in which to check for new L2 blocks.',
|
|
26
26
|
...numberConfigHelper(100)
|
|
27
27
|
},
|
|
28
|
+
slotCheckIntervalMS: {
|
|
29
|
+
env: 'P2P_SLOT_CHECK_INTERVAL_MS',
|
|
30
|
+
description: 'The frequency in which to check for new L2 slots.',
|
|
31
|
+
...numberConfigHelper(1000)
|
|
32
|
+
},
|
|
28
33
|
debugDisableColocationPenalty: {
|
|
29
34
|
env: 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY',
|
|
30
35
|
description: 'DEBUG: Disable colocation penalty - NEVER set to true in production',
|
|
@@ -264,6 +269,11 @@ export const p2pConfigMappings = {
|
|
|
264
269
|
description: 'Whether to run in fisherman mode: validates all proposals and attestations but does not broadcast attestations or participate in consensus.',
|
|
265
270
|
...booleanConfigHelper(false)
|
|
266
271
|
},
|
|
272
|
+
broadcastEquivocatedProposals: {
|
|
273
|
+
description: 'Broadcast block proposals even when a conflicting proposal for the same slot already exists in the pool (for testing purposes only).',
|
|
274
|
+
...booleanConfigHelper(false)
|
|
275
|
+
},
|
|
276
|
+
...sharedSequencerConfigMappings,
|
|
267
277
|
...p2pReqRespConfigMappings,
|
|
268
278
|
...batchTxRequesterConfigMappings,
|
|
269
279
|
...chainConfigMappings,
|
package/dest/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './enr/index.js';
|
|
|
6
6
|
export * from './config.js';
|
|
7
7
|
export * from './mem_pools/attestation_pool/index.js';
|
|
8
8
|
export * from './mem_pools/tx_pool/index.js';
|
|
9
|
+
export * from './mem_pools/tx_pool_v2/index.js';
|
|
9
10
|
export * from './msg_validators/index.js';
|
|
10
11
|
export * from './services/index.js';
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRSxZQUFZLEVBQUUsTUFBTSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFaEQsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyx1Q0FBdUMsQ0FBQztBQUN0RCxjQUFjLDhCQUE4QixDQUFDO0FBQzdDLGNBQWMsaUNBQWlDLENBQUM7QUFDaEQsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLHFCQUFxQixDQUFDIn0=
|
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC"}
|
package/dest/index.js
CHANGED
|
@@ -5,5 +5,6 @@ export * from './enr/index.js';
|
|
|
5
5
|
export * from './config.js';
|
|
6
6
|
export * from './mem_pools/attestation_pool/index.js';
|
|
7
7
|
export * from './mem_pools/tx_pool/index.js';
|
|
8
|
+
export * from './mem_pools/tx_pool_v2/index.js';
|
|
8
9
|
export * from './msg_validators/index.js';
|
|
9
10
|
export * from './services/index.js';
|