@aztec/p2p 5.0.0-private.20260319 → 5.0.0-rc.2
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/README.md +4 -1
- package/dest/bootstrap/bootstrap.d.ts +1 -1
- package/dest/bootstrap/bootstrap.d.ts.map +1 -1
- package/dest/bootstrap/bootstrap.js +22 -6
- package/dest/client/factory.d.ts +4 -3
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +33 -24
- package/dest/client/interface.d.ts +43 -11
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +33 -19
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +100 -44
- package/dest/config.d.ts +137 -107
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +64 -23
- package/dest/errors/p2p-service.error.d.ts +9 -0
- package/dest/errors/p2p-service.error.d.ts.map +1 -0
- package/dest/errors/p2p-service.error.js +10 -0
- package/dest/errors/reqresp.error.d.ts +1 -20
- package/dest/errors/reqresp.error.d.ts.map +1 -1
- package/dest/errors/reqresp.error.js +0 -21
- package/dest/index.d.ts +1 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +98 -56
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +265 -196
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +1 -1
- 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 +175 -59
- package/dest/mem_pools/attestation_pool/mocks.d.ts +1 -1
- package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/mocks.js +6 -4
- package/dest/mem_pools/index.d.ts +1 -2
- package/dest/mem_pools/index.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.d.ts +1 -1
- package/dest/mem_pools/instrumentation.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.js +17 -1
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts +1 -5
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.js +1 -7
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +3 -3
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/deleted_pool.js +6 -6
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +2 -1
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/index.js +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.d.ts +16 -0
- package/dest/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.js +62 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +2 -2
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +22 -5
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +5 -2
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +13 -6
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +7 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +10 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +8 -3
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +7 -4
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +8 -3
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +153 -111
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +10 -3
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/attestation_validator.js +38 -16
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +7 -3
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.js +4 -5
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +8 -3
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/block_proposal_validator.js +2 -2
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +8 -3
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +8 -2
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +25 -3
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator.js +77 -14
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +1 -1
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +8 -15
- package/dest/msg_validators/tx_validator/allowed_public_setup.js +3 -3
- package/dest/msg_validators/tx_validator/archive_cache.js +1 -1
- package/dest/msg_validators/tx_validator/cached_tx_validator.d.ts +15 -0
- package/dest/msg_validators/tx_validator/cached_tx_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/cached_tx_validator.js +19 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts +9 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.js +48 -0
- package/dest/msg_validators/tx_validator/data_validator.d.ts +2 -1
- package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/data_validator.js +36 -2
- package/dest/msg_validators/tx_validator/factory.d.ts +14 -15
- package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/factory.js +36 -17
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +47 -10
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.js +65 -48
- package/dest/msg_validators/tx_validator/index.d.ts +3 -1
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +2 -0
- package/dest/msg_validators/tx_validator/phases_validator.js +3 -3
- package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts +2 -1
- package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/tx_proof_validator.js +2 -0
- package/dest/msg_validators/tx_validator/tx_validation_cache.d.ts +48 -0
- package/dest/msg_validators/tx_validator/tx_validation_cache.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/tx_validation_cache.js +68 -0
- package/dest/services/data_store.d.ts +1 -1
- package/dest/services/data_store.d.ts.map +1 -1
- package/dest/services/data_store.js +5 -5
- package/dest/services/discv5/discV5_service.d.ts +13 -2
- package/dest/services/discv5/discV5_service.d.ts.map +1 -1
- package/dest/services/discv5/discV5_service.js +119 -23
- package/dest/services/discv5/persisted_enr_store.d.ts +38 -0
- package/dest/services/discv5/persisted_enr_store.d.ts.map +1 -0
- package/dest/services/discv5/persisted_enr_store.js +145 -0
- package/dest/services/dummy_service.d.ts +15 -15
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +15 -16
- package/dest/services/encoding.d.ts +8 -8
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +11 -15
- package/dest/services/gossipsub/topic_score_params.d.ts +6 -12
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
- package/dest/services/gossipsub/topic_score_params.js +4 -14
- package/dest/services/libp2p/instrumentation.d.ts +3 -1
- package/dest/services/libp2p/instrumentation.d.ts.map +1 -1
- package/dest/services/libp2p/instrumentation.js +14 -0
- package/dest/services/libp2p/libp2p_service.d.ts +44 -39
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +383 -278
- package/dest/services/peer-manager/peer_manager.d.ts +20 -3
- package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_manager.js +79 -23
- package/dest/services/peer-manager/peer_scoring.d.ts +34 -2
- package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_scoring.js +102 -13
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +1 -8
- 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 +38 -44
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts +8 -5
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts +5 -14
- package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/tx_validator.js +6 -20
- package/dest/services/reqresp/config.d.ts +3 -3
- package/dest/services/reqresp/config.d.ts.map +1 -1
- package/dest/services/reqresp/interface.d.ts +16 -18
- package/dest/services/reqresp/interface.d.ts.map +1 -1
- package/dest/services/reqresp/interface.js +10 -20
- package/dest/services/reqresp/metrics.d.ts +1 -1
- package/dest/services/reqresp/metrics.d.ts.map +1 -1
- package/dest/services/reqresp/metrics.js +0 -1
- package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts +4 -3
- package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block_txs/bitvector.js +3 -2
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +1 -1
- 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 +31 -28
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +12 -7
- 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 +42 -24
- package/dest/services/reqresp/protocols/index.d.ts +1 -2
- package/dest/services/reqresp/protocols/index.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/index.js +0 -1
- package/dest/services/reqresp/protocols/tx.d.ts +1 -1
- package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/tx.js +1 -3
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts +5 -4
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts.map +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limiter.js +10 -8
- package/dest/services/reqresp/rate-limiter/rate_limits.d.ts +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limits.d.ts.map +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limits.js +0 -10
- package/dest/services/reqresp/reqresp.d.ts +7 -29
- package/dest/services/reqresp/reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/reqresp.js +26 -207
- package/dest/services/service.d.ts +25 -12
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/config.d.ts +2 -23
- package/dest/services/tx_collection/config.d.ts.map +1 -1
- package/dest/services/tx_collection/config.js +2 -55
- package/dest/services/tx_collection/file_store_tx_collection.d.ts +12 -28
- package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_collection.js +43 -83
- package/dest/services/tx_collection/file_store_tx_source.d.ts +5 -4
- package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_source.js +39 -29
- package/dest/services/tx_collection/index.d.ts +2 -3
- package/dest/services/tx_collection/index.d.ts.map +1 -1
- package/dest/services/tx_collection/index.js +0 -1
- 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 +0 -2
- package/dest/services/tx_collection/tx_collection.d.ts +35 -51
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection.js +275 -119
- package/dest/services/tx_collection/tx_collection_sink.d.ts +1 -1
- package/dest/services/tx_collection/tx_collection_sink.js +2 -2
- package/dest/services/tx_collection/tx_source.d.ts +6 -5
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_source.js +13 -8
- package/dest/services/tx_file_store/tx_file_store.d.ts +1 -3
- package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -1
- package/dest/services/tx_file_store/tx_file_store.js +4 -14
- package/dest/services/tx_provider.d.ts +3 -1
- package/dest/services/tx_provider.d.ts.map +1 -1
- package/dest/services/tx_provider.js +3 -0
- package/dest/test-helpers/make-test-p2p-clients.d.ts +1 -1
- package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
- package/dest/test-helpers/make-test-p2p-clients.js +5 -2
- package/dest/test-helpers/mock-pubsub.d.ts +23 -9
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +44 -44
- package/dest/test-helpers/reqresp-nodes.d.ts +4 -5
- package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
- package/dest/test-helpers/reqresp-nodes.js +16 -18
- package/dest/test-helpers/test_tx_provider.d.ts +3 -1
- package/dest/test-helpers/test_tx_provider.d.ts.map +1 -1
- package/dest/test-helpers/test_tx_provider.js +3 -0
- package/dest/test-helpers/testbench-utils.d.ts +14 -14
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +25 -13
- package/dest/testbench/p2p_client_testbench_worker.d.ts +3 -5
- package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
- package/dest/testbench/p2p_client_testbench_worker.js +102 -41
- package/dest/testbench/worker_client_manager.d.ts +10 -6
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +51 -9
- package/dest/util.d.ts +11 -6
- package/dest/util.d.ts.map +1 -1
- package/dest/util.js +35 -14
- package/dest/versioning.d.ts +3 -6
- package/dest/versioning.d.ts.map +1 -1
- package/dest/versioning.js +3 -24
- package/package.json +16 -16
- package/src/bootstrap/bootstrap.ts +17 -3
- package/src/client/factory.ts +52 -24
- package/src/client/interface.ts +38 -17
- package/src/client/p2p_client.ts +118 -76
- package/src/client/test/{tx_proposal_collector/README.md → p2p_client.batch_tx_requester.bench.README.md} +23 -53
- package/src/config.ts +130 -31
- package/src/errors/p2p-service.error.ts +11 -0
- package/src/errors/reqresp.error.ts +0 -25
- package/src/index.ts +0 -1
- package/src/mem_pools/attestation_pool/attestation_pool.ts +319 -238
- package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +198 -62
- package/src/mem_pools/attestation_pool/mocks.ts +13 -8
- package/src/mem_pools/index.ts +0 -3
- package/src/mem_pools/instrumentation.ts +5 -1
- package/src/mem_pools/tx_pool_v2/archive/tx_archive.ts +1 -9
- package/src/mem_pools/tx_pool_v2/deleted_pool.ts +7 -7
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +1 -1
- package/src/mem_pools/tx_pool_v2/eviction/index.ts +1 -0
- package/src/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.ts +65 -0
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/interfaces.ts +18 -4
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +20 -8
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +12 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +8 -4
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +163 -117
- package/src/msg_validators/attestation_validator/attestation_validator.ts +46 -15
- package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +15 -7
- package/src/msg_validators/proposal_validator/README.md +1 -1
- package/src/msg_validators/proposal_validator/block_proposal_validator.ts +15 -3
- package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +26 -3
- package/src/msg_validators/proposal_validator/proposal_validator.ts +89 -11
- package/src/msg_validators/tx_validator/README.md +13 -3
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -12
- package/src/msg_validators/tx_validator/allowed_public_setup.ts +3 -3
- package/src/msg_validators/tx_validator/archive_cache.ts +1 -1
- package/src/msg_validators/tx_validator/cached_tx_validator.ts +31 -0
- package/src/msg_validators/tx_validator/contract_instance_validator.ts +56 -0
- package/src/msg_validators/tx_validator/data_validator.ts +44 -1
- package/src/msg_validators/tx_validator/factory.ts +44 -20
- package/src/msg_validators/tx_validator/gas_validator.ts +99 -54
- package/src/msg_validators/tx_validator/index.ts +2 -0
- package/src/msg_validators/tx_validator/phases_validator.ts +3 -3
- package/src/msg_validators/tx_validator/tx_proof_validator.ts +2 -0
- package/src/msg_validators/tx_validator/tx_validation_cache.ts +101 -0
- package/src/services/data_store.ts +5 -13
- package/src/services/discv5/discV5_service.ts +126 -14
- package/src/services/discv5/persisted_enr_store.ts +158 -0
- package/src/services/dummy_service.ts +20 -39
- package/src/services/encoding.ts +11 -21
- package/src/services/gossipsub/README.md +33 -11
- package/src/services/gossipsub/topic_score_params.ts +9 -18
- package/src/services/libp2p/instrumentation.ts +14 -0
- package/src/services/libp2p/libp2p_service.ts +436 -311
- package/src/services/peer-manager/peer_manager.ts +86 -22
- package/src/services/peer-manager/peer_scoring.ts +102 -8
- package/src/services/reqresp/README.md +0 -14
- package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +42 -52
- package/src/services/reqresp/batch-tx-requester/interface.ts +11 -4
- package/src/services/reqresp/batch-tx-requester/tx_validator.ts +12 -25
- package/src/services/reqresp/config.ts +2 -2
- package/src/services/reqresp/interface.ts +21 -47
- package/src/services/reqresp/metrics.ts +0 -1
- package/src/services/reqresp/protocols/block_txs/bitvector.ts +3 -2
- package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +34 -30
- package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +47 -20
- package/src/services/reqresp/protocols/index.ts +0 -1
- package/src/services/reqresp/protocols/tx.ts +1 -3
- package/src/services/reqresp/rate-limiter/rate_limiter.ts +13 -9
- package/src/services/reqresp/rate-limiter/rate_limits.ts +0 -10
- package/src/services/reqresp/reqresp.ts +29 -252
- package/src/services/service.ts +31 -28
- package/src/services/tx_collection/config.ts +3 -80
- package/src/services/tx_collection/file_store_tx_collection.ts +54 -103
- package/src/services/tx_collection/file_store_tx_source.ts +43 -31
- package/src/services/tx_collection/index.ts +1 -6
- package/src/services/tx_collection/instrumentation.ts +1 -7
- package/src/services/tx_collection/tx_collection.ts +330 -173
- package/src/services/tx_collection/tx_collection_sink.ts +2 -2
- package/src/services/tx_collection/tx_source.ts +10 -8
- package/src/services/tx_file_store/tx_file_store.ts +5 -17
- package/src/services/tx_provider.ts +5 -0
- package/src/test-helpers/make-test-p2p-clients.ts +3 -0
- package/src/test-helpers/mock-pubsub.ts +46 -60
- package/src/test-helpers/reqresp-nodes.ts +12 -22
- package/src/test-helpers/test_tx_provider.ts +5 -0
- package/src/test-helpers/testbench-utils.ts +31 -26
- package/src/testbench/p2p_client_testbench_worker.ts +110 -55
- package/src/testbench/worker_client_manager.ts +59 -20
- package/src/util.ts +32 -17
- package/src/versioning.ts +3 -33
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts +0 -2
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts.map +0 -1
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +0 -305
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts +0 -73
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts.map +0 -1
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.js +0 -8
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +0 -125
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.js +0 -596
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts +0 -32
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.js +0 -112
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts +0 -157
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.js +0 -52
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts +0 -16
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.js +0 -123
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.d.ts +0 -17
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.js +0 -84
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts +0 -19
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.js +0 -78
- package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.d.ts +0 -26
- package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.js +0 -84
- package/dest/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.d.ts +0 -25
- package/dest/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.js +0 -57
- package/dest/mem_pools/tx_pool/index.d.ts +0 -3
- package/dest/mem_pools/tx_pool/index.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/index.js +0 -2
- package/dest/mem_pools/tx_pool/priority.d.ts +0 -12
- package/dest/mem_pools/tx_pool/priority.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/priority.js +0 -15
- package/dest/mem_pools/tx_pool/tx_pool.d.ts +0 -127
- package/dest/mem_pools/tx_pool/tx_pool.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/tx_pool.js +0 -3
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts +0 -7
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.js +0 -402
- package/dest/msg_validators/clock_tolerance.d.ts +0 -21
- package/dest/msg_validators/clock_tolerance.d.ts.map +0 -1
- package/dest/msg_validators/clock_tolerance.js +0 -38
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts +0 -64
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts.map +0 -1
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.js +0 -151
- package/dest/services/reqresp/protocols/block.d.ts +0 -9
- package/dest/services/reqresp/protocols/block.d.ts.map +0 -1
- package/dest/services/reqresp/protocols/block.js +0 -32
- package/dest/services/tx_collection/fast_tx_collection.d.ts +0 -51
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +0 -1
- package/dest/services/tx_collection/fast_tx_collection.js +0 -311
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +0 -48
- package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +0 -1
- package/dest/services/tx_collection/proposal_tx_collector.js +0 -50
- package/dest/services/tx_collection/slow_tx_collection.d.ts +0 -57
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +0 -1
- package/dest/services/tx_collection/slow_tx_collection.js +0 -211
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +0 -344
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.ts +0 -43
- package/src/mem_pools/tx_pool/README.md +0 -270
- package/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +0 -746
- package/src/mem_pools/tx_pool/eviction/eviction_manager.ts +0 -132
- package/src/mem_pools/tx_pool/eviction/eviction_strategy.ts +0 -208
- package/src/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.ts +0 -163
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +0 -104
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.ts +0 -93
- package/src/mem_pools/tx_pool/eviction/low_priority_eviction_rule.ts +0 -106
- package/src/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.ts +0 -75
- package/src/mem_pools/tx_pool/index.ts +0 -2
- package/src/mem_pools/tx_pool/priority.ts +0 -20
- package/src/mem_pools/tx_pool/tx_pool.ts +0 -141
- package/src/mem_pools/tx_pool/tx_pool_test_suite.ts +0 -321
- package/src/msg_validators/clock_tolerance.ts +0 -52
- package/src/services/reqresp/connection-sampler/batch_connection_sampler.ts +0 -161
- package/src/services/reqresp/protocols/block.ts +0 -37
- package/src/services/tx_collection/fast_tx_collection.ts +0 -361
- package/src/services/tx_collection/proposal_tx_collector.ts +0 -108
- package/src/services/tx_collection/slow_tx_collection.ts +0 -266
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @attribution: lodestar impl for inspiration
|
|
2
|
-
import { compactArray } from '@aztec/foundation/collection';
|
|
3
2
|
import { AbortError, TimeoutError } from '@aztec/foundation/error';
|
|
4
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
4
|
import { executeTimeout } from '@aztec/foundation/timer';
|
|
@@ -11,11 +10,7 @@ import type { Libp2p } from 'libp2p';
|
|
|
11
10
|
import { pipeline } from 'node:stream/promises';
|
|
12
11
|
import type { Uint8ArrayList } from 'uint8arraylist';
|
|
13
12
|
|
|
14
|
-
import {
|
|
15
|
-
CollectiveReqRespTimeoutError,
|
|
16
|
-
IndividualReqRespTimeoutError,
|
|
17
|
-
InvalidResponseError,
|
|
18
|
-
} from '../../errors/reqresp.error.js';
|
|
13
|
+
import { IndividualReqRespTimeoutError } from '../../errors/reqresp.error.js';
|
|
19
14
|
import { OversizedSnappyResponseError, SnappyTransform } from '../encoding.js';
|
|
20
15
|
import type { PeerScoring } from '../peer-manager/peer_scoring.js';
|
|
21
16
|
import {
|
|
@@ -23,19 +18,16 @@ import {
|
|
|
23
18
|
DEFAULT_REQRESP_DIAL_TIMEOUT_MS,
|
|
24
19
|
type P2PReqRespConfig,
|
|
25
20
|
} from './config.js';
|
|
26
|
-
import { BatchConnectionSampler } from './connection-sampler/batch_connection_sampler.js';
|
|
27
21
|
import { ConnectionSampler, RandomSampler } from './connection-sampler/connection_sampler.js';
|
|
28
22
|
import {
|
|
29
|
-
DEFAULT_SUB_PROTOCOL_VALIDATORS,
|
|
30
23
|
type ReqRespInterface,
|
|
31
24
|
type ReqRespResponse,
|
|
32
25
|
ReqRespSubProtocol,
|
|
33
26
|
type ReqRespSubProtocolHandler,
|
|
34
27
|
type ReqRespSubProtocolHandlers,
|
|
35
28
|
type ReqRespSubProtocolRateLimits,
|
|
36
|
-
type
|
|
37
|
-
|
|
38
|
-
responseFromBuffer,
|
|
29
|
+
type ShouldRejectPeer,
|
|
30
|
+
UNAUTHENTICATED_ALLOWED_PROTOCOLS,
|
|
39
31
|
subProtocolSizeCalculators,
|
|
40
32
|
} from './interface.js';
|
|
41
33
|
import { ReqRespMetrics } from './metrics.js';
|
|
@@ -44,13 +36,13 @@ import {
|
|
|
44
36
|
RequestResponseRateLimiter,
|
|
45
37
|
prettyPrintRateLimitStatus,
|
|
46
38
|
} from './rate-limiter/rate_limiter.js';
|
|
47
|
-
import { ReqRespStatus, ReqRespStatusError, parseStatusChunk
|
|
39
|
+
import { ReqRespStatus, ReqRespStatusError, parseStatusChunk } from './status.js';
|
|
48
40
|
|
|
49
41
|
/**
|
|
50
42
|
* The Request Response Service
|
|
51
43
|
*
|
|
52
44
|
* It allows nodes to request specific information from their peers, its use case covers recovering
|
|
53
|
-
* information that was missed during a
|
|
45
|
+
* information that was missed during a synchronisation or a gossip event.
|
|
54
46
|
*
|
|
55
47
|
* This service implements the request response sub protocol, it is heavily inspired from
|
|
56
48
|
* ethereum implementations of the same name.
|
|
@@ -65,13 +57,14 @@ export class ReqResp implements ReqRespInterface {
|
|
|
65
57
|
private dialTimeoutMs: number = DEFAULT_REQRESP_DIAL_TIMEOUT_MS;
|
|
66
58
|
|
|
67
59
|
private subProtocolHandlers: Partial<ReqRespSubProtocolHandlers> = {};
|
|
68
|
-
private subProtocolValidators: Partial<ReqRespSubProtocolValidators> = {};
|
|
69
60
|
|
|
70
61
|
private connectionSampler: ConnectionSampler;
|
|
71
62
|
private rateLimiter: RequestResponseRateLimiter;
|
|
72
63
|
|
|
73
64
|
private snappyTransform: SnappyTransform;
|
|
74
65
|
|
|
66
|
+
private shouldRejectPeer: ShouldRejectPeer | undefined;
|
|
67
|
+
|
|
75
68
|
private metrics: ReqRespMetrics;
|
|
76
69
|
|
|
77
70
|
constructor(
|
|
@@ -108,6 +101,10 @@ export class ReqResp implements ReqRespInterface {
|
|
|
108
101
|
}
|
|
109
102
|
}
|
|
110
103
|
|
|
104
|
+
public setShouldRejectPeer(checker: ShouldRejectPeer): void {
|
|
105
|
+
this.shouldRejectPeer = checker;
|
|
106
|
+
}
|
|
107
|
+
|
|
111
108
|
get tracer() {
|
|
112
109
|
return this.metrics.tracer;
|
|
113
110
|
}
|
|
@@ -122,11 +119,11 @@ export class ReqResp implements ReqRespInterface {
|
|
|
122
119
|
/**
|
|
123
120
|
* Start the reqresp service
|
|
124
121
|
*/
|
|
125
|
-
async start(subProtocolHandlers: ReqRespSubProtocolHandlers
|
|
122
|
+
async start(subProtocolHandlers: ReqRespSubProtocolHandlers) {
|
|
126
123
|
Object.assign(this.subProtocolHandlers, subProtocolHandlers);
|
|
127
|
-
Object.assign(this.subProtocolValidators, subProtocolValidators);
|
|
128
124
|
|
|
129
|
-
// Register
|
|
125
|
+
// Register streamHandler with libp2p.
|
|
126
|
+
// The streamHandler is responsible for reading the incoming stream, determining the protocol, then triggering the appropriate handler.
|
|
130
127
|
for (const subProtocol of Object.keys(subProtocolHandlers)) {
|
|
131
128
|
this.logger.debug(`Registering handler for sub protocol ${subProtocol}`);
|
|
132
129
|
await this.libp2p.handle(
|
|
@@ -140,13 +137,8 @@ export class ReqResp implements ReqRespInterface {
|
|
|
140
137
|
this.rateLimiter.start();
|
|
141
138
|
}
|
|
142
139
|
|
|
143
|
-
async addSubProtocol(
|
|
144
|
-
subProtocol: ReqRespSubProtocol,
|
|
145
|
-
handler: ReqRespSubProtocolHandler,
|
|
146
|
-
validator: ReqRespSubProtocolValidators[ReqRespSubProtocol] = DEFAULT_SUB_PROTOCOL_VALIDATORS[subProtocol],
|
|
147
|
-
): Promise<void> {
|
|
140
|
+
async addSubProtocol(subProtocol: ReqRespSubProtocol, handler: ReqRespSubProtocolHandler): Promise<void> {
|
|
148
141
|
this.subProtocolHandlers[subProtocol] = handler;
|
|
149
|
-
this.subProtocolValidators[subProtocol] = validator;
|
|
150
142
|
this.logger.debug(`Registering handler for sub protocol ${subProtocol}`);
|
|
151
143
|
await this.libp2p.handle(
|
|
152
144
|
subProtocol,
|
|
@@ -180,225 +172,6 @@ export class ReqResp implements ReqRespInterface {
|
|
|
180
172
|
// NOTE: We assume libp2p instance is managed by the caller
|
|
181
173
|
}
|
|
182
174
|
|
|
183
|
-
/**
|
|
184
|
-
* Request multiple messages over the same sub protocol, balancing the requests across peers.
|
|
185
|
-
*
|
|
186
|
-
* @devnote
|
|
187
|
-
* - The function prioritizes sending requests to free peers using a batch sampling strategy.
|
|
188
|
-
* - If a peer fails to respond or returns an invalid response, it is removed from the sampling pool and replaced.
|
|
189
|
-
* - The function stops retrying once all requests are processed, no active peers remain, or the maximum retry attempts are reached.
|
|
190
|
-
* - Responses are validated using a custom validator for the sub-protocol.*
|
|
191
|
-
*
|
|
192
|
-
* Requests are sent in parallel to each peer, but multiple requests are sent to the same peer in series
|
|
193
|
-
* - If a peer fails to respond or returns an invalid response, it is removed from the sampling pool and replaced.
|
|
194
|
-
* - The function stops retrying once all requests are processed, no active peers remain, or the maximum retry attempts are reached.
|
|
195
|
-
* - Responses are validated using a custom validator for the sub-protocol.*
|
|
196
|
-
*
|
|
197
|
-
* @param subProtocol
|
|
198
|
-
* @param requests
|
|
199
|
-
* @param timeoutMs
|
|
200
|
-
* @param maxPeers
|
|
201
|
-
* @returns
|
|
202
|
-
*
|
|
203
|
-
* @throws {CollectiveReqRespTimeoutError} - If the request batch exceeds the specified timeout (`timeoutMs`).
|
|
204
|
-
*/
|
|
205
|
-
@trackSpan(
|
|
206
|
-
'ReqResp.sendBatchRequest',
|
|
207
|
-
(subProtocol: ReqRespSubProtocol, requests: InstanceType<SubProtocolMap[ReqRespSubProtocol]['request']>[]) => ({
|
|
208
|
-
[Attributes.P2P_REQ_RESP_PROTOCOL]: subProtocol,
|
|
209
|
-
[Attributes.P2P_REQ_RESP_BATCH_REQUESTS_COUNT]: requests.length,
|
|
210
|
-
}),
|
|
211
|
-
)
|
|
212
|
-
async sendBatchRequest<SubProtocol extends ReqRespSubProtocol>(
|
|
213
|
-
subProtocol: SubProtocol,
|
|
214
|
-
requests: InstanceType<SubProtocolMap[SubProtocol]['request']>[],
|
|
215
|
-
pinnedPeer: PeerId | undefined,
|
|
216
|
-
timeoutMs = 10000,
|
|
217
|
-
maxPeers = Math.max(10, Math.ceil(requests.length / 3)),
|
|
218
|
-
maxRetryAttempts = 3,
|
|
219
|
-
): Promise<InstanceType<SubProtocolMap[SubProtocol]['response']>[]> {
|
|
220
|
-
const responseValidator = this.subProtocolValidators[subProtocol] ?? DEFAULT_SUB_PROTOCOL_VALIDATORS[subProtocol];
|
|
221
|
-
const responses: InstanceType<SubProtocolMap[SubProtocol]['response']>[] = new Array(requests.length);
|
|
222
|
-
const requestBuffers = requests.map(req => req.toBuffer());
|
|
223
|
-
const isEmptyResponse = (value: unknown): boolean => {
|
|
224
|
-
// Some responses serialize to a non-empty buffer even when they contain no items (e.g., empty TxArray).
|
|
225
|
-
if (!value || typeof value !== 'object') {
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
const length = (value as { length?: number }).length;
|
|
229
|
-
return typeof length === 'number' && length === 0;
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const requestFunction = async (signal: AbortSignal) => {
|
|
233
|
-
// Track which requests still need to be processed
|
|
234
|
-
const pendingRequestIndices = new Set(requestBuffers.map((_, i) => i));
|
|
235
|
-
|
|
236
|
-
// Create batch sampler with the total number of requests and max peers
|
|
237
|
-
const batchSampler = new BatchConnectionSampler(
|
|
238
|
-
this.connectionSampler,
|
|
239
|
-
requests.length,
|
|
240
|
-
maxPeers,
|
|
241
|
-
compactArray([pinnedPeer]), // Exclude pinned peer from sampling, we will forcefully send all requests to it
|
|
242
|
-
createLogger(`${this.logger.module}:batch-connection-sampler`),
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
if (batchSampler.activePeerCount === 0 && !pinnedPeer) {
|
|
246
|
-
this.logger.warn('No active peers to send requests to');
|
|
247
|
-
return [];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// This is where it gets fun
|
|
251
|
-
// The outer loop is the retry loop, we will continue to retry until we process all indices we have
|
|
252
|
-
// not received a response for, or we have reached the max retry attempts
|
|
253
|
-
|
|
254
|
-
// The inner loop is the batch loop, we will process all requests for each peer in parallel
|
|
255
|
-
// We will then process the results of the requests, and resample any peers that failed to respond
|
|
256
|
-
// We will continue to retry until we have processed all indices, or we have reached the max retry attempts
|
|
257
|
-
|
|
258
|
-
let retryAttempts = 0;
|
|
259
|
-
while (pendingRequestIndices.size > 0 && batchSampler.activePeerCount > 0 && retryAttempts < maxRetryAttempts) {
|
|
260
|
-
if (signal.aborted) {
|
|
261
|
-
throw new AbortError('Batch request aborted');
|
|
262
|
-
}
|
|
263
|
-
// Process requests in parallel for each available peer
|
|
264
|
-
type BatchEntry = { peerId: PeerId; indices: number[] };
|
|
265
|
-
const requestBatches = new Map<string, BatchEntry>();
|
|
266
|
-
|
|
267
|
-
// Group requests by peer
|
|
268
|
-
for (const requestIndex of pendingRequestIndices) {
|
|
269
|
-
const peer = batchSampler.getPeerForRequest(requestIndex);
|
|
270
|
-
if (!peer) {
|
|
271
|
-
// No peer available for this specific index (all peers exhausted for it)
|
|
272
|
-
// Skip this index for now - it stays in pendingRequestIndices for retry
|
|
273
|
-
continue;
|
|
274
|
-
}
|
|
275
|
-
const peerAsString = peer.toString();
|
|
276
|
-
if (!requestBatches.has(peerAsString)) {
|
|
277
|
-
requestBatches.set(peerAsString, { peerId: peer, indices: [] });
|
|
278
|
-
}
|
|
279
|
-
requestBatches.get(peerAsString)!.indices.push(requestIndex);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// If there is a pinned peer, we will always send every request to that peer
|
|
283
|
-
// We use the default limits for the subprotocol to avoid hitting the rate limiter
|
|
284
|
-
if (pinnedPeer) {
|
|
285
|
-
const limit = this.rateLimiter.getRateLimits(subProtocol).peerLimit.quotaCount;
|
|
286
|
-
requestBatches.set(pinnedPeer.toString(), {
|
|
287
|
-
peerId: pinnedPeer,
|
|
288
|
-
indices: Array.from(pendingRequestIndices.values()).slice(0, limit),
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// If no requests could be assigned (all peers exhausted for all indices), exit early
|
|
293
|
-
if (requestBatches.size === 0) {
|
|
294
|
-
this.logger.warn('No peers available for any pending request indices, stopping batch request');
|
|
295
|
-
break;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Make parallel requests for each peer's batch
|
|
299
|
-
// A batch entry will look something like this:
|
|
300
|
-
// PeerId0: [0, 1, 2, 3]
|
|
301
|
-
// PeerId1: [4, 5, 6, 7]
|
|
302
|
-
|
|
303
|
-
// Peer Id 0 will send requests 0, 1, 2, 3 in serial
|
|
304
|
-
// while simultaneously Peer Id 1 will send requests 4, 5, 6, 7 in serial
|
|
305
|
-
|
|
306
|
-
const batchResults = await Promise.all(
|
|
307
|
-
Array.from(requestBatches.entries()).map(async ([peerAsString, { peerId: peer, indices }]) => {
|
|
308
|
-
try {
|
|
309
|
-
const markIndexFailed = (index: number) => batchSampler.markPeerFailedForIndex(peer, index);
|
|
310
|
-
// Requests all going to the same peer are sent synchronously
|
|
311
|
-
const peerResults: { index: number; response: InstanceType<SubProtocolMap[SubProtocol]['response']> }[] =
|
|
312
|
-
[];
|
|
313
|
-
let shouldReplacePeer = false;
|
|
314
|
-
const handleFailure = (status: ReqRespStatus, index: number) => {
|
|
315
|
-
this.logger.warn(
|
|
316
|
-
`Request to peer ${peerAsString} failed with status ${prettyPrintReqRespStatus(status)}`,
|
|
317
|
-
);
|
|
318
|
-
markIndexFailed(index);
|
|
319
|
-
return status === ReqRespStatus.RATE_LIMIT_EXCEEDED;
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
for (const index of indices) {
|
|
323
|
-
this.logger.trace(`Sending request ${index} to peer ${peerAsString}`);
|
|
324
|
-
const response = await this.sendRequestToPeer(peer, subProtocol, requestBuffers[index]);
|
|
325
|
-
|
|
326
|
-
// Check the status of the response buffer
|
|
327
|
-
if (response.status !== ReqRespStatus.SUCCESS) {
|
|
328
|
-
shouldReplacePeer = handleFailure(response.status, index);
|
|
329
|
-
if (shouldReplacePeer) {
|
|
330
|
-
break;
|
|
331
|
-
}
|
|
332
|
-
continue;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
if (response.data.length === 0) {
|
|
336
|
-
markIndexFailed(index);
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const object = responseFromBuffer(subProtocol, response.data);
|
|
341
|
-
if (isEmptyResponse(object)) {
|
|
342
|
-
markIndexFailed(index);
|
|
343
|
-
continue;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
const isValid = await responseValidator(requests[index], object, peer);
|
|
347
|
-
if (!isValid) {
|
|
348
|
-
markIndexFailed(index);
|
|
349
|
-
continue;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
peerResults.push({ index, response: object });
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// If peer had a hard failure (rate limit), replace it for future iterations
|
|
356
|
-
if (shouldReplacePeer) {
|
|
357
|
-
this.logger.warn(`Peer ${peerAsString} hit a hard failure, removing from sampler`);
|
|
358
|
-
batchSampler.removePeerAndReplace(peer);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
return { peer, results: peerResults };
|
|
362
|
-
} catch (error) {
|
|
363
|
-
this.logger.warn(`Failed batch request to peer ${peerAsString}:`, error);
|
|
364
|
-
batchSampler.removePeerAndReplace(peer);
|
|
365
|
-
return { peer, results: [] };
|
|
366
|
-
}
|
|
367
|
-
}),
|
|
368
|
-
);
|
|
369
|
-
|
|
370
|
-
// Process results
|
|
371
|
-
for (const { results } of batchResults) {
|
|
372
|
-
for (const { index, response } of results) {
|
|
373
|
-
if (response) {
|
|
374
|
-
responses[index] = response;
|
|
375
|
-
pendingRequestIndices.delete(index);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
retryAttempts++;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
if (retryAttempts >= maxRetryAttempts) {
|
|
384
|
-
this.logger.warn(`Max retry attempts ${maxRetryAttempts} reached for batch request`);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return responses;
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
try {
|
|
391
|
-
return await executeTimeout<InstanceType<SubProtocolMap[SubProtocol]['response']>[]>(
|
|
392
|
-
requestFunction,
|
|
393
|
-
timeoutMs,
|
|
394
|
-
() => new CollectiveReqRespTimeoutError(),
|
|
395
|
-
);
|
|
396
|
-
} catch (e: any) {
|
|
397
|
-
this.logger.warn(`${e.message} | subProtocol: ${subProtocol}`);
|
|
398
|
-
return [];
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
175
|
/**
|
|
403
176
|
* Sends a request to a specific peer
|
|
404
177
|
*
|
|
@@ -462,7 +235,7 @@ export class ReqResp implements ReqRespInterface {
|
|
|
462
235
|
);
|
|
463
236
|
return resp;
|
|
464
237
|
} catch (e: any) {
|
|
465
|
-
this.logger.
|
|
238
|
+
this.logger.debug(`SUBPROTOCOL: ${subProtocol}\n`, e);
|
|
466
239
|
// On error we immediately abort the stream, this is preferred way,
|
|
467
240
|
// because it signals to the sender that error happened, whereas
|
|
468
241
|
// closing the stream only closes our side and is much slower
|
|
@@ -596,6 +369,15 @@ export class ReqResp implements ReqRespInterface {
|
|
|
596
369
|
throw new ReqRespStatusError(ReqRespStatus.RATE_LIMIT_EXCEEDED);
|
|
597
370
|
}
|
|
598
371
|
|
|
372
|
+
// When p2pAllowOnlyValidators is enabled, reject unauthenticated peers on data protocols
|
|
373
|
+
if (
|
|
374
|
+
!UNAUTHENTICATED_ALLOWED_PROTOCOLS.has(protocol) &&
|
|
375
|
+
(this.shouldRejectPeer?.(connection.remotePeer.toString()) ?? false)
|
|
376
|
+
) {
|
|
377
|
+
this.logger.debug(`Rejecting unauthenticated peer ${connection.remotePeer} on gated protocol ${protocol}`);
|
|
378
|
+
throw new ReqRespStatusError(ReqRespStatus.FAILURE);
|
|
379
|
+
}
|
|
380
|
+
|
|
599
381
|
await this.processStream(protocol, incomingStream);
|
|
600
382
|
} catch (err: any) {
|
|
601
383
|
this.metrics.recordResponseError(protocol);
|
|
@@ -740,13 +522,13 @@ export class ReqResp implements ReqRespInterface {
|
|
|
740
522
|
): PeerErrorSeverity | undefined {
|
|
741
523
|
const logTags = { peerId: peerId.toString(), subProtocol };
|
|
742
524
|
|
|
743
|
-
//Punishable error - peer should never send badly formed request
|
|
525
|
+
// Punishable error - peer should never send badly formed request
|
|
744
526
|
if (e instanceof ReqRespStatusError && e.status === ReqRespStatus.BADLY_FORMED_REQUEST) {
|
|
745
527
|
this.logger.debug(`Punishable error in ${subProtocol}: ${e.cause}`, logTags);
|
|
746
528
|
return PeerErrorSeverity.LowToleranceError;
|
|
747
529
|
}
|
|
748
530
|
|
|
749
|
-
//TODO: (mralj): think if we should penalize peer here based on connection errors
|
|
531
|
+
// TODO: (mralj): think if we should penalize peer here based on connection errors
|
|
750
532
|
return undefined;
|
|
751
533
|
}
|
|
752
534
|
|
|
@@ -768,12 +550,6 @@ export class ReqResp implements ReqRespInterface {
|
|
|
768
550
|
return undefined;
|
|
769
551
|
}
|
|
770
552
|
|
|
771
|
-
// We do not punish a collective timeout, as the node triggers this interupt, independent of the peer's behaviour
|
|
772
|
-
if (e instanceof CollectiveReqRespTimeoutError || e instanceof InvalidResponseError) {
|
|
773
|
-
this.logger.debug(`Non-punishable error in ${subProtocol}: ${e.message}`, logTags);
|
|
774
|
-
return undefined;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
553
|
// Invalid status byte: the peer sent a status byte that doesn't match any known status code.
|
|
778
554
|
// This is a protocol violation, penalize harshly.
|
|
779
555
|
if (e instanceof ReqRespStatusError) {
|
|
@@ -793,7 +569,8 @@ export class ReqResp implements ReqRespInterface {
|
|
|
793
569
|
|
|
794
570
|
/*
|
|
795
571
|
* Errors specific to connection handling
|
|
796
|
-
* These can happen both when sending request and response
|
|
572
|
+
* These can happen both when sending request and response.
|
|
573
|
+
*/
|
|
797
574
|
private categorizeConnectionErrors(
|
|
798
575
|
e: any,
|
|
799
576
|
peerId: PeerId,
|
package/src/services/service.ts
CHANGED
|
@@ -17,12 +17,7 @@ import type EventEmitter from 'events';
|
|
|
17
17
|
import type { BatchTxRequesterLibP2PService } from './reqresp/batch-tx-requester/interface.js';
|
|
18
18
|
import type { P2PReqRespConfig } from './reqresp/config.js';
|
|
19
19
|
import type { StatusMessage } from './reqresp/index.js';
|
|
20
|
-
import type {
|
|
21
|
-
ReqRespSubProtocol,
|
|
22
|
-
ReqRespSubProtocolHandler,
|
|
23
|
-
ReqRespSubProtocolValidators,
|
|
24
|
-
SubProtocolMap,
|
|
25
|
-
} from './reqresp/interface.js';
|
|
20
|
+
import type { ReqRespSubProtocol, ReqRespSubProtocolHandler } from './reqresp/interface.js';
|
|
26
21
|
import type { AuthRequest, AuthResponse } from './reqresp/protocols/auth.js';
|
|
27
22
|
|
|
28
23
|
export enum PeerDiscoveryState {
|
|
@@ -63,6 +58,19 @@ export type DuplicateProposalInfo = {
|
|
|
63
58
|
*/
|
|
64
59
|
export type P2PDuplicateProposalCallback = (info: DuplicateProposalInfo) => void;
|
|
65
60
|
|
|
61
|
+
/** Minimal info passed to the oversized proposal callback. */
|
|
62
|
+
export type OversizedProposalInfo = {
|
|
63
|
+
slot: SlotNumber;
|
|
64
|
+
proposer: EthAddress;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Callback for when a block proposal whose index lands at or beyond the consensus per-checkpoint block
|
|
69
|
+
* limit is stored and re-broadcast as slashing evidence. May fire multiple times per (slot, proposer)
|
|
70
|
+
* if the proposer signed several oversized proposals; consumers are expected to dedup.
|
|
71
|
+
*/
|
|
72
|
+
export type P2POversizedProposalCallback = (info: OversizedProposalInfo) => void;
|
|
73
|
+
|
|
66
74
|
/** Minimal info passed to the duplicate attestation callback. */
|
|
67
75
|
export type DuplicateAttestationInfo = {
|
|
68
76
|
slot: SlotNumber;
|
|
@@ -76,6 +84,8 @@ export type DuplicateAttestationInfo = {
|
|
|
76
84
|
*/
|
|
77
85
|
export type P2PDuplicateAttestationCallback = (info: DuplicateAttestationInfo) => void;
|
|
78
86
|
|
|
87
|
+
export type P2PCheckpointAttestationCallback = (attestation: CheckpointAttestation) => void;
|
|
88
|
+
|
|
79
89
|
/**
|
|
80
90
|
* The interface for a P2P service implementation.
|
|
81
91
|
*/
|
|
@@ -98,26 +108,12 @@ export interface P2PService {
|
|
|
98
108
|
*/
|
|
99
109
|
propagate<T extends Gossipable>(message: T): Promise<void>;
|
|
100
110
|
|
|
101
|
-
/**
|
|
102
|
-
* Send a batch of requests to peers, and return the responses
|
|
103
|
-
*
|
|
104
|
-
* @param protocol - The request response protocol to use
|
|
105
|
-
* @param requests - The requests to send to the peers
|
|
106
|
-
* @returns The responses to the requests
|
|
107
|
-
*/
|
|
108
|
-
sendBatchRequest<Protocol extends ReqRespSubProtocol>(
|
|
109
|
-
protocol: Protocol,
|
|
110
|
-
requests: InstanceType<SubProtocolMap[Protocol]['request']>[],
|
|
111
|
-
pinnedPeerId?: PeerId,
|
|
112
|
-
timeoutMs?: number,
|
|
113
|
-
maxPeers?: number,
|
|
114
|
-
maxRetryAttempts?: number,
|
|
115
|
-
): Promise<InstanceType<SubProtocolMap[Protocol]['response']>[]>;
|
|
116
|
-
|
|
117
111
|
// Leaky abstraction: fix https://github.com/AztecProtocol/aztec-packages/issues/7963
|
|
118
112
|
registerBlockReceivedCallback(callback: P2PBlockReceivedCallback): void;
|
|
119
113
|
|
|
120
|
-
|
|
114
|
+
registerValidatorCheckpointReceivedCallback(callback: P2PCheckpointReceivedCallback): void;
|
|
115
|
+
|
|
116
|
+
registerAllNodesCheckpointReceivedCallback(callback: P2PCheckpointReceivedCallback): void;
|
|
121
117
|
|
|
122
118
|
/**
|
|
123
119
|
* Registers a callback invoked when a duplicate proposal is detected (equivocation).
|
|
@@ -125,6 +121,12 @@ export interface P2PService {
|
|
|
125
121
|
*/
|
|
126
122
|
registerDuplicateProposalCallback(callback: P2PDuplicateProposalCallback): void;
|
|
127
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Registers a callback invoked when an oversized block proposal (index at or beyond the consensus
|
|
126
|
+
* per-checkpoint block limit) is stored and re-broadcast as slashing evidence.
|
|
127
|
+
*/
|
|
128
|
+
registerOversizedProposalCallback(callback: P2POversizedProposalCallback): void;
|
|
129
|
+
|
|
128
130
|
/**
|
|
129
131
|
* Registers a callback invoked when a duplicate attestation is detected (equivocation).
|
|
130
132
|
* A validator signing attestations for different proposals at the same slot.
|
|
@@ -132,6 +134,8 @@ export interface P2PService {
|
|
|
132
134
|
*/
|
|
133
135
|
registerDuplicateAttestationCallback(callback: P2PDuplicateAttestationCallback): void;
|
|
134
136
|
|
|
137
|
+
registerCheckpointAttestationCallback(callback: P2PCheckpointAttestationCallback): void;
|
|
138
|
+
|
|
135
139
|
getEnr(): ENR | undefined;
|
|
136
140
|
|
|
137
141
|
getPeers(includePending?: boolean): PeerInfo[];
|
|
@@ -141,11 +145,7 @@ export interface P2PService {
|
|
|
141
145
|
|
|
142
146
|
validateTxsReceivedInBlockProposal(txs: Tx[]): Promise<void>;
|
|
143
147
|
|
|
144
|
-
addReqRespSubProtocol(
|
|
145
|
-
subProtocol: ReqRespSubProtocol,
|
|
146
|
-
handler: ReqRespSubProtocolHandler,
|
|
147
|
-
validator?: ReqRespSubProtocolValidators[ReqRespSubProtocol],
|
|
148
|
-
): Promise<void>;
|
|
148
|
+
addReqRespSubProtocol(subProtocol: ReqRespSubProtocol, handler: ReqRespSubProtocolHandler): Promise<void>;
|
|
149
149
|
|
|
150
150
|
handleAuthRequestFromPeer(authRequest: AuthRequest, peerId: PeerId): Promise<StatusMessage>;
|
|
151
151
|
|
|
@@ -196,6 +196,9 @@ export interface PeerDiscoveryService extends EventEmitter {
|
|
|
196
196
|
on(event: 'peer:discovered', listener: (enr: ENR) => void): this;
|
|
197
197
|
emit(event: 'peer:discovered', enr: ENR): boolean;
|
|
198
198
|
|
|
199
|
+
on(event: 'ip:changed', listener: (ip: string) => void): this;
|
|
200
|
+
emit(event: 'ip:changed', ip: string): boolean;
|
|
201
|
+
|
|
199
202
|
getStatus(): PeerDiscoveryState;
|
|
200
203
|
|
|
201
204
|
getEnr(): ENR | undefined;
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ConfigMappingsType,
|
|
3
|
-
booleanConfigHelper,
|
|
4
|
-
enumConfigHelper,
|
|
5
|
-
numberConfigHelper,
|
|
6
|
-
} from '@aztec/foundation/config';
|
|
1
|
+
import { type ConfigMappingsType, numberConfigHelper } from '@aztec/foundation/config';
|
|
7
2
|
import { MAX_RPC_TXS_LEN } from '@aztec/stdlib/interfaces/api-limit';
|
|
8
3
|
|
|
9
|
-
export type MissingTxsCollectorType = 'new' | 'old';
|
|
10
|
-
|
|
11
4
|
export type TxCollectionConfig = {
|
|
12
5
|
/** How long to wait before starting reqresp for fast collection */
|
|
13
6
|
txCollectionFastNodesTimeoutBeforeReqRespMs: number;
|
|
14
|
-
/** How often to collect from configured nodes */
|
|
15
|
-
txCollectionSlowNodesIntervalMs: number;
|
|
16
|
-
/** How ofter to collect from peers */
|
|
17
|
-
txCollectionSlowReqRespIntervalMs: number;
|
|
18
|
-
/** How long to wait for a reqresp response during slow collection */
|
|
19
|
-
txCollectionSlowReqRespTimeoutMs: number;
|
|
20
|
-
/** How often to reconcile found txs with the tx pool */
|
|
21
|
-
txCollectionReconcileIntervalMs: number;
|
|
22
|
-
/** Whether to disable the slow collection loop if we are dealing with any immediate requests */
|
|
23
|
-
txCollectionDisableSlowDuringFastRequests: boolean;
|
|
24
7
|
/** How many ms to wait between retried request to a node via RPC during fast collection */
|
|
25
8
|
txCollectionFastNodeIntervalMs: number;
|
|
26
9
|
/** A comma-separated list of Aztec node RPC URLs to use for tx collection */
|
|
@@ -29,26 +12,16 @@ export type TxCollectionConfig = {
|
|
|
29
12
|
txCollectionFastMaxParallelRequestsPerNode: number;
|
|
30
13
|
/** Maximum number of transactions to request from a node in a single batch */
|
|
31
14
|
txCollectionNodeRpcMaxBatchSize: number;
|
|
32
|
-
/** Which collector implementation to use for missing txs collection */
|
|
33
|
-
txCollectionMissingTxsCollectorType: MissingTxsCollectorType;
|
|
34
15
|
/** A comma-separated list of file store URLs (s3://, gs://, file://, http://) for tx collection */
|
|
35
16
|
txCollectionFileStoreUrls: string[];
|
|
36
|
-
/** Delay in ms before file store collection
|
|
37
|
-
txCollectionFileStoreSlowDelayMs: number;
|
|
38
|
-
/** Delay in ms before file store collection starts after fast collection is triggered */
|
|
17
|
+
/** Delay in ms from reqresp start before file store collection begins */
|
|
39
18
|
txCollectionFileStoreFastDelayMs: number;
|
|
40
19
|
/** Number of concurrent workers for fast file store collection */
|
|
41
20
|
txCollectionFileStoreFastWorkerCount: number;
|
|
42
|
-
/** Number of concurrent workers for slow file store collection */
|
|
43
|
-
txCollectionFileStoreSlowWorkerCount: number;
|
|
44
21
|
/** Base backoff time in ms for fast file store collection retries */
|
|
45
22
|
txCollectionFileStoreFastBackoffBaseMs: number;
|
|
46
|
-
/** Base backoff time in ms for slow file store collection retries */
|
|
47
|
-
txCollectionFileStoreSlowBackoffBaseMs: number;
|
|
48
23
|
/** Max backoff time in ms for fast file store collection retries */
|
|
49
24
|
txCollectionFileStoreFastBackoffMaxMs: number;
|
|
50
|
-
/** Max backoff time in ms for slow file store collection retries */
|
|
51
|
-
txCollectionFileStoreSlowBackoffMaxMs: number;
|
|
52
25
|
};
|
|
53
26
|
|
|
54
27
|
export const txCollectionConfigMappings: ConfigMappingsType<TxCollectionConfig> = {
|
|
@@ -57,31 +30,6 @@ export const txCollectionConfigMappings: ConfigMappingsType<TxCollectionConfig>
|
|
|
57
30
|
description: 'How long to wait before starting reqresp for fast collection',
|
|
58
31
|
...numberConfigHelper(200),
|
|
59
32
|
},
|
|
60
|
-
txCollectionSlowNodesIntervalMs: {
|
|
61
|
-
env: 'TX_COLLECTION_SLOW_NODES_INTERVAL_MS',
|
|
62
|
-
description: 'How often to collect from configured nodes in the slow collection loop',
|
|
63
|
-
...numberConfigHelper(12_000),
|
|
64
|
-
},
|
|
65
|
-
txCollectionSlowReqRespIntervalMs: {
|
|
66
|
-
env: 'TX_COLLECTION_SLOW_REQ_RESP_INTERVAL_MS',
|
|
67
|
-
description: 'How often to collect from peers via reqresp in the slow collection loop',
|
|
68
|
-
...numberConfigHelper(12_000),
|
|
69
|
-
},
|
|
70
|
-
txCollectionSlowReqRespTimeoutMs: {
|
|
71
|
-
env: 'TX_COLLECTION_SLOW_REQ_RESP_TIMEOUT_MS',
|
|
72
|
-
description: 'How long to wait for a reqresp response during slow collection',
|
|
73
|
-
...numberConfigHelper(20_000),
|
|
74
|
-
},
|
|
75
|
-
txCollectionReconcileIntervalMs: {
|
|
76
|
-
env: 'TX_COLLECTION_RECONCILE_INTERVAL_MS',
|
|
77
|
-
description: 'How often to reconcile found txs from the tx pool',
|
|
78
|
-
...numberConfigHelper(60_000),
|
|
79
|
-
},
|
|
80
|
-
txCollectionDisableSlowDuringFastRequests: {
|
|
81
|
-
env: 'TX_COLLECTION_DISABLE_SLOW_DURING_FAST_REQUESTS',
|
|
82
|
-
description: 'Whether to disable the slow collection loop if we are dealing with any immediate requests',
|
|
83
|
-
...booleanConfigHelper(true),
|
|
84
|
-
},
|
|
85
33
|
txCollectionFastNodeIntervalMs: {
|
|
86
34
|
env: 'TX_COLLECTION_FAST_NODE_INTERVAL_MS',
|
|
87
35
|
description: 'How many ms to wait between retried request to a node via RPC during fast collection',
|
|
@@ -108,11 +56,6 @@ export const txCollectionConfigMappings: ConfigMappingsType<TxCollectionConfig>
|
|
|
108
56
|
description: 'Maximum number of transactions to request from a node in a single batch',
|
|
109
57
|
...numberConfigHelper(MAX_RPC_TXS_LEN),
|
|
110
58
|
},
|
|
111
|
-
txCollectionMissingTxsCollectorType: {
|
|
112
|
-
env: 'TX_COLLECTION_MISSING_TXS_COLLECTOR_TYPE',
|
|
113
|
-
description: 'Which collector implementation to use for missing txs collection (new or old)',
|
|
114
|
-
...enumConfigHelper(['new', 'old'] as const, 'new'),
|
|
115
|
-
},
|
|
116
59
|
txCollectionFileStoreUrls: {
|
|
117
60
|
env: 'TX_COLLECTION_FILE_STORE_URLS',
|
|
118
61
|
description: 'A comma-separated list of file store URLs (s3://, gs://, file://, http://) for tx collection',
|
|
@@ -123,14 +66,9 @@ export const txCollectionConfigMappings: ConfigMappingsType<TxCollectionConfig>
|
|
|
123
66
|
.filter(url => url.length > 0),
|
|
124
67
|
defaultValue: [],
|
|
125
68
|
},
|
|
126
|
-
txCollectionFileStoreSlowDelayMs: {
|
|
127
|
-
env: 'TX_COLLECTION_FILE_STORE_SLOW_DELAY_MS',
|
|
128
|
-
description: 'Delay before file store collection starts after slow collection',
|
|
129
|
-
...numberConfigHelper(24_000),
|
|
130
|
-
},
|
|
131
69
|
txCollectionFileStoreFastDelayMs: {
|
|
132
70
|
env: 'TX_COLLECTION_FILE_STORE_FAST_DELAY_MS',
|
|
133
|
-
description: 'Delay before file store collection
|
|
71
|
+
description: 'Delay in ms from reqresp start before file store collection begins',
|
|
134
72
|
...numberConfigHelper(2_000),
|
|
135
73
|
},
|
|
136
74
|
txCollectionFileStoreFastWorkerCount: {
|
|
@@ -138,29 +76,14 @@ export const txCollectionConfigMappings: ConfigMappingsType<TxCollectionConfig>
|
|
|
138
76
|
description: 'Number of concurrent workers for fast file store collection',
|
|
139
77
|
...numberConfigHelper(5),
|
|
140
78
|
},
|
|
141
|
-
txCollectionFileStoreSlowWorkerCount: {
|
|
142
|
-
env: 'TX_COLLECTION_FILE_STORE_SLOW_WORKER_COUNT',
|
|
143
|
-
description: 'Number of concurrent workers for slow file store collection',
|
|
144
|
-
...numberConfigHelper(2),
|
|
145
|
-
},
|
|
146
79
|
txCollectionFileStoreFastBackoffBaseMs: {
|
|
147
80
|
env: 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_BASE_MS',
|
|
148
81
|
description: 'Base backoff time in ms for fast file store collection retries',
|
|
149
82
|
...numberConfigHelper(1_000),
|
|
150
83
|
},
|
|
151
|
-
txCollectionFileStoreSlowBackoffBaseMs: {
|
|
152
|
-
env: 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_BASE_MS',
|
|
153
|
-
description: 'Base backoff time in ms for slow file store collection retries',
|
|
154
|
-
...numberConfigHelper(5_000),
|
|
155
|
-
},
|
|
156
84
|
txCollectionFileStoreFastBackoffMaxMs: {
|
|
157
85
|
env: 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_MAX_MS',
|
|
158
86
|
description: 'Max backoff time in ms for fast file store collection retries',
|
|
159
87
|
...numberConfigHelper(5_000),
|
|
160
88
|
},
|
|
161
|
-
txCollectionFileStoreSlowBackoffMaxMs: {
|
|
162
|
-
env: 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_MAX_MS',
|
|
163
|
-
description: 'Max backoff time in ms for slow file store collection retries',
|
|
164
|
-
...numberConfigHelper(30_000),
|
|
165
|
-
},
|
|
166
89
|
};
|