@aztec/p2p 0.0.1-commit.8afd444 → 0.0.1-commit.8f9871590
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 +44 -10
- package/dest/client/interface.d.ts +37 -15
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +35 -36
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +114 -138
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +1 -1
- package/dest/config.d.ts +23 -5
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +16 -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 +104 -88
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +441 -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/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/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/eviction/invalid_txs_after_mining_rule.js +3 -3
- 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 +102 -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 +242 -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 +93 -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 +65 -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 +93 -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 +72 -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 +201 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.js +7 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +95 -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 +128 -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 +105 -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 +345 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +57 -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 +160 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +71 -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 +780 -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 +6 -6
- 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 +370 -275
- 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 +22 -4
- package/dest/services/tx_collection/config.d.ts.map +1 -1
- package/dest/services/tx_collection/config.js +49 -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 +53 -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 +165 -0
- package/dest/services/tx_collection/file_store_tx_source.d.ts +28 -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 +59 -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 +6 -2
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/slow_tx_collection.js +55 -23
- package/dest/services/tx_collection/tx_collection.d.ts +19 -7
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection.js +75 -3
- 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 +4 -3
- package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -1
- package/dest/services/tx_file_store/tx_file_store.js +8 -5
- 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 +40 -38
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +128 -59
- package/dest/testbench/p2p_client_testbench_worker.js +4 -4
- package/package.json +14 -14
- package/src/client/factory.ts +81 -13
- package/src/client/interface.ts +45 -14
- package/src/client/p2p_client.ts +151 -161
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +1 -1
- package/src/config.ts +34 -2
- package/src/index.ts +1 -0
- package/src/mem_pools/attestation_pool/attestation_pool.ts +496 -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/attestation_pool/mocks.ts +2 -1
- package/src/mem_pools/index.ts +4 -1
- package/src/mem_pools/interface.ts +4 -4
- 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 +275 -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 +310 -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 +121 -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 +88 -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 +233 -0
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +211 -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 +433 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +218 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +924 -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 +23 -18
- 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 +372 -277
- 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 +74 -6
- package/src/services/tx_collection/fast_tx_collection.ts +28 -26
- package/src/services/tx_collection/file_store_tx_collection.ts +198 -0
- package/src/services/tx_collection/file_store_tx_source.ts +73 -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 +64 -30
- package/src/services/tx_collection/tx_collection.ts +109 -13
- 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 +9 -7
- 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 +127 -71
- package/src/testbench/p2p_client_testbench_worker.ts +4 -4
- 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,11 @@ _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);
|
|
678
|
+
}
|
|
679
|
+
hasBlockProposalsForSlot(slot) {
|
|
680
|
+
return this.attestationPool.hasBlockProposalsForSlot(slot);
|
|
663
681
|
}
|
|
664
682
|
// REVIEW: https://github.com/AztecProtocol/aztec-packages/issues/7963
|
|
665
683
|
// ^ This pattern is not my favorite (md)
|
|
@@ -669,6 +687,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
669
687
|
registerCheckpointProposalHandler(handler) {
|
|
670
688
|
this.p2pService.registerCheckpointReceivedCallback(handler);
|
|
671
689
|
}
|
|
690
|
+
registerDuplicateProposalCallback(callback) {
|
|
691
|
+
this.p2pService.registerDuplicateProposalCallback(callback);
|
|
692
|
+
}
|
|
693
|
+
registerDuplicateAttestationCallback(callback) {
|
|
694
|
+
this.p2pService.registerDuplicateAttestationCallback(callback);
|
|
695
|
+
}
|
|
672
696
|
/**
|
|
673
697
|
* Uses the batched Request Response protocol to request a set of transactions from the network.
|
|
674
698
|
*/ async requestTxsByHash(txHashes, pinnedPeerId) {
|
|
@@ -679,15 +703,30 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
679
703
|
const txBatches = await this.p2pService.sendBatchRequest(ReqRespSubProtocol.TX, requests, pinnedPeerId, timeoutMs, maxPeers, maxRetryAttempts);
|
|
680
704
|
const txs = txBatches.flat();
|
|
681
705
|
if (txs.length > 0) {
|
|
682
|
-
await this.txPool.
|
|
706
|
+
await this.txPool.addPendingTxs(txs);
|
|
683
707
|
}
|
|
684
708
|
const txHashesStr = txHashes.map((tx)=>tx.toString()).join(', ');
|
|
685
709
|
this.log.debug(`Requested txs ${txHashesStr} (${txs.length} / ${txHashes.length}) from peers`);
|
|
686
710
|
// We return all transactions, even the not found ones to the caller, such they can handle missing items themselves.
|
|
687
711
|
return txs;
|
|
688
712
|
}
|
|
689
|
-
getPendingTxs(limit, after) {
|
|
690
|
-
|
|
713
|
+
async getPendingTxs(limit, after) {
|
|
714
|
+
if (limit !== undefined && limit <= 0) {
|
|
715
|
+
throw new TypeError('limit must be greater than 0');
|
|
716
|
+
}
|
|
717
|
+
let txHashes = await this.txPool.getPendingTxHashes();
|
|
718
|
+
let startIndex = 0;
|
|
719
|
+
if (after) {
|
|
720
|
+
startIndex = txHashes.findIndex((txHash)=>after.equals(txHash));
|
|
721
|
+
if (startIndex === -1) {
|
|
722
|
+
return [];
|
|
723
|
+
}
|
|
724
|
+
startIndex++;
|
|
725
|
+
}
|
|
726
|
+
const endIndex = limit !== undefined ? startIndex + limit : undefined;
|
|
727
|
+
txHashes = txHashes.slice(startIndex, endIndex);
|
|
728
|
+
const maybeTxs = await Promise.all(txHashes.map((txHash)=>this.txPool.getTxByHash(txHash)));
|
|
729
|
+
return maybeTxs.filter((tx)=>!!tx);
|
|
691
730
|
}
|
|
692
731
|
getPendingTxCount() {
|
|
693
732
|
return this.txPool.getPendingTxCount();
|
|
@@ -700,52 +739,13 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
700
739
|
}
|
|
701
740
|
}
|
|
702
741
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
* @returns An array of Txs.
|
|
709
|
-
*/ async getTxs(filter, limit, after) {
|
|
710
|
-
if (limit !== undefined && limit <= 0) {
|
|
711
|
-
throw new TypeError('limit must be greater than 0');
|
|
712
|
-
}
|
|
713
|
-
let txs = undefined;
|
|
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
|
-
}
|
|
727
|
-
let startIndex = 0;
|
|
728
|
-
let endIndex = undefined;
|
|
729
|
-
if (after) {
|
|
730
|
-
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
|
-
if (startIndex === -1) {
|
|
733
|
-
return [];
|
|
742
|
+
async *iterateEligiblePendingTxs() {
|
|
743
|
+
for (const txHash of (await this.txPool.getEligiblePendingTxHashes())){
|
|
744
|
+
const tx = await this.txPool.getTxByHash(txHash);
|
|
745
|
+
if (tx) {
|
|
746
|
+
yield tx;
|
|
734
747
|
}
|
|
735
|
-
// increment by one because we don't want to return the same tx again
|
|
736
|
-
startIndex++;
|
|
737
|
-
}
|
|
738
|
-
if (limit !== undefined) {
|
|
739
|
-
endIndex = startIndex + limit;
|
|
740
748
|
}
|
|
741
|
-
txHashes = txHashes.slice(startIndex, endIndex);
|
|
742
|
-
if (txs) {
|
|
743
|
-
txs = txs.slice(startIndex, endIndex);
|
|
744
|
-
} else {
|
|
745
|
-
const maybeTxs = await Promise.all(txHashes.map((txHash)=>this.txPool.getTxByHash(txHash)));
|
|
746
|
-
txs = maybeTxs.filter((tx)=>!!tx);
|
|
747
|
-
}
|
|
748
|
-
return txs;
|
|
749
749
|
}
|
|
750
750
|
/**
|
|
751
751
|
* Returns a transaction in the transaction pool by its hash.
|
|
@@ -808,16 +808,18 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
808
808
|
return this.txPool.getArchivedTxByHash(txHash);
|
|
809
809
|
}
|
|
810
810
|
/**
|
|
811
|
-
*
|
|
812
|
-
* @param tx - The tx to
|
|
811
|
+
* Accepts a transaction, adds it to local tx pool and forwards it to other peers.
|
|
812
|
+
* @param tx - The tx to send.
|
|
813
813
|
* @returns Empty promise.
|
|
814
814
|
**/ async sendTx(tx) {
|
|
815
|
-
|
|
815
|
+
this.#assertIsReady();
|
|
816
|
+
const result = await this.txPool.addPendingTxs([
|
|
816
817
|
tx
|
|
817
818
|
]);
|
|
818
|
-
|
|
819
|
-
if (txAddedSuccessfully) {
|
|
819
|
+
if (result.accepted.length === 1) {
|
|
820
820
|
await this.p2pService.propagate(tx);
|
|
821
|
+
} else {
|
|
822
|
+
this.log.warn(`Tx ${tx.getTxHash()} not propagated: accepted=${result.accepted.length} ignored=${result.ignored.length} rejected=${result.rejected.length}`);
|
|
821
823
|
}
|
|
822
824
|
}
|
|
823
825
|
/**
|
|
@@ -825,14 +827,15 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
825
827
|
* @param txs - The transactions.
|
|
826
828
|
**/ async addTxsToPool(txs) {
|
|
827
829
|
this.#assertIsReady();
|
|
828
|
-
return await this.txPool.
|
|
830
|
+
return (await this.txPool.addPendingTxs(txs)).accepted.length;
|
|
829
831
|
}
|
|
830
832
|
/**
|
|
831
833
|
* Returns whether the given tx hash is flagged as pending or mined.
|
|
832
834
|
* @param txHash - Hash of the tx to query.
|
|
833
835
|
* @returns Pending or mined depending on its status, or undefined if not found.
|
|
834
|
-
*/ getTxStatus(txHash) {
|
|
835
|
-
|
|
836
|
+
*/ async getTxStatus(txHash) {
|
|
837
|
+
const status = await this.txPool.getTxStatus(txHash);
|
|
838
|
+
return status === 'protected' ? 'pending' : status;
|
|
836
839
|
}
|
|
837
840
|
getEnr() {
|
|
838
841
|
return this.p2pService.getEnr();
|
|
@@ -841,13 +844,11 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
841
844
|
return Promise.resolve(this.p2pService.getEnr()?.encodeTxt());
|
|
842
845
|
}
|
|
843
846
|
/**
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
|
|
847
|
-
* @returns Empty promise.
|
|
848
|
-
**/ async deleteTxs(txHashes) {
|
|
847
|
+
* Handles failed transaction execution by removing txs from the pool.
|
|
848
|
+
* @param txHashes - Hashes of the transactions that failed execution.
|
|
849
|
+
**/ async handleFailedExecution(txHashes) {
|
|
849
850
|
this.#assertIsReady();
|
|
850
|
-
await this.txPool.
|
|
851
|
+
await this.txPool.handleFailedExecution(txHashes);
|
|
851
852
|
}
|
|
852
853
|
/**
|
|
853
854
|
* Public function to check if the p2p client is fully synced and ready to receive txs.
|
|
@@ -891,13 +892,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
891
892
|
};
|
|
892
893
|
}
|
|
893
894
|
/**
|
|
894
|
-
*
|
|
895
|
+
* Handles mined blocks by marking the txs in them as mined.
|
|
895
896
|
* @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
|
|
896
897
|
* @returns Empty promise.
|
|
897
|
-
*/ async
|
|
898
|
+
*/ async handleMinedBlocks(blocks) {
|
|
898
899
|
for (const block of blocks){
|
|
899
|
-
|
|
900
|
-
await this.txPool.markAsMined(txHashes, block.header);
|
|
900
|
+
await this.txPool.handleMinedBlock(block);
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
903
|
/**
|
|
@@ -906,14 +906,13 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
906
906
|
* @returns Empty promise.
|
|
907
907
|
*/ async handleLatestL2Blocks(blocks) {
|
|
908
908
|
if (!blocks.length) {
|
|
909
|
-
return
|
|
909
|
+
return;
|
|
910
910
|
}
|
|
911
|
-
await this.
|
|
912
|
-
await this.
|
|
911
|
+
await this.handleMinedBlocks(blocks);
|
|
912
|
+
await this.maybeCallPrepareForSlot();
|
|
913
913
|
await this.startCollectingMissingTxs(blocks);
|
|
914
914
|
const lastBlock = blocks.at(-1);
|
|
915
915
|
await this.synchedLatestSlot.set(BigInt(lastBlock.header.getSlot()));
|
|
916
|
-
this.log.verbose(`Synched to latest block ${lastBlock.number}`);
|
|
917
916
|
}
|
|
918
917
|
/** Request txs for unproven blocks so the prover node has more chances to get them. */ async startCollectingMissingTxs(blocks) {
|
|
919
918
|
try {
|
|
@@ -947,59 +946,26 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
947
946
|
* @returns Empty promise.
|
|
948
947
|
*/ async handleFinalizedL2Blocks(blocks) {
|
|
949
948
|
if (!blocks.length) {
|
|
950
|
-
return
|
|
949
|
+
return;
|
|
951
950
|
}
|
|
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}`);
|
|
951
|
+
// Finalization is monotonic, so we only need to call with the last block
|
|
952
|
+
const lastBlock = blocks.at(-1);
|
|
953
|
+
await this.txPool.handleFinalizedBlock(lastBlock.header);
|
|
954
|
+
await this.attestationPool.deleteOlderThan(lastBlock.header.getSlot());
|
|
963
955
|
}
|
|
964
956
|
/**
|
|
965
957
|
* Updates the tx pool after a chain prune.
|
|
966
|
-
* @param latestBlock - The block
|
|
958
|
+
* @param latestBlock - The block ID the chain was pruned to.
|
|
967
959
|
*/ 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);
|
|
960
|
+
await this.txPool.handlePrunedBlocks(latestBlock);
|
|
961
|
+
}
|
|
962
|
+
/** Checks if the slot has changed and calls prepareForSlot if so. */ async maybeCallPrepareForSlot() {
|
|
963
|
+
const { currentSlot } = this.epochCache.getCurrentAndNextSlot();
|
|
964
|
+
if (currentSlot <= this.lastSlotProcessed) {
|
|
965
|
+
return;
|
|
1002
966
|
}
|
|
967
|
+
this.lastSlotProcessed = currentSlot;
|
|
968
|
+
await this.txPool.prepareForSlot(currentSlot);
|
|
1003
969
|
}
|
|
1004
970
|
async startServiceIfSynched() {
|
|
1005
971
|
if (this.currentState !== P2PClientState.SYNCHING) {
|
|
@@ -1034,10 +1000,20 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
1034
1000
|
return this.p2pService.validate(txs);
|
|
1035
1001
|
}
|
|
1036
1002
|
/**
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1039
|
-
|
|
1040
|
-
|
|
1003
|
+
* Protects existing transactions by hash for a given slot.
|
|
1004
|
+
* Returns hashes of transactions that weren't found in the pool.
|
|
1005
|
+
* @param txHashes - Hashes of the transactions to protect.
|
|
1006
|
+
* @param blockHeader - The block header providing slot context.
|
|
1007
|
+
* @returns Hashes of transactions not found in the pool.
|
|
1008
|
+
*/ protectTxs(txHashes, blockHeader) {
|
|
1009
|
+
return this.txPool.protectTxs(txHashes, blockHeader);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Prepares the pool for a new slot.
|
|
1013
|
+
* Unprotects transactions from earlier slots and validates them.
|
|
1014
|
+
* @param slotNumber - The slot number to prepare for
|
|
1015
|
+
*/ async prepareForSlot(slotNumber) {
|
|
1016
|
+
await this.txPool.prepareForSlot(slotNumber);
|
|
1041
1017
|
}
|
|
1042
1018
|
handleAuthRequestFromPeer(authRequest, peerId) {
|
|
1043
1019
|
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,10 @@ 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;
|
|
114
|
+
/** Minimum age (ms) a transaction must have been in the pool before it's eligible for block building. */
|
|
115
|
+
minTxPoolAgeMs: number;
|
|
110
116
|
}
|
|
111
117
|
export declare const DEFAULT_P2P_PORT = 40400;
|
|
112
118
|
export declare const p2pConfigMappings: ConfigMappingsType<P2PConfig>;
|
|
@@ -127,10 +133,12 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
127
133
|
batchTxRequesterSmartParallelWorkerCount: unknown;
|
|
128
134
|
batchTxRequesterTxBatchSize: unknown;
|
|
129
135
|
blockCheckIntervalMS: unknown;
|
|
136
|
+
blockDurationMs: unknown;
|
|
130
137
|
blockRequestBatchSize: unknown;
|
|
131
138
|
bootstrapNodeEnrVersionCheck: unknown;
|
|
132
139
|
bootstrapNodes: unknown;
|
|
133
140
|
bootstrapNodesAsFullPeers: unknown;
|
|
141
|
+
broadcastEquivocatedProposals: unknown;
|
|
134
142
|
dataDirectory: unknown;
|
|
135
143
|
dataStoreMapSizeKb: unknown;
|
|
136
144
|
debugDisableColocationPenalty: unknown;
|
|
@@ -160,6 +168,7 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
160
168
|
listenAddress: unknown;
|
|
161
169
|
maxPeerCount: unknown;
|
|
162
170
|
maxPendingTxCount: unknown;
|
|
171
|
+
minTxPoolAgeMs: unknown;
|
|
163
172
|
overallRequestTimeoutMs: unknown;
|
|
164
173
|
p2pAllowOnlyValidators: unknown;
|
|
165
174
|
p2pBroadcastPort: unknown;
|
|
@@ -180,19 +189,28 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
180
189
|
queryForIp: unknown;
|
|
181
190
|
rollupVersion: unknown;
|
|
182
191
|
seenMessageCacheSize: unknown;
|
|
192
|
+
slotCheckIntervalMS: unknown;
|
|
183
193
|
trustedPeers: unknown;
|
|
184
194
|
txCollectionDisableSlowDuringFastRequests: unknown;
|
|
185
195
|
txCollectionFastMaxParallelRequestsPerNode: unknown;
|
|
186
196
|
txCollectionFastNodeIntervalMs: unknown;
|
|
187
197
|
txCollectionFastNodesTimeoutBeforeReqRespMs: unknown;
|
|
198
|
+
txCollectionFileStoreFastBackoffBaseMs: unknown;
|
|
199
|
+
txCollectionFileStoreFastBackoffMaxMs: unknown;
|
|
200
|
+
txCollectionFileStoreFastDelayMs: unknown;
|
|
201
|
+
txCollectionFileStoreFastWorkerCount: unknown;
|
|
202
|
+
txCollectionFileStoreSlowBackoffBaseMs: unknown;
|
|
203
|
+
txCollectionFileStoreSlowBackoffMaxMs: unknown;
|
|
204
|
+
txCollectionFileStoreSlowDelayMs: unknown;
|
|
205
|
+
txCollectionFileStoreSlowWorkerCount: unknown;
|
|
206
|
+
txCollectionFileStoreUrls: unknown;
|
|
207
|
+
txCollectionMissingTxsCollectorType: unknown;
|
|
188
208
|
txCollectionNodeRpcMaxBatchSize: unknown;
|
|
189
209
|
txCollectionNodeRpcUrls: unknown;
|
|
190
|
-
txCollectionProposalTxCollectorType: unknown;
|
|
191
210
|
txCollectionReconcileIntervalMs: unknown;
|
|
192
211
|
txCollectionSlowNodesIntervalMs: unknown;
|
|
193
212
|
txCollectionSlowReqRespIntervalMs: unknown;
|
|
194
213
|
txCollectionSlowReqRespTimeoutMs: unknown;
|
|
195
|
-
txFileStoreDownloadUrl: unknown;
|
|
196
214
|
txFileStoreEnabled: unknown;
|
|
197
215
|
txFileStoreMaxQueueSize: unknown;
|
|
198
216
|
txFileStoreUploadConcurrency: unknown;
|
|
@@ -212,4 +230,4 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
212
230
|
* @returns A list of allowed elements
|
|
213
231
|
*/
|
|
214
232
|
export declare function parseAllowList(value: string): AllowedElement[];
|
|
215
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
233
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLGtCQUFrQixFQUN2QixXQUFXLEVBUVosTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQXNCLE1BQU0sd0JBQXdCLENBQUM7QUFHbEYsT0FBTyxFQUNMLEtBQUssY0FBYyxFQUNuQixLQUFLLFdBQVcsRUFDaEIsS0FBSyxlQUFlLEVBR3JCLE1BQU0sc0JBQXNCLENBQUM7QUFFOUIsT0FBTyxFQUNMLEtBQUssc0JBQXNCLEVBRTVCLE1BQU0saURBQWlELENBQUM7QUFDekQsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQTRCLE1BQU0sOEJBQThCLENBQUM7QUFDL0YsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQThCLE1BQU0sb0NBQW9DLENBQUM7QUFDekcsT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P,OAAO,GACP,SAAS,GACT,kBAAkB,GAClB,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,GAChB,eAAe,GACf,YAAY,CACf,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,16 @@ 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
|
+
minTxPoolAgeMs: {
|
|
277
|
+
env: 'P2P_MIN_TX_POOL_AGE_MS',
|
|
278
|
+
description: 'Minimum age (ms) a transaction must have been in the pool before it is eligible for block building.',
|
|
279
|
+
...numberConfigHelper(2_000)
|
|
280
|
+
},
|
|
281
|
+
...sharedSequencerConfigMappings,
|
|
267
282
|
...p2pReqRespConfigMappings,
|
|
268
283
|
...batchTxRequesterConfigMappings,
|
|
269
284
|
...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';
|