@aztec/p2p 0.0.1-commit.85d7d01 → 0.0.1-commit.8655d4a
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 +129 -3
- package/dest/bootstrap/bootstrap.d.ts +1 -1
- package/dest/bootstrap/bootstrap.d.ts.map +1 -1
- package/dest/bootstrap/bootstrap.js +9 -1
- package/dest/client/factory.d.ts +5 -4
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +33 -15
- package/dest/client/interface.d.ts +14 -5
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +13 -9
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +93 -49
- package/dest/config.d.ts +153 -102
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +134 -35
- 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 +99 -59
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +267 -197
- 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 +181 -65
- 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 +4 -2
- package/dest/mem_pools/instrumentation.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.js +33 -15
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +2 -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/interfaces.d.ts +7 -1
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +8 -6
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +2 -2
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +12 -5
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.js +2 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +29 -11
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +46 -16
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +1 -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 +26 -43
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +4 -2
- 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 +6 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +2 -1
- 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 +97 -88
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +9 -3
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/attestation_validator.js +37 -12
- 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/clock_tolerance.d.ts +12 -1
- package/dest/msg_validators/clock_tolerance.d.ts.map +1 -1
- package/dest/msg_validators/clock_tolerance.js +61 -3
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +10 -4
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/block_proposal_validator.js +10 -2
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +10 -4
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +16 -2
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +21 -8
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator.js +90 -44
- 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.d.ts +2 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.js +25 -21
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts +17 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.js +24 -0
- 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 +27 -7
- package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/factory.js +47 -17
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.js +6 -2
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +48 -7
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.js +88 -41
- package/dest/msg_validators/tx_validator/index.d.ts +4 -1
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +3 -0
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.js +4 -4
- package/dest/msg_validators/tx_validator/phases_validator.d.ts +22 -2
- package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/phases_validator.js +72 -24
- 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 +69 -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 +2 -1
- package/dest/services/discv5/discV5_service.d.ts.map +1 -1
- package/dest/services/discv5/discV5_service.js +35 -8
- package/dest/services/dummy_service.d.ts +11 -15
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +12 -16
- package/dest/services/encoding.d.ts +5 -1
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +7 -1
- package/dest/services/gossipsub/topic_score_params.d.ts +13 -2
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
- package/dest/services/gossipsub/topic_score_params.js +21 -4
- 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 +36 -46
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +296 -244
- package/dest/services/peer-manager/metrics.d.ts +3 -1
- package/dest/services/peer-manager/metrics.d.ts.map +1 -1
- package/dest/services/peer-manager/metrics.js +6 -0
- package/dest/services/peer-manager/peer_manager.d.ts +6 -2
- package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_manager.js +40 -11
- package/dest/services/peer-manager/peer_scoring.d.ts +7 -2
- package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_scoring.js +32 -10
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +11 -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 +84 -71
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts +10 -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 +5 -4
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.js +13 -7
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +3 -1
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/peer_collection.js +3 -0
- 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/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 +4 -2
- 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 +41 -214
- package/dest/services/service.d.ts +9 -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/request_tracker.d.ts +53 -0
- package/dest/services/tx_collection/request_tracker.d.ts.map +1 -0
- package/dest/services/tx_collection/request_tracker.js +84 -0
- package/dest/services/tx_collection/tx_collection.d.ts +36 -55
- 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 +9 -7
- 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 +12 -14
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +42 -15
- 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 +85 -39
- package/dest/testbench/worker_client_manager.d.ts +12 -6
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +57 -11
- package/dest/util.d.ts +12 -7
- 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 +15 -14
- package/src/bootstrap/bootstrap.ts +9 -1
- package/src/client/factory.ts +57 -8
- package/src/client/interface.ts +15 -11
- package/src/client/p2p_client.ts +106 -70
- package/src/client/test/{tx_proposal_collector/README.md → p2p_client.batch_tx_requester.bench.README.md} +23 -53
- package/src/config.ts +226 -36
- 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 +318 -242
- package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +204 -68
- package/src/mem_pools/attestation_pool/mocks.ts +13 -8
- package/src/mem_pools/index.ts +0 -3
- package/src/mem_pools/instrumentation.ts +22 -14
- package/src/mem_pools/tx_pool_v2/README.md +9 -1
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +2 -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/interfaces.ts +11 -1
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +15 -6
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +2 -1
- package/src/mem_pools/tx_pool_v2/interfaces.ts +12 -4
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +72 -20
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +29 -43
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +16 -1
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +101 -94
- package/src/msg_validators/attestation_validator/README.md +49 -0
- package/src/msg_validators/attestation_validator/attestation_validator.ts +41 -9
- package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +14 -7
- package/src/msg_validators/clock_tolerance.ts +79 -3
- package/src/msg_validators/proposal_validator/README.md +123 -0
- package/src/msg_validators/proposal_validator/block_proposal_validator.ts +24 -4
- package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +35 -7
- package/src/msg_validators/proposal_validator/proposal_validator.ts +114 -47
- package/src/msg_validators/tx_validator/README.md +15 -3
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -12
- package/src/msg_validators/tx_validator/allowed_public_setup.ts +22 -27
- package/src/msg_validators/tx_validator/allowed_setup_helpers.ts +31 -0
- 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 +61 -10
- package/src/msg_validators/tx_validator/fee_payer_balance.ts +6 -2
- package/src/msg_validators/tx_validator/gas_validator.ts +121 -39
- package/src/msg_validators/tx_validator/index.ts +3 -0
- package/src/msg_validators/tx_validator/metadata_validator.ts +12 -4
- package/src/msg_validators/tx_validator/phases_validator.ts +82 -27
- package/src/msg_validators/tx_validator/tx_proof_validator.ts +2 -0
- package/src/msg_validators/tx_validator/tx_validation_cache.ts +102 -0
- package/src/services/data_store.ts +5 -13
- package/src/services/discv5/discV5_service.ts +38 -5
- package/src/services/dummy_service.ts +14 -39
- package/src/services/encoding.ts +9 -1
- package/src/services/gossipsub/topic_score_params.ts +36 -4
- package/src/services/libp2p/instrumentation.ts +14 -0
- package/src/services/libp2p/libp2p_service.ts +321 -276
- package/src/services/peer-manager/metrics.ts +7 -0
- package/src/services/peer-manager/peer_manager.ts +46 -11
- package/src/services/peer-manager/peer_scoring.ts +27 -5
- package/src/services/reqresp/README.md +215 -0
- package/src/services/reqresp/batch-tx-requester/README.md +46 -7
- package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +83 -77
- package/src/services/reqresp/batch-tx-requester/interface.ts +13 -5
- package/src/services/reqresp/batch-tx-requester/missing_txs.ts +13 -6
- package/src/services/reqresp/batch-tx-requester/peer_collection.ts +5 -0
- 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/block_txs_handler.ts +4 -2
- 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 +45 -260
- package/src/services/service.ts +12 -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/request_tracker.ts +127 -0
- package/src/services/tx_collection/tx_collection.ts +331 -176
- package/src/services/tx_collection/tx_collection_sink.ts +2 -2
- package/src/services/tx_collection/tx_source.ts +8 -7
- 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 +4 -1
- package/src/test-helpers/mock-pubsub.ts +46 -60
- package/src/test-helpers/reqresp-nodes.ts +13 -23
- package/src/test-helpers/test_tx_provider.ts +5 -0
- package/src/test-helpers/testbench-utils.ts +53 -28
- package/src/testbench/p2p_client_testbench_worker.ts +89 -55
- package/src/testbench/worker_client_manager.ts +72 -25
- package/src/util.ts +33 -18
- 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 -304
- 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 -122
- 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 -400
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +0 -23
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +0 -1
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +0 -212
- 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 -54
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +0 -1
- package/dest/services/tx_collection/fast_tx_collection.js +0 -327
- package/dest/services/tx_collection/missing_txs_tracker.d.ts +0 -32
- package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +0 -1
- package/dest/services/tx_collection/missing_txs_tracker.js +0 -27
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +0 -49
- 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 -345
- 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 -162
- 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 -319
- package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +0 -230
- 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 -387
- package/src/services/tx_collection/missing_txs_tracker.ts +0 -52
- package/src/services/tx_collection/proposal_tx_collector.ts +0 -113
- package/src/services/tx_collection/slow_tx_collection.ts +0 -266
|
@@ -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
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { times } from '@aztec/foundation/collection';
|
|
1
2
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
|
-
import { type PromiseWithResolvers, promiseWithResolvers } from '@aztec/foundation/promise';
|
|
3
3
|
import { sleep } from '@aztec/foundation/sleep';
|
|
4
4
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
5
|
-
import {
|
|
5
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
6
6
|
|
|
7
7
|
import type { FileStoreTxSource } from './file_store_tx_source.js';
|
|
8
|
+
import type { IRequestTracker } from './request_tracker.js';
|
|
8
9
|
import type { TxAddContext, TxCollectionSink } from './tx_collection_sink.js';
|
|
9
10
|
|
|
10
11
|
/** Configuration for a FileStoreTxCollection instance. */
|
|
@@ -16,8 +17,6 @@ export type FileStoreCollectionConfig = {
|
|
|
16
17
|
|
|
17
18
|
type FileStoreTxEntry = {
|
|
18
19
|
txHash: string;
|
|
19
|
-
context: TxAddContext;
|
|
20
|
-
deadline: Date;
|
|
21
20
|
attempts: number;
|
|
22
21
|
lastAttemptTime: number;
|
|
23
22
|
nextSourceIndex: number;
|
|
@@ -25,96 +24,60 @@ type FileStoreTxEntry = {
|
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* Collects txs from file stores as a fallback after P2P methods have been tried.
|
|
28
|
-
*
|
|
29
|
-
* retries with round-robin across sources, and applies exponential
|
|
30
|
-
* full cycles through all sources.
|
|
27
|
+
* Each call to startCollecting spins up its own worker pool which pulls entries with priority
|
|
28
|
+
* (fewest attempts first), retries with round-robin across sources, and applies exponential
|
|
29
|
+
* backoff between full cycles through all sources. Workers self-terminate when the request
|
|
30
|
+
* tracker is cancelled (deadline / all-fetched / external) or when there is nothing left to do.
|
|
31
31
|
*/
|
|
32
32
|
export class FileStoreTxCollection {
|
|
33
|
-
/** Map from tx hash string to entry for all pending downloads. */
|
|
34
|
-
private entries = new Map<string, FileStoreTxEntry>();
|
|
35
|
-
|
|
36
|
-
/** Worker promises for the shared worker pool. */
|
|
37
|
-
private workers: Promise<void>[] = [];
|
|
38
|
-
|
|
39
|
-
/** Whether the worker pool is running. */
|
|
40
|
-
private running = false;
|
|
41
|
-
|
|
42
|
-
/** Signal used to wake sleeping workers when new entries arrive or stop is called. */
|
|
43
|
-
private wakeSignal: PromiseWithResolvers<void>;
|
|
44
|
-
|
|
45
33
|
constructor(
|
|
46
34
|
private readonly sources: FileStoreTxSource[],
|
|
47
35
|
private readonly txCollectionSink: TxCollectionSink,
|
|
48
36
|
private readonly config: FileStoreCollectionConfig,
|
|
49
37
|
private readonly dateProvider: DateProvider = new DateProvider(),
|
|
50
38
|
private readonly log: Logger = createLogger('p2p:file_store_tx_collection'),
|
|
51
|
-
) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
this.running = true;
|
|
62
|
-
for (let i = 0; i < this.config.workerCount; i++) {
|
|
63
|
-
this.workers.push(this.workerLoop());
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Stops all workers and clears state. */
|
|
68
|
-
public async stop(): Promise<void> {
|
|
69
|
-
this.running = false;
|
|
70
|
-
this.wake();
|
|
71
|
-
await Promise.all(this.workers);
|
|
72
|
-
this.workers = [];
|
|
73
|
-
this.entries.clear();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** Adds entries to the shared map and wakes workers. */
|
|
77
|
-
public startCollecting(txHashes: TxHash[], context: TxAddContext, deadline: Date): void {
|
|
78
|
-
if (this.sources.length === 0 || txHashes.length === 0) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (+deadline <= this.dateProvider.now()) {
|
|
39
|
+
) {}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Spins up workers to download all txs still missing from the tracker, racing across the
|
|
43
|
+
* configured file store sources. Resolves once all workers settle.
|
|
44
|
+
*/
|
|
45
|
+
public async startCollecting(requestTracker: IRequestTracker, context: TxAddContext): Promise<void> {
|
|
46
|
+
if (this.sources.length === 0 || requestTracker.checkCancelled()) {
|
|
82
47
|
return;
|
|
83
48
|
}
|
|
84
49
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
nextSourceIndex: Math.floor(Math.random() * this.sources.length),
|
|
95
|
-
});
|
|
96
|
-
}
|
|
50
|
+
// eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
|
|
51
|
+
const entries: Set<FileStoreTxEntry> = new Set();
|
|
52
|
+
for (const hashStr of requestTracker.missingTxHashes) {
|
|
53
|
+
entries.add({
|
|
54
|
+
txHash: hashStr,
|
|
55
|
+
attempts: 0,
|
|
56
|
+
lastAttemptTime: 0,
|
|
57
|
+
nextSourceIndex: Math.floor(Math.random() * this.sources.length),
|
|
58
|
+
});
|
|
97
59
|
}
|
|
98
|
-
this.wake();
|
|
99
|
-
}
|
|
100
60
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
61
|
+
// Yield before spawning so the synchronous caller can finish any follow-up (eg. marking a tx
|
|
62
|
+
// as fetched on the tracker, or cancelling it) before workers begin scanning entries.
|
|
63
|
+
await Promise.resolve();
|
|
64
|
+
if (requestTracker.checkCancelled()) {
|
|
65
|
+
return;
|
|
105
66
|
}
|
|
106
|
-
}
|
|
107
67
|
|
|
108
|
-
|
|
109
|
-
public clearPending(): void {
|
|
110
|
-
this.entries.clear();
|
|
68
|
+
await Promise.allSettled(times(this.config.workerCount, () => this.workerLoop(entries, requestTracker, context)));
|
|
111
69
|
}
|
|
112
70
|
|
|
113
|
-
private async workerLoop(
|
|
114
|
-
|
|
115
|
-
|
|
71
|
+
private async workerLoop(
|
|
72
|
+
// eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
|
|
73
|
+
entries: Set<FileStoreTxEntry>,
|
|
74
|
+
requestTracker: IRequestTracker,
|
|
75
|
+
context: TxAddContext,
|
|
76
|
+
): Promise<void> {
|
|
77
|
+
while (!requestTracker.checkCancelled() && entries.size > 0) {
|
|
78
|
+
const action = this.getNextAction(entries, requestTracker);
|
|
116
79
|
if (action.type === 'sleep') {
|
|
117
|
-
await action.
|
|
80
|
+
await Promise.race([sleep(action.ms), requestTracker.cancellationToken]);
|
|
118
81
|
continue;
|
|
119
82
|
}
|
|
120
83
|
|
|
@@ -133,10 +96,10 @@ export class FileStoreTxCollection {
|
|
|
133
96
|
method: 'file-store',
|
|
134
97
|
fileStore: source.getInfo(),
|
|
135
98
|
},
|
|
136
|
-
|
|
99
|
+
context,
|
|
137
100
|
);
|
|
138
101
|
if (result.txs.length > 0) {
|
|
139
|
-
|
|
102
|
+
entries.delete(entry);
|
|
140
103
|
}
|
|
141
104
|
} catch (err) {
|
|
142
105
|
this.log.trace(`Error downloading tx ${entry.txHash} from ${source.getInfo()}`, { err });
|
|
@@ -144,15 +107,20 @@ export class FileStoreTxCollection {
|
|
|
144
107
|
}
|
|
145
108
|
}
|
|
146
109
|
|
|
147
|
-
/** Single-pass scan: removes
|
|
148
|
-
private getNextAction(
|
|
110
|
+
/** Single-pass scan: removes stale entries, finds the best ready entry, or computes sleep time. */
|
|
111
|
+
private getNextAction(
|
|
112
|
+
// eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
|
|
113
|
+
entries: Set<FileStoreTxEntry>,
|
|
114
|
+
requestTracker: IRequestTracker,
|
|
115
|
+
): { type: 'process'; entry: FileStoreTxEntry } | { type: 'sleep'; ms: number } {
|
|
149
116
|
const now = this.dateProvider.now();
|
|
150
117
|
let best: FileStoreTxEntry | undefined;
|
|
151
118
|
let earliestReadyAt = Infinity;
|
|
152
119
|
|
|
153
|
-
for (const
|
|
154
|
-
|
|
155
|
-
|
|
120
|
+
for (const entry of entries) {
|
|
121
|
+
// Drop entries whose tx was already found via another collection path.
|
|
122
|
+
if (!requestTracker.isMissing(entry.txHash)) {
|
|
123
|
+
entries.delete(entry);
|
|
156
124
|
continue;
|
|
157
125
|
}
|
|
158
126
|
const backoffMs = this.getBackoffMs(entry);
|
|
@@ -169,10 +137,9 @@ export class FileStoreTxCollection {
|
|
|
169
137
|
if (best) {
|
|
170
138
|
return { type: 'process', entry: best };
|
|
171
139
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
return { type: 'sleep', promise: this.waitForWake() };
|
|
140
|
+
// earliestReadyAt is finite whenever there are surviving entries; if entries became empty,
|
|
141
|
+
// the outer worker loop will exit on its next iteration via entries.size === 0.
|
|
142
|
+
return { type: 'sleep', ms: earliestReadyAt === Infinity ? 0 : earliestReadyAt - now };
|
|
176
143
|
}
|
|
177
144
|
|
|
178
145
|
/** Computes backoff for an entry. Backoff applies after a full cycle through all sources. */
|
|
@@ -183,20 +150,4 @@ export class FileStoreTxCollection {
|
|
|
183
150
|
}
|
|
184
151
|
return Math.min(this.config.backoffBaseMs * Math.pow(2, fullCycles - 1), this.config.backoffMaxMs);
|
|
185
152
|
}
|
|
186
|
-
|
|
187
|
-
/** Resolves the current wake signal and creates a new one. */
|
|
188
|
-
private wake(): void {
|
|
189
|
-
this.wakeSignal.resolve();
|
|
190
|
-
this.wakeSignal = promiseWithResolvers<void>();
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/** Waits until the wake signal is resolved. */
|
|
194
|
-
private async waitForWake(): Promise<void> {
|
|
195
|
-
await this.wakeSignal.promise;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/** Sleeps for the given duration or until the wake signal is resolved. */
|
|
199
|
-
private async sleepOrWake(ms: number): Promise<void> {
|
|
200
|
-
await Promise.race([sleep(ms), this.wakeSignal.promise]);
|
|
201
|
-
}
|
|
202
153
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { partitionAsync } from '@aztec/foundation/collection';
|
|
1
2
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
3
4
|
import { type ReadOnlyFileStore, createReadOnlyFileStore } from '@aztec/stdlib/file-store';
|
|
4
|
-
import { Tx, type TxHash } from '@aztec/stdlib/tx';
|
|
5
|
+
import { Tx, type TxHash, type TxValidator } from '@aztec/stdlib/tx';
|
|
5
6
|
import {
|
|
6
7
|
type Histogram,
|
|
7
8
|
Metrics,
|
|
@@ -23,6 +24,7 @@ export class FileStoreTxSource implements TxSource {
|
|
|
23
24
|
private readonly fileStore: ReadOnlyFileStore,
|
|
24
25
|
private readonly baseUrl: string,
|
|
25
26
|
private readonly basePath: string,
|
|
27
|
+
private readonly txValidator: TxValidator,
|
|
26
28
|
private readonly log: Logger,
|
|
27
29
|
telemetry: TelemetryClient,
|
|
28
30
|
) {
|
|
@@ -44,6 +46,7 @@ export class FileStoreTxSource implements TxSource {
|
|
|
44
46
|
public static async create(
|
|
45
47
|
url: string,
|
|
46
48
|
basePath: string,
|
|
49
|
+
txValidator: TxValidator,
|
|
47
50
|
log: Logger = createLogger('p2p:file_store_tx_source'),
|
|
48
51
|
telemetry: TelemetryClient = getTelemetryClient(),
|
|
49
52
|
): Promise<FileStoreTxSource | undefined> {
|
|
@@ -53,7 +56,7 @@ export class FileStoreTxSource implements TxSource {
|
|
|
53
56
|
log.warn(`Failed to create file store for URL: ${url}`);
|
|
54
57
|
return undefined;
|
|
55
58
|
}
|
|
56
|
-
return new FileStoreTxSource(fileStore, url, basePath, log, telemetry);
|
|
59
|
+
return new FileStoreTxSource(fileStore, url, basePath, txValidator, log, telemetry);
|
|
57
60
|
} catch (err) {
|
|
58
61
|
log.warn(`Error creating file store for URL: ${url}`, { error: err });
|
|
59
62
|
return undefined;
|
|
@@ -65,35 +68,41 @@ export class FileStoreTxSource implements TxSource {
|
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
public async getTxsByHash(txHashes: TxHash[]): Promise<TxSourceCollectionResult> {
|
|
68
|
-
const
|
|
71
|
+
const results = await Promise.all(
|
|
72
|
+
txHashes.map(async txHash => {
|
|
73
|
+
const path = `${this.basePath}/txs/${txHash.toString()}.bin`;
|
|
74
|
+
const timer = new Timer();
|
|
75
|
+
try {
|
|
76
|
+
const buffer = await this.fileStore.read(path);
|
|
77
|
+
const tx = Tx.fromBuffer(buffer);
|
|
78
|
+
return { tx, downloadDuration: timer.ms(), downloadSize: buffer.length };
|
|
79
|
+
} catch {
|
|
80
|
+
this.downloadsFailed.add(1);
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const txs = results.filter(tx => tx !== undefined);
|
|
87
|
+
const [validTxs, invalidTxs] = await partitionAsync(
|
|
88
|
+
txs,
|
|
89
|
+
async ({ tx, downloadDuration, downloadSize }): Promise<boolean> => {
|
|
90
|
+
const valid = await this.txValidator.validateTx(tx);
|
|
91
|
+
if (valid.result === 'valid') {
|
|
92
|
+
this.downloadsSuccess.add(1);
|
|
93
|
+
this.downloadDuration.record(Math.ceil(downloadDuration));
|
|
94
|
+
this.downloadSize.record(downloadSize);
|
|
95
|
+
return true;
|
|
96
|
+
} else {
|
|
97
|
+
this.downloadsFailed.add(1);
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
);
|
|
102
|
+
|
|
69
103
|
return {
|
|
70
|
-
validTxs: (
|
|
71
|
-
|
|
72
|
-
txHashes.map(async txHash => {
|
|
73
|
-
const path = `${this.basePath}/txs/${txHash.toString()}.bin`;
|
|
74
|
-
const timer = new Timer();
|
|
75
|
-
try {
|
|
76
|
-
const buffer = await this.fileStore.read(path);
|
|
77
|
-
const tx = Tx.fromBuffer(buffer);
|
|
78
|
-
if ((await tx.validateTxHash()) && txHash.equals(tx.txHash)) {
|
|
79
|
-
this.downloadsSuccess.add(1);
|
|
80
|
-
this.downloadDuration.record(Math.ceil(timer.ms()));
|
|
81
|
-
this.downloadSize.record(buffer.length);
|
|
82
|
-
return tx;
|
|
83
|
-
} else {
|
|
84
|
-
invalidTxHashes.push(tx.txHash.toString());
|
|
85
|
-
this.downloadsFailed.add(1);
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
} catch {
|
|
89
|
-
// Tx not found or error reading - return undefined
|
|
90
|
-
this.downloadsFailed.add(1);
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
)
|
|
95
|
-
).filter(tx => tx !== undefined),
|
|
96
|
-
invalidTxHashes: invalidTxHashes,
|
|
104
|
+
validTxs: validTxs.map(({ tx }) => tx),
|
|
105
|
+
invalidTxHashes: invalidTxs.map(({ tx }) => tx.getTxHash().toString()),
|
|
97
106
|
};
|
|
98
107
|
}
|
|
99
108
|
}
|
|
@@ -109,9 +118,12 @@ export class FileStoreTxSource implements TxSource {
|
|
|
109
118
|
export async function createFileStoreTxSources(
|
|
110
119
|
urls: string[],
|
|
111
120
|
basePath: string,
|
|
121
|
+
txValidator: TxValidator,
|
|
112
122
|
log: Logger = createLogger('p2p:file_store_tx_source'),
|
|
113
123
|
telemetry: TelemetryClient = getTelemetryClient(),
|
|
114
124
|
): Promise<FileStoreTxSource[]> {
|
|
115
|
-
const sources = await Promise.all(
|
|
125
|
+
const sources = await Promise.all(
|
|
126
|
+
urls.map(url => FileStoreTxSource.create(url, basePath, txValidator, log, telemetry)),
|
|
127
|
+
);
|
|
116
128
|
return sources.filter((s): s is FileStoreTxSource => s !== undefined);
|
|
117
129
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export { TxCollection, type FastCollectionRequestInput } from './tx_collection.js';
|
|
1
|
+
export { TxCollection, type FastCollectionRequestInput, type IReqRespTxsCollector } from './tx_collection.js';
|
|
2
2
|
export { type TxSource, createNodeRpcTxSources, NodeRpcTxSource } from './tx_source.js';
|
|
3
|
-
export {
|
|
4
|
-
type MissingTxsCollector,
|
|
5
|
-
BatchTxRequesterCollector,
|
|
6
|
-
SendBatchRequestCollector,
|
|
7
|
-
} from './proposal_tx_collector.js';
|
|
8
3
|
export { FileStoreTxSource, createFileStoreTxSources } from './file_store_tx_source.js';
|
|
@@ -18,13 +18,7 @@ export class TxCollectionInstrumentation {
|
|
|
18
18
|
const meter = client.getMeter(name);
|
|
19
19
|
|
|
20
20
|
this.txsCollected = createUpDownCounterWithDefault(meter, Metrics.TX_COLLECTOR_COUNT, {
|
|
21
|
-
[Attributes.TX_COLLECTION_METHOD]: [
|
|
22
|
-
'fast-req-resp',
|
|
23
|
-
'fast-node-rpc',
|
|
24
|
-
'slow-req-resp',
|
|
25
|
-
'slow-node-rpc',
|
|
26
|
-
'file-store',
|
|
27
|
-
],
|
|
21
|
+
[Attributes.TX_COLLECTION_METHOD]: ['fast-req-resp', 'fast-node-rpc', 'file-store'],
|
|
28
22
|
});
|
|
29
23
|
|
|
30
24
|
this.collectionDurationPerTx = meter.createHistogram(Metrics.TX_COLLECTOR_DURATION_PER_TX);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type PromiseWithResolvers, promiseWithResolvers } from '@aztec/foundation/promise';
|
|
2
|
+
import type { DateProvider } from '@aztec/foundation/timer';
|
|
3
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { Tx } from '@aztec/stdlib/tx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Tracks which transactions are still missing and need to be fetched.
|
|
8
|
+
* Manages the request deadline and serves as the sole source of cancellation signal.
|
|
9
|
+
* The request is cancelled when all txs are fetched or the deadline expires.
|
|
10
|
+
*/
|
|
11
|
+
export interface IRequestTracker {
|
|
12
|
+
/** Returns the set of transaction hashes that are still missing. */
|
|
13
|
+
get missingTxHashes(): Set<string>;
|
|
14
|
+
/** Size of this.missingTxHashes */
|
|
15
|
+
get numberOfMissingTxs(): number;
|
|
16
|
+
/** Are all requested txs fetched */
|
|
17
|
+
allFetched(): boolean;
|
|
18
|
+
/** Checks that transaction is still missing */
|
|
19
|
+
isMissing(txHash: string): boolean;
|
|
20
|
+
/** Marks a transaction as fetched. Returns true if it was previously missing. */
|
|
21
|
+
markFetched(tx: Tx): boolean;
|
|
22
|
+
/** Get list of collected txs */
|
|
23
|
+
get collectedTxs(): Tx[];
|
|
24
|
+
/** The deadline for this request. */
|
|
25
|
+
get deadline(): Date;
|
|
26
|
+
/** Remaining time in milliseconds until deadline. Returns 0 if already past. */
|
|
27
|
+
get timeoutMs(): number;
|
|
28
|
+
/** Checks whether the request is cancelled (deadline expired or all fetched). May trigger cancellation if deadline has passed. */
|
|
29
|
+
checkCancelled(): boolean;
|
|
30
|
+
/** Resolves when deadline expires or all txs are fetched. */
|
|
31
|
+
get cancellationToken(): Promise<void>;
|
|
32
|
+
/** Externally cancel the request. */
|
|
33
|
+
cancel(): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class RequestTracker implements IRequestTracker {
|
|
37
|
+
public readonly collectedTxs: Tx[] = [];
|
|
38
|
+
private done = false;
|
|
39
|
+
private readonly cancellationTokenPromise: PromiseWithResolvers<void>;
|
|
40
|
+
private readonly deadlineTimer: ReturnType<typeof setTimeout> | undefined;
|
|
41
|
+
|
|
42
|
+
private constructor(
|
|
43
|
+
public readonly missingTxHashes: Set<string>,
|
|
44
|
+
public readonly deadline: Date,
|
|
45
|
+
private readonly dateProvider?: DateProvider,
|
|
46
|
+
) {
|
|
47
|
+
this.cancellationTokenPromise = promiseWithResolvers<void>();
|
|
48
|
+
|
|
49
|
+
if (missingTxHashes.size === 0) {
|
|
50
|
+
this.finish();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const now = this.dateProvider?.now() ?? Date.now();
|
|
55
|
+
const remaining = deadline.getTime() - now;
|
|
56
|
+
if (remaining <= 0) {
|
|
57
|
+
this.finish();
|
|
58
|
+
} else {
|
|
59
|
+
this.deadlineTimer = setTimeout(() => this.finish(), remaining);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public static create(hashes: TxHash[] | string[], deadline: Date, dateProvider?: DateProvider) {
|
|
64
|
+
return new RequestTracker(new Set(hashes.map(hash => hash.toString())), deadline, dateProvider);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
markFetched(tx: Tx): boolean {
|
|
68
|
+
if (this.missingTxHashes.delete(tx.txHash.toString())) {
|
|
69
|
+
this.collectedTxs.push(tx);
|
|
70
|
+
if (this.allFetched()) {
|
|
71
|
+
this.finish();
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get numberOfMissingTxs(): number {
|
|
79
|
+
return this.missingTxHashes.size;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
allFetched(): boolean {
|
|
83
|
+
return this.numberOfMissingTxs === 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
isMissing(txHash: string): boolean {
|
|
87
|
+
return this.missingTxHashes.has(txHash.toString());
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
get timeoutMs(): number {
|
|
91
|
+
const now = this.dateProvider?.now() ?? Date.now();
|
|
92
|
+
return Math.max(0, this.deadline.getTime() - now);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
checkCancelled(): boolean {
|
|
96
|
+
if (this.done) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
// Synchronous fallback: check deadline even if setTimeout hasn't fired yet.
|
|
100
|
+
// This prevents macrotask starvation in tight async loops from blocking cancellation.
|
|
101
|
+
const now = this.dateProvider?.now() ?? Date.now();
|
|
102
|
+
if (now >= this.deadline.getTime()) {
|
|
103
|
+
this.finish();
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get cancellationToken(): Promise<void> {
|
|
110
|
+
return this.cancellationTokenPromise.promise;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
cancel(): void {
|
|
114
|
+
this.finish();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
private finish() {
|
|
118
|
+
if (this.done) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.done = true;
|
|
122
|
+
if (this.deadlineTimer) {
|
|
123
|
+
clearTimeout(this.deadlineTimer);
|
|
124
|
+
}
|
|
125
|
+
this.cancellationTokenPromise.resolve();
|
|
126
|
+
}
|
|
127
|
+
}
|