@aztec/p2p 0.0.1-commit.023c3e5 → 0.0.1-commit.0658669b3
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 +7 -6
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +36 -10
- package/dest/client/interface.d.ts +45 -32
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +40 -50
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +149 -200
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +6 -6
- package/dest/config.d.ts +30 -8
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +19 -7
- package/dest/errors/tx-pool.error.d.ts +8 -0
- package/dest/errors/tx-pool.error.d.ts.map +1 -0
- package/dest/errors/tx-pool.error.js +9 -0
- package/dest/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 +104 -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 +251 -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 +128 -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 +95 -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 +174 -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 +25 -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 +78 -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 +73 -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/instrumentation.d.ts +15 -0
- package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/instrumentation.js +43 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +211 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.js +9 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +105 -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 +164 -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 +108 -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 +355 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +60 -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 +161 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +77 -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 +891 -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 +4 -4
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +3 -3
- package/dest/msg_validators/tx_validator/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/factory.d.ts +114 -6
- package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/factory.js +219 -58
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +58 -3
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.js +73 -36
- package/dest/msg_validators/tx_validator/index.d.ts +2 -1
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +1 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.d.ts +14 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.js +24 -0
- package/dest/msg_validators/tx_validator/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 +13 -5
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +10 -4
- package/dest/services/encoding.d.ts +2 -2
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +4 -3
- 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 +173 -0
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -0
- package/dest/services/gossipsub/topic_score_params.js +346 -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 +90 -37
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +413 -327
- 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 +6 -5
- 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 +26 -53
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts +2 -6
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +10 -13
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.js +25 -46
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +17 -11
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/peer_collection.js +49 -15
- package/dest/services/reqresp/batch-tx-requester/tx_validator.js +2 -2
- 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 +39 -3
- 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 +64 -48
- 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 +167 -0
- package/dest/services/tx_collection/file_store_tx_source.d.ts +37 -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 +90 -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/instrumentation.d.ts +1 -1
- package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
- package/dest/services/tx_collection/instrumentation.js +2 -1
- package/dest/services/tx_collection/missing_txs_tracker.d.ts +32 -0
- package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +1 -0
- package/dest/services/tx_collection/missing_txs_tracker.js +27 -0
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +15 -14
- package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -1
- package/dest/services/tx_collection/proposal_tx_collector.js +6 -6
- package/dest/services/tx_collection/slow_tx_collection.d.ts +7 -3
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/slow_tx_collection.js +60 -26
- package/dest/services/tx_collection/tx_collection.d.ts +23 -10
- 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 +18 -8
- package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection_sink.js +26 -29
- package/dest/services/tx_collection/tx_source.d.ts +8 -3
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_source.js +19 -2
- package/dest/services/tx_file_store/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 +4 -4
- package/dest/services/tx_provider.d.ts.map +1 -1
- package/dest/services/tx_provider.js +9 -8
- 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 +29 -2
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +103 -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 +43 -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.d.ts +2 -2
- package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
- package/dest/testbench/p2p_client_testbench_worker.js +10 -10
- package/dest/util.d.ts +2 -2
- package/dest/util.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/client/factory.ts +69 -13
- package/src/client/interface.ts +61 -33
- package/src/client/p2p_client.ts +184 -236
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +19 -9
- package/src/config.ts +42 -11
- package/src/errors/tx-pool.error.ts +12 -0
- 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 +321 -0
- package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +160 -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 +122 -0
- package/src/mem_pools/tx_pool_v2/eviction/index.ts +27 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +209 -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 +91 -0
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +90 -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/instrumentation.ts +69 -0
- package/src/mem_pools/tx_pool_v2/interfaces.ts +242 -0
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +255 -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 +444 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +223 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +1063 -0
- package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +2 -2
- package/src/msg_validators/tx_validator/README.md +115 -0
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +5 -5
- 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/factory.ts +353 -77
- package/src/msg_validators/tx_validator/gas_validator.ts +90 -27
- package/src/msg_validators/tx_validator/index.ts +1 -0
- package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
- package/src/msg_validators/tx_validator/timestamp_validator.ts +23 -18
- package/src/services/dummy_service.ts +18 -6
- package/src/services/encoding.ts +4 -3
- package/src/services/gossipsub/README.md +641 -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 +487 -0
- package/src/services/index.ts +1 -0
- package/src/services/libp2p/libp2p_service.ts +440 -349
- 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 +31 -59
- package/src/services/reqresp/batch-tx-requester/interface.ts +1 -5
- package/src/services/reqresp/batch-tx-requester/missing_txs.ts +23 -71
- package/src/services/reqresp/batch-tx-requester/peer_collection.ts +63 -24
- package/src/services/reqresp/batch-tx-requester/tx_validator.ts +2 -2
- 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 +51 -2
- package/src/services/tx_collection/config.ts +74 -6
- package/src/services/tx_collection/fast_tx_collection.ts +74 -51
- package/src/services/tx_collection/file_store_tx_collection.ts +202 -0
- package/src/services/tx_collection/file_store_tx_source.ts +117 -0
- package/src/services/tx_collection/index.ts +2 -1
- package/src/services/tx_collection/instrumentation.ts +7 -1
- package/src/services/tx_collection/missing_txs_tracker.ts +52 -0
- package/src/services/tx_collection/proposal_tx_collector.ts +20 -21
- package/src/services/tx_collection/slow_tx_collection.ts +66 -33
- package/src/services/tx_collection/tx_collection.ts +113 -16
- package/src/services/tx_collection/tx_collection_sink.ts +30 -34
- package/src/services/tx_collection/tx_source.ts +22 -3
- 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 +10 -9
- package/src/test-helpers/make-test-p2p-clients.ts +3 -3
- package/src/test-helpers/mock-pubsub.ts +143 -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 +22 -15
- package/src/util.ts +7 -1
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CollectorType, type DistributionPattern } from '../test-helpers/
|
|
1
|
+
import { type CollectorType, type DistributionPattern } from '../test-helpers/index.js';
|
|
2
2
|
export type { DistributionPattern, CollectorType } from '../test-helpers/testbench-utils.js';
|
|
3
3
|
export { COLLECTOR_DISPLAY_NAMES } from '../test-helpers/testbench-utils.js';
|
|
4
4
|
export interface BenchReqRespCommand {
|
|
@@ -25,4 +25,4 @@ export interface BenchResultMessage {
|
|
|
25
25
|
export interface BenchReadyMessage {
|
|
26
26
|
type: 'BENCH_READY';
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicDJwX2NsaWVudF90ZXN0YmVuY2hfd29ya2VyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGVzdGJlbmNoL3AycF9jbGllbnRfdGVzdGJlbmNoX3dvcmtlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0Q0EsT0FBTyxFQUVMLEtBQUssYUFBYSxFQUNsQixLQUFLLG1CQUFtQixFQU96QixNQUFNLDBCQUEwQixDQUFDO0FBR2xDLFlBQVksRUFBRSxtQkFBbUIsRUFBRSxhQUFhLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQztBQUM3RixPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQztBQUU3RSxNQUFNLFdBQVcsbUJBQW1CO0lBQ2xDLElBQUksRUFBRSxlQUFlLENBQUM7SUFDdEIsT0FBTyxFQUFFLE1BQU0sQ0FBQztJQUNoQixTQUFTLEVBQUUsTUFBTSxDQUFDO0lBQ2xCLFlBQVksRUFBRSxtQkFBbUIsQ0FBQztJQUNsQyxhQUFhLEVBQUUsYUFBYSxDQUFDO0lBQzdCLFNBQVMsRUFBRSxNQUFNLENBQUM7SUFDbEIsWUFBWSxFQUFFLE9BQU8sQ0FBQztJQUN0QixTQUFTLEVBQUUsTUFBTSxDQUFDO0lBQ2xCLGVBQWUsQ0FBQyxFQUFFLE1BQU0sQ0FBQztJQUN6QixZQUFZLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDdEIsV0FBVyxFQUFFLE1BQU0sQ0FBQztJQUNwQixJQUFJLEVBQUUsTUFBTSxDQUFDO0NBQ2Q7QUFFRCxNQUFNLFdBQVcsa0JBQWtCO0lBQ2pDLElBQUksRUFBRSxjQUFjLENBQUM7SUFDckIsVUFBVSxFQUFFLE1BQU0sQ0FBQztJQUNuQixZQUFZLEVBQUUsTUFBTSxDQUFDO0lBQ3JCLE9BQU8sRUFBRSxPQUFPLENBQUM7SUFDakIsS0FBSyxDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ2hCO0FBRUQsTUFBTSxXQUFXLGlCQUFpQjtJQUNoQyxJQUFJLEVBQUUsYUFBYSxDQUFDO0NBQ3JCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_client_testbench_worker.d.ts","sourceRoot":"","sources":["../../src/testbench/p2p_client_testbench_worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"p2p_client_testbench_worker.d.ts","sourceRoot":"","sources":["../../src/testbench/p2p_client_testbench_worker.ts"],"names":[],"mappings":"AA4CA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAOzB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,mBAAmB,CAAC;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,CAAC;CACrB"}
|
|
@@ -21,11 +21,11 @@ import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
|
21
21
|
import { TopicValidatorResult } from '@libp2p/interface';
|
|
22
22
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
23
23
|
import { createP2PClient } from '../index.js';
|
|
24
|
-
import { LibP2PService } from '../services/
|
|
24
|
+
import { BatchTxRequesterCollector, LibP2PService, SendBatchRequestCollector } from '../services/index.js';
|
|
25
25
|
import { RateLimitStatus } from '../services/reqresp/rate-limiter/rate_limiter.js';
|
|
26
|
-
import {
|
|
27
|
-
import { AlwaysTrueCircuitVerifier } from '../test-helpers/
|
|
28
|
-
import { BENCHMARK_CONSTANTS, InMemoryAttestationPool, InMemoryTxPool, UNLIMITED_RATE_LIMIT_QUOTA, createMockEpochCache, createMockWorldStateSynchronizer, filterTxsByDistribution } from '../test-helpers/
|
|
26
|
+
import { MissingTxsTracker } from '../services/tx_collection/missing_txs_tracker.js';
|
|
27
|
+
import { AlwaysTrueCircuitVerifier } from '../test-helpers/index.js';
|
|
28
|
+
import { BENCHMARK_CONSTANTS, InMemoryAttestationPool, InMemoryTxPool, UNLIMITED_RATE_LIMIT_QUOTA, createMockEpochCache, createMockWorldStateSynchronizer, filterTxsByDistribution } from '../test-helpers/index.js';
|
|
29
29
|
export { COLLECTOR_DISPLAY_NAMES } from '../test-helpers/testbench-utils.js';
|
|
30
30
|
const txCache = new Map();
|
|
31
31
|
class TestLibP2PService extends LibP2PService {
|
|
@@ -49,7 +49,7 @@ class TestLibP2PService extends LibP2PService {
|
|
|
49
49
|
const txHash = tx.getTxHash();
|
|
50
50
|
const txHashString = txHash.toString();
|
|
51
51
|
this.logger.verbose(`Received tx ${txHashString} from external peer ${source.toString()}.`);
|
|
52
|
-
await this.mempools.txPool.
|
|
52
|
+
await this.mempools.txPool.addPendingTxs([
|
|
53
53
|
tx
|
|
54
54
|
]);
|
|
55
55
|
} else {
|
|
@@ -70,7 +70,7 @@ async function generateDeterministicTxs(txCount, seed, config) {
|
|
|
70
70
|
if (cached.length >= txCount) {
|
|
71
71
|
return cached.slice(0, txCount);
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const expirationTimestampBase = BigInt(seed);
|
|
74
74
|
for(let i = cached.length; i < txCount; i++){
|
|
75
75
|
const txSeed = seed * 10000 + i;
|
|
76
76
|
const tx = await mockTx(txSeed, {
|
|
@@ -86,7 +86,7 @@ async function generateDeterministicTxs(txCount, seed, config) {
|
|
|
86
86
|
hasPublicTeardownCallRequest: false,
|
|
87
87
|
publicCalldataSize: 0
|
|
88
88
|
});
|
|
89
|
-
tx.data.
|
|
89
|
+
tx.data.expirationTimestamp = expirationTimestampBase + BigInt(i);
|
|
90
90
|
await tx.recomputeHash();
|
|
91
91
|
cached.push(tx);
|
|
92
92
|
}
|
|
@@ -154,7 +154,7 @@ async function runAggregatorBenchmark(client, blockProposal, collectorType, time
|
|
|
154
154
|
timer = new Timer();
|
|
155
155
|
if (collectorType === 'batch-requester') {
|
|
156
156
|
const collector = new BatchTxRequesterCollector(batchTxRequesterService, logger, new DateProvider(), noopTxValidator);
|
|
157
|
-
const fetchedTxs = await collector.collectTxs(txHashes, blockProposal, pinnedPeer, timeoutMs);
|
|
157
|
+
const fetchedTxs = await collector.collectTxs(MissingTxsTracker.fromArray(txHashes), blockProposal, pinnedPeer, timeoutMs);
|
|
158
158
|
const durationMs = timer.ms();
|
|
159
159
|
return {
|
|
160
160
|
type: 'BENCH_RESULT',
|
|
@@ -164,7 +164,7 @@ async function runAggregatorBenchmark(client, blockProposal, collectorType, time
|
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
const collector = new SendBatchRequestCollector(batchTxRequesterService, BENCHMARK_CONSTANTS.FIXED_MAX_PEERS, BENCHMARK_CONSTANTS.FIXED_MAX_RETRY_ATTEMPTS);
|
|
167
|
-
const fetchedTxs = await collector.collectTxs(txHashes, blockProposal, pinnedPeer, timeoutMs);
|
|
167
|
+
const fetchedTxs = await collector.collectTxs(MissingTxsTracker.fromArray(txHashes), blockProposal, pinnedPeer, timeoutMs);
|
|
168
168
|
const durationMs = timer.ms();
|
|
169
169
|
return {
|
|
170
170
|
type: 'BENCH_RESULT',
|
|
@@ -273,7 +273,7 @@ process.on('message', async (msg)=>{
|
|
|
273
273
|
const allTxs = await generateDeterministicTxs(benchCmd.txCount, benchCmd.seed, workerConfig);
|
|
274
274
|
const txHashes = allTxs.map((tx)=>tx.getTxHash());
|
|
275
275
|
const blockProposal = await createBlockProposal(benchCmd.blockNumber, txHashes, benchCmd.seed);
|
|
276
|
-
await workerAttestationPool.
|
|
276
|
+
await workerAttestationPool.tryAddBlockProposal(blockProposal);
|
|
277
277
|
workerLogger.debug(`[BENCH] Added block proposal with archive ${blockProposal.archive.toString().slice(0, 10)}...`);
|
|
278
278
|
if (benchCmd.isAggregator) {
|
|
279
279
|
workerTxPool.clearTxs();
|
package/dest/util.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Libp2p } from 'libp2p';
|
|
|
10
10
|
import type { P2PConfig } from './config.js';
|
|
11
11
|
export interface PubSubLibp2p extends Pick<Libp2p, 'status' | 'start' | 'stop' | 'peerId'> {
|
|
12
12
|
services: {
|
|
13
|
-
pubsub: Pick<GossipSub, 'addEventListener' | 'removeEventListener' | 'publish' | 'subscribe' | 'reportMessageValidationResult' | 'direct'> & {
|
|
13
|
+
pubsub: Pick<GossipSub, 'addEventListener' | 'removeEventListener' | 'publish' | 'subscribe' | 'reportMessageValidationResult' | 'direct' | 'getMeshPeers'> & {
|
|
14
14
|
score: Pick<GossipSub['score'], 'score'>;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -58,4 +58,4 @@ export declare function getPeerIdPrivateKey(config: {
|
|
|
58
58
|
* @returns The peer ID.
|
|
59
59
|
*/
|
|
60
60
|
export declare function createLibP2PPeerIdFromPrivateKey(privateKey: string): Promise<PeerId>;
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3V0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ3ZELE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUF1QixNQUFNLGlCQUFpQixDQUFDO0FBQzlFLE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRTlELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRTdELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2pELE9BQU8sS0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AE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EACzG,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CA2D9B;AAED;;;;GAIG;AACH,wBAAsB,gCAAgC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS1F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/p2p",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.0658669b3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/constants": "0.0.1-commit.
|
|
71
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
72
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
73
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
74
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
75
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
77
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
78
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
79
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
80
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
70
|
+
"@aztec/constants": "0.0.1-commit.0658669b3",
|
|
71
|
+
"@aztec/epoch-cache": "0.0.1-commit.0658669b3",
|
|
72
|
+
"@aztec/ethereum": "0.0.1-commit.0658669b3",
|
|
73
|
+
"@aztec/foundation": "0.0.1-commit.0658669b3",
|
|
74
|
+
"@aztec/kv-store": "0.0.1-commit.0658669b3",
|
|
75
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.0658669b3",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.0658669b3",
|
|
77
|
+
"@aztec/protocol-contracts": "0.0.1-commit.0658669b3",
|
|
78
|
+
"@aztec/simulator": "0.0.1-commit.0658669b3",
|
|
79
|
+
"@aztec/stdlib": "0.0.1-commit.0658669b3",
|
|
80
|
+
"@aztec/telemetry-client": "0.0.1-commit.0658669b3",
|
|
81
81
|
"@chainsafe/libp2p-gossipsub": "13.0.0",
|
|
82
82
|
"@chainsafe/libp2p-noise": "^15.0.0",
|
|
83
83
|
"@chainsafe/libp2p-yamux": "^6.0.2",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"xxhash-wasm": "^1.1.0"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
108
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
107
|
+
"@aztec/archiver": "0.0.1-commit.0658669b3",
|
|
108
|
+
"@aztec/world-state": "0.0.1-commit.0658669b3",
|
|
109
109
|
"@jest/globals": "^30.0.0",
|
|
110
110
|
"@types/jest": "^30.0.0",
|
|
111
111
|
"@types/node": "^22.15.17",
|
package/src/client/factory.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
3
4
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
4
5
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
@@ -7,28 +8,32 @@ import { AztecLMDBStoreV2, createStore } from '@aztec/kv-store/lmdb-v2';
|
|
|
7
8
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
8
9
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
9
10
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
10
|
-
import type { ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
11
|
+
import type { AztecNode, ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
11
12
|
import { P2PClientType } from '@aztec/stdlib/p2p';
|
|
12
13
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
13
14
|
|
|
14
15
|
import { P2PClient } from '../client/p2p_client.js';
|
|
15
16
|
import type { P2PConfig } from '../config.js';
|
|
16
|
-
import
|
|
17
|
-
import { KvAttestationPool } from '../mem_pools/attestation_pool/kv_attestation_pool.js';
|
|
17
|
+
import { AttestationPool, type AttestationPoolApi } from '../mem_pools/attestation_pool/attestation_pool.js';
|
|
18
18
|
import type { MemPools } from '../mem_pools/interface.js';
|
|
19
|
-
import {
|
|
19
|
+
import type { TxPoolV2 } from '../mem_pools/tx_pool_v2/interfaces.js';
|
|
20
|
+
import { AztecKVTxPoolV2 } from '../mem_pools/tx_pool_v2/tx_pool_v2.js';
|
|
21
|
+
import { createTxValidatorForTransactionsEnteringPendingTxPool } from '../msg_validators/index.js';
|
|
20
22
|
import { DummyP2PService } from '../services/dummy_service.js';
|
|
21
23
|
import { LibP2PService } from '../services/index.js';
|
|
24
|
+
import { createFileStoreTxSources } from '../services/tx_collection/file_store_tx_source.js';
|
|
22
25
|
import { TxCollection } from '../services/tx_collection/tx_collection.js';
|
|
23
|
-
import { type TxSource, createNodeRpcTxSources } from '../services/tx_collection/tx_source.js';
|
|
26
|
+
import { NodeRpcTxSource, type TxSource, createNodeRpcTxSources } from '../services/tx_collection/tx_source.js';
|
|
27
|
+
import { TxFileStore } from '../services/tx_file_store/tx_file_store.js';
|
|
24
28
|
import { configureP2PClientAddresses, createLibP2PPeerIdFromPrivateKey, getPeerIdPrivateKey } from '../util.js';
|
|
25
29
|
|
|
26
30
|
export type P2PClientDeps<T extends P2PClientType> = {
|
|
27
|
-
txPool?:
|
|
31
|
+
txPool?: TxPoolV2;
|
|
28
32
|
store?: AztecAsyncKVStore;
|
|
29
|
-
attestationPool?:
|
|
33
|
+
attestationPool?: AttestationPoolApi;
|
|
30
34
|
logger?: Logger;
|
|
31
35
|
txCollectionNodeSources?: TxSource[];
|
|
36
|
+
rpcTxProviders?: AztecNode[];
|
|
32
37
|
p2pServiceFactory?: (...args: Parameters<(typeof LibP2PService)['new']>) => Promise<LibP2PService<T>>;
|
|
33
38
|
};
|
|
34
39
|
|
|
@@ -69,14 +74,41 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
69
74
|
const attestationStore = await createStore(P2P_ATTESTATION_STORE_NAME, 1, config, bindings);
|
|
70
75
|
const l1Constants = await archiver.getL1Constants();
|
|
71
76
|
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
const rollupAddress = inputConfig.l1Contracts.rollupAddress.toString().toLowerCase().replace(/^0x/, '');
|
|
78
|
+
const txFileStoreBasePath = `aztec-${inputConfig.l1ChainId}-${inputConfig.rollupVersion}-0x${rollupAddress}`;
|
|
79
|
+
|
|
80
|
+
const txPool =
|
|
81
|
+
deps.txPool ??
|
|
82
|
+
new AztecKVTxPoolV2(
|
|
83
|
+
store,
|
|
84
|
+
archive,
|
|
85
|
+
{
|
|
86
|
+
l2BlockSource: archiver,
|
|
87
|
+
worldStateSynchronizer,
|
|
88
|
+
createTxValidator: async () => {
|
|
89
|
+
// We accept transactions if they are not expired by the next slot and block number (checked based on the ExpirationTimestamp field)
|
|
90
|
+
const currentBlockNumber = await archiver.getBlockNumber();
|
|
91
|
+
const { ts: nextSlotTimestamp } = epochCache.getEpochAndSlotInNextL1Slot();
|
|
92
|
+
return createTxValidatorForTransactionsEnteringPendingTxPool(
|
|
93
|
+
worldStateSynchronizer,
|
|
94
|
+
nextSlotTimestamp,
|
|
95
|
+
BlockNumber(currentBlockNumber + 1),
|
|
96
|
+
);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
telemetry,
|
|
100
|
+
{
|
|
76
101
|
maxPendingTxCount: config.maxPendingTxCount,
|
|
77
102
|
archivedTxLimit: config.archivedTxLimit,
|
|
78
|
-
|
|
79
|
-
|
|
103
|
+
minTxPoolAgeMs: config.minTxPoolAgeMs,
|
|
104
|
+
dropTransactionsProbability: config.dropTransactionsProbability,
|
|
105
|
+
},
|
|
106
|
+
dateProvider,
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const mempools: MemPools = {
|
|
110
|
+
txPool,
|
|
111
|
+
attestationPool: deps.attestationPool ?? new AttestationPool(attestationStore, telemetry),
|
|
80
112
|
};
|
|
81
113
|
|
|
82
114
|
const p2pService = await createP2PService<T>(
|
|
@@ -97,6 +129,7 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
97
129
|
|
|
98
130
|
const nodeSources = [
|
|
99
131
|
...createNodeRpcTxSources(config.txCollectionNodeRpcUrls, config),
|
|
132
|
+
...(deps.rpcTxProviders ?? []).map((node, i) => new NodeRpcTxSource(node, `node-rpc-provider-${i}`)),
|
|
100
133
|
...(deps.txCollectionNodeSources ?? []),
|
|
101
134
|
];
|
|
102
135
|
if (nodeSources.length > 0) {
|
|
@@ -105,17 +138,38 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
105
138
|
});
|
|
106
139
|
}
|
|
107
140
|
|
|
141
|
+
const fileStoreSources = await createFileStoreTxSources(
|
|
142
|
+
config.txCollectionFileStoreUrls,
|
|
143
|
+
txFileStoreBasePath,
|
|
144
|
+
logger.createChild('file-store-tx-source'),
|
|
145
|
+
telemetry,
|
|
146
|
+
);
|
|
147
|
+
if (fileStoreSources.length > 0) {
|
|
148
|
+
logger.info(`Using ${fileStoreSources.length} file store sources for tx collection.`, {
|
|
149
|
+
stores: fileStoreSources.map(s => s.getInfo()),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
108
153
|
const txCollection = new TxCollection(
|
|
109
154
|
p2pService.getBatchTxRequesterService(),
|
|
110
155
|
nodeSources,
|
|
111
156
|
l1Constants,
|
|
112
157
|
mempools.txPool,
|
|
113
158
|
config,
|
|
159
|
+
fileStoreSources,
|
|
114
160
|
dateProvider,
|
|
115
161
|
telemetry,
|
|
116
162
|
logger.createChild('tx-collection'),
|
|
117
163
|
);
|
|
118
164
|
|
|
165
|
+
const txFileStore = await TxFileStore.create(
|
|
166
|
+
mempools.txPool,
|
|
167
|
+
config,
|
|
168
|
+
txFileStoreBasePath,
|
|
169
|
+
logger.createChild('tx-file-store'),
|
|
170
|
+
telemetry,
|
|
171
|
+
);
|
|
172
|
+
|
|
119
173
|
return new P2PClient(
|
|
120
174
|
clientType,
|
|
121
175
|
store,
|
|
@@ -123,6 +177,8 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
123
177
|
mempools,
|
|
124
178
|
p2pService,
|
|
125
179
|
txCollection,
|
|
180
|
+
txFileStore,
|
|
181
|
+
epochCache,
|
|
126
182
|
config,
|
|
127
183
|
dateProvider,
|
|
128
184
|
telemetry,
|
package/src/client/interface.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { EthAddress, L2BlockId } from '@aztec/stdlib/block';
|
|
2
|
-
import type { P2PApiFull } from '@aztec/stdlib/interfaces/server';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type { ITxProvider, P2PApiFull } from '@aztec/stdlib/interfaces/server';
|
|
4
|
+
import type {
|
|
5
|
+
BlockProposal,
|
|
6
|
+
CheckpointAttestation,
|
|
7
|
+
CheckpointProposal,
|
|
8
|
+
P2PClientType,
|
|
9
|
+
TopicType,
|
|
10
|
+
} from '@aztec/stdlib/p2p';
|
|
11
|
+
import type { BlockHeader, Tx, TxHash } from '@aztec/stdlib/tx';
|
|
5
12
|
|
|
6
13
|
import type { PeerId } from '@libp2p/interface';
|
|
7
14
|
import type { ENR } from '@nethermindeth/enr';
|
|
@@ -13,7 +20,12 @@ import type {
|
|
|
13
20
|
ReqRespSubProtocolHandler,
|
|
14
21
|
ReqRespSubProtocolValidators,
|
|
15
22
|
} from '../services/reqresp/interface.js';
|
|
16
|
-
import type {
|
|
23
|
+
import type {
|
|
24
|
+
DuplicateAttestationInfo,
|
|
25
|
+
DuplicateProposalInfo,
|
|
26
|
+
P2PBlockReceivedCallback,
|
|
27
|
+
P2PCheckpointReceivedCallback,
|
|
28
|
+
} from '../services/service.js';
|
|
17
29
|
|
|
18
30
|
/**
|
|
19
31
|
* Enum defining the possible states of the p2p client.
|
|
@@ -79,12 +91,21 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
79
91
|
registerCheckpointProposalHandler(callback: P2PCheckpointReceivedCallback): void;
|
|
80
92
|
|
|
81
93
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @
|
|
94
|
+
* Registers a callback invoked when a duplicate proposal is detected (equivocation).
|
|
95
|
+
* The callback is triggered on the first duplicate (when count goes from 1 to 2).
|
|
96
|
+
*
|
|
97
|
+
* @param callback - Function called with info about the duplicate proposal
|
|
98
|
+
*/
|
|
99
|
+
registerDuplicateProposalCallback(callback: (info: DuplicateProposalInfo) => void): void;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Registers a callback invoked when a duplicate attestation is detected (equivocation).
|
|
103
|
+
* A validator signing attestations for different proposals at the same slot.
|
|
104
|
+
* The callback is triggered on the first duplicate (when count goes from 1 to 2).
|
|
105
|
+
*
|
|
106
|
+
* @param callback - Function called with info about the duplicate attestation
|
|
86
107
|
*/
|
|
87
|
-
|
|
108
|
+
registerDuplicateAttestationCallback(callback: (info: DuplicateAttestationInfo) => void): void;
|
|
88
109
|
|
|
89
110
|
/**
|
|
90
111
|
* Verifies the 'tx' and, if valid, adds it to local tx pool and forwards it to other peers.
|
|
@@ -93,18 +114,10 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
93
114
|
sendTx(tx: Tx): Promise<void>;
|
|
94
115
|
|
|
95
116
|
/**
|
|
96
|
-
*
|
|
97
|
-
* @param
|
|
98
|
-
* @returns The number of txs added to the pool. Note if the transaction already exists, it will not be added again.
|
|
99
|
-
**/
|
|
100
|
-
addTxsToPool(txs: Tx[]): Promise<number>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Deletes 'txs' from the pool, given hashes.
|
|
104
|
-
* NOT used if we use sendTx as reconcileTxPool will handle this.
|
|
105
|
-
* @param txHashes - Hashes to check.
|
|
117
|
+
* Handles failed transaction execution by removing txs from the pool.
|
|
118
|
+
* @param txHashes - Hashes of the transactions that failed execution.
|
|
106
119
|
**/
|
|
107
|
-
|
|
120
|
+
handleFailedExecution(txHashes: TxHash[]): Promise<void>;
|
|
108
121
|
|
|
109
122
|
/**
|
|
110
123
|
* Returns a transaction in the transaction pool by its hash.
|
|
@@ -127,14 +140,6 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
127
140
|
*/
|
|
128
141
|
hasTxsInPool(txHashes: TxHash[]): Promise<boolean[]>;
|
|
129
142
|
|
|
130
|
-
/**
|
|
131
|
-
* Returns transactions in the transaction pool by hash, requesting from the network if not found.
|
|
132
|
-
* @param txHashes - Hashes of tx to return.
|
|
133
|
-
* @param pinnedPeerId - An optional peer id that will be used to request the tx from (in addition to other random peers).
|
|
134
|
-
* @returns An array of tx or undefined.
|
|
135
|
-
*/
|
|
136
|
-
getTxsByHash(txHashes: TxHash[], pinnedPeerId: PeerId | undefined): Promise<(Tx | undefined)[]>;
|
|
137
|
-
|
|
138
143
|
/**
|
|
139
144
|
* Returns an archived transaction from the transaction pool by its hash.
|
|
140
145
|
* @param txHash - Hash of tx to return.
|
|
@@ -152,14 +157,28 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
152
157
|
/** Returns an iterator over pending txs on the mempool. */
|
|
153
158
|
iteratePendingTxs(): AsyncIterableIterator<Tx>;
|
|
154
159
|
|
|
160
|
+
/** Returns an iterator over pending txs that have been in the pool long enough to be eligible for block building. */
|
|
161
|
+
iterateEligiblePendingTxs(): AsyncIterableIterator<Tx>;
|
|
162
|
+
|
|
155
163
|
/** Returns the number of pending txs in the mempool. */
|
|
156
164
|
getPendingTxCount(): Promise<number>;
|
|
157
165
|
|
|
158
166
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
167
|
+
* Protects existing transactions by hash for a given slot.
|
|
168
|
+
* Returns hashes of transactions that weren't found in the pool.
|
|
169
|
+
* @param txHashes - Hashes of the transactions to protect.
|
|
170
|
+
* @param blockHeader - The block header providing slot context.
|
|
171
|
+
* @returns Hashes of transactions not found in the pool.
|
|
172
|
+
*/
|
|
173
|
+
protectTxs(txHashes: TxHash[], blockHeader: BlockHeader): Promise<TxHash[]>;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Prepares the pool for a new slot.
|
|
177
|
+
* Unprotects transactions from earlier slots and validates them before
|
|
178
|
+
* returning to pending state.
|
|
179
|
+
* @param slotNumber - The slot number to prepare for
|
|
161
180
|
*/
|
|
162
|
-
|
|
181
|
+
prepareForSlot(slotNumber: SlotNumber): Promise<void>;
|
|
163
182
|
|
|
164
183
|
/**
|
|
165
184
|
* Starts the p2p client.
|
|
@@ -192,10 +211,13 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
192
211
|
/** Identifies a p2p client. */
|
|
193
212
|
isP2PClient(): true;
|
|
194
213
|
|
|
214
|
+
/** Returns the tx provider used for fetching transactions. */
|
|
215
|
+
getTxProvider(): ITxProvider;
|
|
216
|
+
|
|
195
217
|
updateP2PConfig(config: Partial<P2PConfig>): Promise<void>;
|
|
196
218
|
|
|
197
|
-
/** Validates a set of txs. */
|
|
198
|
-
|
|
219
|
+
/** Validates a set of txs received in a block proposal. */
|
|
220
|
+
validateTxsReceivedInBlockProposal(txs: Tx[]): Promise<void>;
|
|
199
221
|
|
|
200
222
|
/** Clears the db. */
|
|
201
223
|
clear(): Promise<void>;
|
|
@@ -208,6 +230,12 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
208
230
|
|
|
209
231
|
handleAuthRequestFromPeer(authRequest: AuthRequest, peerId: PeerId): Promise<StatusMessage>;
|
|
210
232
|
|
|
233
|
+
/** Checks if any block proposals exist for the given slot. */
|
|
234
|
+
hasBlockProposalsForSlot(slot: SlotNumber): Promise<boolean>;
|
|
235
|
+
|
|
211
236
|
/** If node running this P2P stack is validator, passes in validator address to P2P layer */
|
|
212
237
|
registerThisValidatorAddresses(address: EthAddress[]): void;
|
|
238
|
+
|
|
239
|
+
/** Returns the number of peers in the GossipSub mesh for a given topic type. */
|
|
240
|
+
getGossipMeshPeerCount(topicType: TopicType): Promise<number>;
|
|
213
241
|
};
|