@aztec/p2p 0.0.1-commit.023c3e5 → 0.0.1-commit.08c5969dc
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 +45 -9
- package/dest/client/interface.d.ts +37 -15
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +37 -36
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +118 -138
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +1 -1
- package/dest/config.d.ts +28 -4
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +19 -2
- 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/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 +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 +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/index.d.ts +2 -1
- package/dest/services/index.d.ts.map +1 -1
- package/dest/services/index.js +1 -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 +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 +16 -0
- package/dest/services/tx_file_store/config.d.ts.map +1 -0
- package/dest/services/tx_file_store/config.js +22 -0
- package/dest/services/tx_file_store/index.d.ts +4 -0
- package/dest/services/tx_file_store/index.d.ts.map +1 -0
- package/dest/services/tx_file_store/index.js +3 -0
- package/dest/services/tx_file_store/instrumentation.d.ts +15 -0
- package/dest/services/tx_file_store/instrumentation.d.ts.map +1 -0
- package/dest/services/tx_file_store/instrumentation.js +29 -0
- package/dest/services/tx_file_store/tx_file_store.d.ts +48 -0
- package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -0
- package/dest/services/tx_file_store/tx_file_store.js +152 -0
- 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 +2 -2
- package/package.json +14 -14
- package/src/client/factory.ts +84 -12
- package/src/client/interface.ts +45 -14
- package/src/client/p2p_client.ts +156 -161
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +1 -1
- package/src/config.ts +41 -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/index.ts +4 -1
- package/src/mem_pools/interface.ts +4 -4
- 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 +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/index.ts +1 -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 +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 +37 -0
- package/src/services/tx_file_store/index.ts +3 -0
- package/src/services/tx_file_store/instrumentation.ts +36 -0
- package/src/services/tx_file_store/tx_file_store.ts +175 -0
- 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 +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';
|
|
@@ -401,6 +402,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
401
402
|
l2BlockSource;
|
|
402
403
|
p2pService;
|
|
403
404
|
txCollection;
|
|
405
|
+
txFileStore;
|
|
406
|
+
epochCache;
|
|
404
407
|
_dateProvider;
|
|
405
408
|
telemetry;
|
|
406
409
|
log;
|
|
@@ -433,15 +436,10 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
433
436
|
blockStream;
|
|
434
437
|
txProvider;
|
|
435
438
|
validatorAddresses;
|
|
436
|
-
/**
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
* @param txPool - The client's instance of a transaction pool. Defaults to in-memory implementation.
|
|
441
|
-
* @param p2pService - The concrete instance of p2p networking to use.
|
|
442
|
-
* @param log - A logger.
|
|
443
|
-
*/ constructor(_clientType, store, l2BlockSource, mempools, p2pService, txCollection, config = {}, _dateProvider = new DateProvider(), telemetry = getTelemetryClient(), log = createLogger('p2p')){
|
|
444
|
-
super(telemetry, 'P2PClient'), this.store = store, this.l2BlockSource = l2BlockSource, this.p2pService = p2pService, this.txCollection = txCollection, 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;
|
|
445
443
|
this.config = {
|
|
446
444
|
...getP2PDefaultConfig(),
|
|
447
445
|
...config
|
|
@@ -496,10 +494,9 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
496
494
|
getL2BlockHash(number) {
|
|
497
495
|
return this.l2Tips.getL2BlockHash(number);
|
|
498
496
|
}
|
|
499
|
-
updateP2PConfig(config) {
|
|
500
|
-
this.txPool.updateConfig(config);
|
|
497
|
+
async updateP2PConfig(config) {
|
|
498
|
+
await this.txPool.updateConfig(config);
|
|
501
499
|
this.p2pService.updateConfig(config);
|
|
502
|
-
return Promise.resolve();
|
|
503
500
|
}
|
|
504
501
|
getL2Tips() {
|
|
505
502
|
return this.l2Tips.getL2Tips();
|
|
@@ -526,7 +523,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
526
523
|
break;
|
|
527
524
|
case 'chain-pruned':
|
|
528
525
|
this.txCollection.stopCollectingForBlocksAfter(event.block.number);
|
|
529
|
-
await this.handlePruneL2Blocks(event.block
|
|
526
|
+
await this.handlePruneL2Blocks(event.block);
|
|
530
527
|
break;
|
|
531
528
|
case 'chain-checkpointed':
|
|
532
529
|
break;
|
|
@@ -541,7 +538,6 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
541
538
|
await this.startServiceIfSynched();
|
|
542
539
|
}
|
|
543
540
|
#assertIsReady() {
|
|
544
|
-
// this.log.info('Checking if p2p client is ready, current state: ', this.currentState);
|
|
545
541
|
if (!this.isReady()) {
|
|
546
542
|
throw new Error('P2P client not ready');
|
|
547
543
|
}
|
|
@@ -556,6 +552,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
556
552
|
if (this.currentState !== P2PClientState.IDLE) {
|
|
557
553
|
return this.syncPromise;
|
|
558
554
|
}
|
|
555
|
+
// Start the tx pool first, as it needs to hydrate state from persistence
|
|
556
|
+
await this.txPool.start();
|
|
559
557
|
// get the current latest block numbers
|
|
560
558
|
const latestBlockNumbers = await this.l2BlockSource.getL2Tips();
|
|
561
559
|
this.latestBlockNumberAtStart = latestBlockNumbers.proposed.number;
|
|
@@ -598,6 +596,10 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
598
596
|
}
|
|
599
597
|
this.blockStream.start();
|
|
600
598
|
await this.txCollection.start();
|
|
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();
|
|
601
603
|
return this.syncPromise;
|
|
602
604
|
}
|
|
603
605
|
addReqRespSubProtocol(subProtocol, handler, validator) {
|
|
@@ -618,12 +620,18 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
618
620
|
* 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
|
|
619
621
|
*/ async stop() {
|
|
620
622
|
this.log.debug('Stopping p2p client...');
|
|
623
|
+
await this.slotMonitor?.stop();
|
|
624
|
+
this.log.debug('Stopped slot monitor');
|
|
621
625
|
await tryStop(this.txCollection);
|
|
622
626
|
this.log.debug('Stopped tx collection service');
|
|
627
|
+
await this.txFileStore?.stop();
|
|
628
|
+
this.log.debug('Stopped tx file store');
|
|
623
629
|
await this.p2pService.stop();
|
|
624
630
|
this.log.debug('Stopped p2p service');
|
|
625
631
|
await this.blockStream?.stop();
|
|
626
632
|
this.log.debug('Stopped block downloader');
|
|
633
|
+
await this.txPool.stop();
|
|
634
|
+
this.log.debug('Stopped tx pool');
|
|
627
635
|
await this.runningPromise;
|
|
628
636
|
this.setCurrentState(P2PClientState.STOPPED);
|
|
629
637
|
this.log.info('P2P client stopped');
|
|
@@ -635,7 +643,18 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
635
643
|
async broadcastProposal(proposal) {
|
|
636
644
|
this.log.verbose(`Broadcasting proposal for slot ${proposal.slotNumber} to peers`);
|
|
637
645
|
// Store our own proposal so we can respond to req/resp requests for it
|
|
638
|
-
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
|
+
}
|
|
639
658
|
return this.p2pService.propagate(proposal);
|
|
640
659
|
}
|
|
641
660
|
async broadcastCheckpointProposal(proposal) {
|
|
@@ -643,7 +662,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
643
662
|
const blockProposal = proposal.getBlockProposal();
|
|
644
663
|
if (blockProposal) {
|
|
645
664
|
// Store our own last-block proposal so we can respond to req/resp requests for it.
|
|
646
|
-
await this.attestationPool.
|
|
665
|
+
await this.attestationPool.tryAddBlockProposal(blockProposal);
|
|
647
666
|
}
|
|
648
667
|
return this.p2pService.propagate(proposal);
|
|
649
668
|
}
|
|
@@ -654,8 +673,11 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
654
673
|
async getCheckpointAttestationsForSlot(slot, proposalId) {
|
|
655
674
|
return await (proposalId ? this.attestationPool.getCheckpointAttestationsForSlotAndProposal(slot, proposalId) : this.attestationPool.getCheckpointAttestationsForSlot(slot));
|
|
656
675
|
}
|
|
657
|
-
|
|
658
|
-
return this.attestationPool.
|
|
676
|
+
addOwnCheckpointAttestations(attestations) {
|
|
677
|
+
return this.attestationPool.addOwnCheckpointAttestations(attestations);
|
|
678
|
+
}
|
|
679
|
+
hasBlockProposalsForSlot(slot) {
|
|
680
|
+
return this.attestationPool.hasBlockProposalsForSlot(slot);
|
|
659
681
|
}
|
|
660
682
|
// REVIEW: https://github.com/AztecProtocol/aztec-packages/issues/7963
|
|
661
683
|
// ^ This pattern is not my favorite (md)
|
|
@@ -665,6 +687,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
665
687
|
registerCheckpointProposalHandler(handler) {
|
|
666
688
|
this.p2pService.registerCheckpointReceivedCallback(handler);
|
|
667
689
|
}
|
|
690
|
+
registerDuplicateProposalCallback(callback) {
|
|
691
|
+
this.p2pService.registerDuplicateProposalCallback(callback);
|
|
692
|
+
}
|
|
693
|
+
registerDuplicateAttestationCallback(callback) {
|
|
694
|
+
this.p2pService.registerDuplicateAttestationCallback(callback);
|
|
695
|
+
}
|
|
668
696
|
/**
|
|
669
697
|
* Uses the batched Request Response protocol to request a set of transactions from the network.
|
|
670
698
|
*/ async requestTxsByHash(txHashes, pinnedPeerId) {
|
|
@@ -675,15 +703,30 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
675
703
|
const txBatches = await this.p2pService.sendBatchRequest(ReqRespSubProtocol.TX, requests, pinnedPeerId, timeoutMs, maxPeers, maxRetryAttempts);
|
|
676
704
|
const txs = txBatches.flat();
|
|
677
705
|
if (txs.length > 0) {
|
|
678
|
-
await this.txPool.
|
|
706
|
+
await this.txPool.addPendingTxs(txs);
|
|
679
707
|
}
|
|
680
708
|
const txHashesStr = txHashes.map((tx)=>tx.toString()).join(', ');
|
|
681
709
|
this.log.debug(`Requested txs ${txHashesStr} (${txs.length} / ${txHashes.length}) from peers`);
|
|
682
710
|
// We return all transactions, even the not found ones to the caller, such they can handle missing items themselves.
|
|
683
711
|
return txs;
|
|
684
712
|
}
|
|
685
|
-
getPendingTxs(limit, after) {
|
|
686
|
-
|
|
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);
|
|
687
730
|
}
|
|
688
731
|
getPendingTxCount() {
|
|
689
732
|
return this.txPool.getPendingTxCount();
|
|
@@ -696,52 +739,13 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
696
739
|
}
|
|
697
740
|
}
|
|
698
741
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
* @returns An array of Txs.
|
|
705
|
-
*/ async getTxs(filter, limit, after) {
|
|
706
|
-
if (limit !== undefined && limit <= 0) {
|
|
707
|
-
throw new TypeError('limit must be greater than 0');
|
|
708
|
-
}
|
|
709
|
-
let txs = undefined;
|
|
710
|
-
let txHashes;
|
|
711
|
-
if (filter === 'all') {
|
|
712
|
-
txs = await this.txPool.getAllTxs();
|
|
713
|
-
txHashes = await Promise.all(txs.map((tx)=>tx.getTxHash()));
|
|
714
|
-
} else if (filter === 'mined') {
|
|
715
|
-
const minedTxHashes = await this.txPool.getMinedTxHashes();
|
|
716
|
-
txHashes = minedTxHashes.map(([txHash])=>txHash);
|
|
717
|
-
} else if (filter === 'pending') {
|
|
718
|
-
txHashes = await this.txPool.getPendingTxHashes();
|
|
719
|
-
} else {
|
|
720
|
-
const _ = filter;
|
|
721
|
-
throw new Error(`Unknown filter ${filter}`);
|
|
722
|
-
}
|
|
723
|
-
let startIndex = 0;
|
|
724
|
-
let endIndex = undefined;
|
|
725
|
-
if (after) {
|
|
726
|
-
startIndex = txHashes.findIndex((txHash)=>after.equals(txHash));
|
|
727
|
-
// if we can't find the last tx in our set then return an empty array as pagination is no longer valid.
|
|
728
|
-
if (startIndex === -1) {
|
|
729
|
-
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;
|
|
730
747
|
}
|
|
731
|
-
// increment by one because we don't want to return the same tx again
|
|
732
|
-
startIndex++;
|
|
733
|
-
}
|
|
734
|
-
if (limit !== undefined) {
|
|
735
|
-
endIndex = startIndex + limit;
|
|
736
748
|
}
|
|
737
|
-
txHashes = txHashes.slice(startIndex, endIndex);
|
|
738
|
-
if (txs) {
|
|
739
|
-
txs = txs.slice(startIndex, endIndex);
|
|
740
|
-
} else {
|
|
741
|
-
const maybeTxs = await Promise.all(txHashes.map((txHash)=>this.txPool.getTxByHash(txHash)));
|
|
742
|
-
txs = maybeTxs.filter((tx)=>!!tx);
|
|
743
|
-
}
|
|
744
|
-
return txs;
|
|
745
749
|
}
|
|
746
750
|
/**
|
|
747
751
|
* Returns a transaction in the transaction pool by its hash.
|
|
@@ -804,16 +808,18 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
804
808
|
return this.txPool.getArchivedTxByHash(txHash);
|
|
805
809
|
}
|
|
806
810
|
/**
|
|
807
|
-
*
|
|
808
|
-
* @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.
|
|
809
813
|
* @returns Empty promise.
|
|
810
814
|
**/ async sendTx(tx) {
|
|
811
|
-
|
|
815
|
+
this.#assertIsReady();
|
|
816
|
+
const result = await this.txPool.addPendingTxs([
|
|
812
817
|
tx
|
|
813
818
|
]);
|
|
814
|
-
|
|
815
|
-
if (txAddedSuccessfully) {
|
|
819
|
+
if (result.accepted.length === 1) {
|
|
816
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}`);
|
|
817
823
|
}
|
|
818
824
|
}
|
|
819
825
|
/**
|
|
@@ -821,14 +827,15 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
821
827
|
* @param txs - The transactions.
|
|
822
828
|
**/ async addTxsToPool(txs) {
|
|
823
829
|
this.#assertIsReady();
|
|
824
|
-
return await this.txPool.
|
|
830
|
+
return (await this.txPool.addPendingTxs(txs)).accepted.length;
|
|
825
831
|
}
|
|
826
832
|
/**
|
|
827
833
|
* Returns whether the given tx hash is flagged as pending or mined.
|
|
828
834
|
* @param txHash - Hash of the tx to query.
|
|
829
835
|
* @returns Pending or mined depending on its status, or undefined if not found.
|
|
830
|
-
*/ getTxStatus(txHash) {
|
|
831
|
-
|
|
836
|
+
*/ async getTxStatus(txHash) {
|
|
837
|
+
const status = await this.txPool.getTxStatus(txHash);
|
|
838
|
+
return status === 'protected' ? 'pending' : status;
|
|
832
839
|
}
|
|
833
840
|
getEnr() {
|
|
834
841
|
return this.p2pService.getEnr();
|
|
@@ -837,13 +844,11 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
837
844
|
return Promise.resolve(this.p2pService.getEnr()?.encodeTxt());
|
|
838
845
|
}
|
|
839
846
|
/**
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
|
|
843
|
-
* @returns Empty promise.
|
|
844
|
-
**/ 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) {
|
|
845
850
|
this.#assertIsReady();
|
|
846
|
-
await this.txPool.
|
|
851
|
+
await this.txPool.handleFailedExecution(txHashes);
|
|
847
852
|
}
|
|
848
853
|
/**
|
|
849
854
|
* Public function to check if the p2p client is fully synced and ready to receive txs.
|
|
@@ -887,13 +892,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
887
892
|
};
|
|
888
893
|
}
|
|
889
894
|
/**
|
|
890
|
-
*
|
|
895
|
+
* Handles mined blocks by marking the txs in them as mined.
|
|
891
896
|
* @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
|
|
892
897
|
* @returns Empty promise.
|
|
893
|
-
*/ async
|
|
898
|
+
*/ async handleMinedBlocks(blocks) {
|
|
894
899
|
for (const block of blocks){
|
|
895
|
-
|
|
896
|
-
await this.txPool.markAsMined(txHashes, block.header);
|
|
900
|
+
await this.txPool.handleMinedBlock(block);
|
|
897
901
|
}
|
|
898
902
|
}
|
|
899
903
|
/**
|
|
@@ -902,14 +906,13 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
902
906
|
* @returns Empty promise.
|
|
903
907
|
*/ async handleLatestL2Blocks(blocks) {
|
|
904
908
|
if (!blocks.length) {
|
|
905
|
-
return
|
|
909
|
+
return;
|
|
906
910
|
}
|
|
907
|
-
await this.
|
|
908
|
-
await this.
|
|
911
|
+
await this.handleMinedBlocks(blocks);
|
|
912
|
+
await this.maybeCallPrepareForSlot();
|
|
909
913
|
await this.startCollectingMissingTxs(blocks);
|
|
910
914
|
const lastBlock = blocks.at(-1);
|
|
911
915
|
await this.synchedLatestSlot.set(BigInt(lastBlock.header.getSlot()));
|
|
912
|
-
this.log.verbose(`Synched to latest block ${lastBlock.number}`);
|
|
913
916
|
}
|
|
914
917
|
/** Request txs for unproven blocks so the prover node has more chances to get them. */ async startCollectingMissingTxs(blocks) {
|
|
915
918
|
try {
|
|
@@ -943,59 +946,26 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
943
946
|
* @returns Empty promise.
|
|
944
947
|
*/ async handleFinalizedL2Blocks(blocks) {
|
|
945
948
|
if (!blocks.length) {
|
|
946
|
-
return
|
|
949
|
+
return;
|
|
947
950
|
}
|
|
948
|
-
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
this.log.debug(`Deleting ${txHashes.length} txs from pool from finalized blocks up to ${lastBlockNum}`);
|
|
953
|
-
await this.txPool.deleteTxs(txHashes, {
|
|
954
|
-
permanently: true
|
|
955
|
-
});
|
|
956
|
-
await this.txPool.cleanupDeletedMinedTxs(lastBlockNum);
|
|
957
|
-
await this.attestationPool.deleteCheckpointAttestationsOlderThan(lastBlockSlot);
|
|
958
|
-
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());
|
|
959
955
|
}
|
|
960
956
|
/**
|
|
961
957
|
* Updates the tx pool after a chain prune.
|
|
962
|
-
* @param latestBlock - The block
|
|
958
|
+
* @param latestBlock - The block ID the chain was pruned to.
|
|
963
959
|
*/ async handlePruneL2Blocks(latestBlock) {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
const txHash = tx.getTxHash();
|
|
971
|
-
txsToDelete.set(txHash.toString(), txHash);
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
this.log.info(`Detected chain prune. Removing ${txsToDelete.size} txs built against pruned blocks.`, {
|
|
975
|
-
newLatestBlock: latestBlock,
|
|
976
|
-
previousLatestBlock: await this.getSyncedLatestBlockNum(),
|
|
977
|
-
txsToDelete: Array.from(txsToDelete.keys())
|
|
978
|
-
});
|
|
979
|
-
// delete invalid txs (both pending and mined)
|
|
980
|
-
await this.txPool.deleteTxs(Array.from(txsToDelete.values()));
|
|
981
|
-
// everything left in the mined set was built against a block on the proven chain so its still valid
|
|
982
|
-
// move back to pending the txs that were reorged out of the chain, unless txPoolDeleteTxsAfterReorg is set,
|
|
983
|
-
// in which case we clean them up to avoid potential reorg loops
|
|
984
|
-
// NOTE: we can't move _all_ txs back to pending because the tx pool could keep hold of mined txs for longer
|
|
985
|
-
// (see this.keepProvenTxsFor)
|
|
986
|
-
const minedTxsFromReorg = [];
|
|
987
|
-
for (const [txHash, blockNumber] of minedTxs){
|
|
988
|
-
// We keep the txsToDelete out of this list as they have already been deleted above
|
|
989
|
-
if (blockNumber > latestBlock && !txsToDelete.has(txHash.toString())) {
|
|
990
|
-
minedTxsFromReorg.push(txHash);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
if (this.config.txPoolDeleteTxsAfterReorg) {
|
|
994
|
-
this.log.info(`Deleting ${minedTxsFromReorg.length} mined txs from reorg`);
|
|
995
|
-
await this.txPool.deleteTxs(minedTxsFromReorg);
|
|
996
|
-
} else {
|
|
997
|
-
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;
|
|
998
966
|
}
|
|
967
|
+
this.lastSlotProcessed = currentSlot;
|
|
968
|
+
await this.txPool.prepareForSlot(currentSlot);
|
|
999
969
|
}
|
|
1000
970
|
async startServiceIfSynched() {
|
|
1001
971
|
if (this.currentState !== P2PClientState.SYNCHING) {
|
|
@@ -1030,10 +1000,20 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
|
|
|
1030
1000
|
return this.p2pService.validate(txs);
|
|
1031
1001
|
}
|
|
1032
1002
|
/**
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
|
|
1036
|
-
|
|
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);
|
|
1037
1017
|
}
|
|
1038
1018
|
handleAuthRequestFromPeer(authRequest, peerId) {
|
|
1039
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,17 +1,20 @@
|
|
|
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';
|
|
7
|
+
import { type TxFileStoreConfig } from './services/tx_file_store/config.js';
|
|
7
8
|
/**
|
|
8
9
|
* P2P client configuration values.
|
|
9
10
|
*/
|
|
10
|
-
export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, ChainConfig, TxCollectionConfig {
|
|
11
|
+
export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, ChainConfig, TxCollectionConfig, TxFileStoreConfig, Pick<SequencerConfig, 'blockDurationMs'> {
|
|
11
12
|
/** A flag dictating whether the P2P subsystem should be enabled. */
|
|
12
13
|
p2pEnabled: boolean;
|
|
13
14
|
/** The frequency in which to check for new L2 blocks. */
|
|
14
15
|
blockCheckIntervalMS: number;
|
|
16
|
+
/** The frequency in which to check for new L2 slots. */
|
|
17
|
+
slotCheckIntervalMS: number;
|
|
15
18
|
/** The number of blocks to fetch in a single batch. */
|
|
16
19
|
blockRequestBatchSize: number;
|
|
17
20
|
/** DEBUG: Disable colocation penalty - for testing purposes only */
|
|
@@ -106,6 +109,10 @@ export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, Cha
|
|
|
106
109
|
debugP2PInstrumentMessages: boolean;
|
|
107
110
|
/** Whether to run in fisherman mode: validates all proposals and attestations but does not broadcast attestations or participate in consensus */
|
|
108
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;
|
|
109
116
|
}
|
|
110
117
|
export declare const DEFAULT_P2P_PORT = 40400;
|
|
111
118
|
export declare const p2pConfigMappings: ConfigMappingsType<P2PConfig>;
|
|
@@ -126,10 +133,12 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
126
133
|
batchTxRequesterSmartParallelWorkerCount: unknown;
|
|
127
134
|
batchTxRequesterTxBatchSize: unknown;
|
|
128
135
|
blockCheckIntervalMS: unknown;
|
|
136
|
+
blockDurationMs: unknown;
|
|
129
137
|
blockRequestBatchSize: unknown;
|
|
130
138
|
bootstrapNodeEnrVersionCheck: unknown;
|
|
131
139
|
bootstrapNodes: unknown;
|
|
132
140
|
bootstrapNodesAsFullPeers: unknown;
|
|
141
|
+
broadcastEquivocatedProposals: unknown;
|
|
133
142
|
dataDirectory: unknown;
|
|
134
143
|
dataStoreMapSizeKb: unknown;
|
|
135
144
|
debugDisableColocationPenalty: unknown;
|
|
@@ -159,6 +168,7 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
159
168
|
listenAddress: unknown;
|
|
160
169
|
maxPeerCount: unknown;
|
|
161
170
|
maxPendingTxCount: unknown;
|
|
171
|
+
minTxPoolAgeMs: unknown;
|
|
162
172
|
overallRequestTimeoutMs: unknown;
|
|
163
173
|
p2pAllowOnlyValidators: unknown;
|
|
164
174
|
p2pBroadcastPort: unknown;
|
|
@@ -179,18 +189,32 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
179
189
|
queryForIp: unknown;
|
|
180
190
|
rollupVersion: unknown;
|
|
181
191
|
seenMessageCacheSize: unknown;
|
|
192
|
+
slotCheckIntervalMS: unknown;
|
|
182
193
|
trustedPeers: unknown;
|
|
183
194
|
txCollectionDisableSlowDuringFastRequests: unknown;
|
|
184
195
|
txCollectionFastMaxParallelRequestsPerNode: unknown;
|
|
185
196
|
txCollectionFastNodeIntervalMs: unknown;
|
|
186
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;
|
|
187
208
|
txCollectionNodeRpcMaxBatchSize: unknown;
|
|
188
209
|
txCollectionNodeRpcUrls: unknown;
|
|
189
|
-
txCollectionProposalTxCollectorType: unknown;
|
|
190
210
|
txCollectionReconcileIntervalMs: unknown;
|
|
191
211
|
txCollectionSlowNodesIntervalMs: unknown;
|
|
192
212
|
txCollectionSlowReqRespIntervalMs: unknown;
|
|
193
213
|
txCollectionSlowReqRespTimeoutMs: unknown;
|
|
214
|
+
txFileStoreEnabled: unknown;
|
|
215
|
+
txFileStoreMaxQueueSize: unknown;
|
|
216
|
+
txFileStoreUploadConcurrency: unknown;
|
|
217
|
+
txFileStoreUrl: unknown;
|
|
194
218
|
txPoolDeleteTxsAfterReorg: unknown;
|
|
195
219
|
txPublicSetupAllowList: unknown;
|
|
196
220
|
}, "bootstrapNodes" | "dataDirectory" | "dataStoreMapSizeKb" | "l1ChainId" | "listenAddress" | "p2pBroadcastPort" | "p2pIp" | "p2pPort" | "peerIdPrivateKey" | "peerIdPrivateKeyPath" | "queryForIp">>;
|
|
@@ -206,4 +230,4 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
206
230
|
* @returns A list of allowed elements
|
|
207
231
|
*/
|
|
208
232
|
export declare function parseAllowList(value: string): AllowedElement[];
|
|
209
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
233
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLGtCQUFrQixFQUN2QixXQUFXLEVBUVosTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQXNCLE1BQU0sd0JBQXdCLENBQUM7QUFHbEYsT0FBTyxFQUNMLEtBQUssY0FBYyxFQUNuQixLQUFLLFdBQVcsRUFDaEIsS0FBSyxlQUFlLEVBR3J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Ozs7Ozs7O3NNQUdsQyxDQUFDO0FBRUY7Ozs7Ozs7Ozs7R0FVRztBQUNILHdCQUFnQixjQUFjLENBQUMsS0FBSyxFQUFFLE1BQU0sR0FBRyxjQUFjLEVBQUUsQ0FxQzlEIn0=
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,WAAW,EAQZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAGlF,OAAO,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,WAAW,EAQZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,EAGrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,oCAAoC,CAAC;AACzG,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,oCAAoC,CAAC;AAEvG;;GAEG;AACH,MAAM,WAAW,SACf,SAAQ,gBAAgB,EACtB,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC;IAC1C,oEAAoE;IACpE,UAAU,EAAE,OAAO,CAAC;IAEpB,yDAAyD;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAE7B,wDAAwD;IACxD,mBAAm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ACxB;AAED,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAEtC,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,SAAS,CAyR3D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,SAAS,EACP,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,10 +3,11 @@ 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';
|
|
10
|
+
import { txFileStoreConfigMappings } from './services/tx_file_store/config.js';
|
|
10
11
|
export const DEFAULT_P2P_PORT = 40400;
|
|
11
12
|
export const p2pConfigMappings = {
|
|
12
13
|
p2pEnabled: {
|
|
@@ -24,6 +25,11 @@ export const p2pConfigMappings = {
|
|
|
24
25
|
description: 'The frequency in which to check for new L2 blocks.',
|
|
25
26
|
...numberConfigHelper(100)
|
|
26
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
|
+
},
|
|
27
33
|
debugDisableColocationPenalty: {
|
|
28
34
|
env: 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY',
|
|
29
35
|
description: 'DEBUG: Disable colocation penalty - NEVER set to true in production',
|
|
@@ -263,10 +269,21 @@ export const p2pConfigMappings = {
|
|
|
263
269
|
description: 'Whether to run in fisherman mode: validates all proposals and attestations but does not broadcast attestations or participate in consensus.',
|
|
264
270
|
...booleanConfigHelper(false)
|
|
265
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,
|
|
266
282
|
...p2pReqRespConfigMappings,
|
|
267
283
|
...batchTxRequesterConfigMappings,
|
|
268
284
|
...chainConfigMappings,
|
|
269
|
-
...txCollectionConfigMappings
|
|
285
|
+
...txCollectionConfigMappings,
|
|
286
|
+
...txFileStoreConfigMappings
|
|
270
287
|
};
|
|
271
288
|
/**
|
|
272
289
|
* Gets the config values for p2p client from environment variables.
|
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=
|