@aztec/p2p 0.0.0-test.0 → 0.0.1-commit.24de95ac
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bootstrap/bootstrap.d.ts.map +1 -1
- package/dest/bootstrap/bootstrap.js +22 -9
- package/dest/client/factory.d.ts +13 -3
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +60 -24
- package/dest/client/index.d.ts +1 -0
- package/dest/client/index.d.ts.map +1 -1
- package/dest/client/index.js +1 -0
- package/dest/client/interface.d.ts +155 -0
- package/dest/client/interface.d.ts.map +1 -0
- package/dest/client/interface.js +9 -0
- package/dest/client/p2p_client.d.ts +72 -169
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +365 -174
- package/dest/config.d.ts +123 -103
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +173 -34
- package/dest/enr/generate-enr.d.ts +10 -2
- package/dest/enr/generate-enr.d.ts.map +1 -1
- package/dest/enr/generate-enr.js +27 -5
- package/dest/index.d.ts +3 -0
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +2 -0
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +42 -4
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +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 +204 -54
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +10 -2
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +93 -15
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +10 -2
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.js +86 -18
- package/dest/mem_pools/attestation_pool/mocks.d.ts +1 -2
- package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/mocks.js +9 -15
- package/dest/mem_pools/instrumentation.d.ts +7 -11
- package/dest/mem_pools/instrumentation.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.js +25 -37
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +93 -9
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.js +469 -97
- package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts +33 -9
- package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/memory_tx_pool.js +133 -36
- package/dest/mem_pools/tx_pool/priority.js +1 -1
- package/dest/mem_pools/tx_pool/tx_pool.d.ts +64 -8
- package/dest/mem_pools/tx_pool/tx_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.js +264 -39
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +1 -0
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/attestation_validator.js +45 -9
- package/dest/msg_validators/block_proposal_validator/block_proposal_validator.d.ts +5 -1
- package/dest/msg_validators/block_proposal_validator/block_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/block_proposal_validator/block_proposal_validator.js +61 -12
- package/dest/msg_validators/msg_seen_validator/msg_seen_validator.d.ts +10 -0
- package/dest/msg_validators/msg_seen_validator/msg_seen_validator.d.ts.map +1 -0
- package/dest/msg_validators/msg_seen_validator/msg_seen_validator.js +36 -0
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts +3 -0
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/allowed_public_setup.js +27 -0
- package/dest/msg_validators/tx_validator/archive_cache.d.ts +14 -0
- package/dest/msg_validators/tx_validator/archive_cache.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/archive_cache.js +22 -0
- package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/block_header_validator.js +4 -4
- package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/data_validator.js +56 -86
- package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +0 -2
- package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/double_spend_validator.js +21 -27
- package/dest/msg_validators/tx_validator/factory.d.ts +15 -0
- package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/factory.js +74 -0
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +11 -0
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/gas_validator.js +115 -0
- package/dest/msg_validators/tx_validator/index.d.ts +7 -0
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +7 -0
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts +7 -3
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.js +39 -20
- package/dest/msg_validators/tx_validator/phases_validator.d.ts +14 -0
- package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/phases_validator.js +91 -0
- package/dest/msg_validators/tx_validator/test_utils.d.ts +17 -0
- package/dest/msg_validators/tx_validator/test_utils.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/test_utils.js +22 -0
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +12 -0
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/timestamp_validator.js +32 -0
- package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts +8 -0
- package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/tx_permitted_validator.js +24 -0
- package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/tx_proof_validator.js +6 -5
- package/dest/services/discv5/discV5_service.d.ts +9 -8
- package/dest/services/discv5/discV5_service.d.ts.map +1 -1
- package/dest/services/discv5/discV5_service.js +63 -36
- package/dest/services/dummy_service.d.ts +49 -10
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +88 -5
- package/dest/services/encoding.d.ts +25 -6
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +73 -5
- package/dest/services/index.d.ts +4 -0
- package/dest/services/index.d.ts.map +1 -1
- package/dest/services/index.js +4 -0
- package/dest/services/libp2p/instrumentation.d.ts +18 -0
- package/dest/services/libp2p/instrumentation.d.ts.map +1 -0
- package/dest/services/libp2p/instrumentation.js +157 -0
- package/dest/services/libp2p/libp2p_service.d.ts +87 -42
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +500 -218
- package/dest/services/peer-manager/interface.d.ts +23 -0
- package/dest/services/peer-manager/interface.d.ts.map +1 -0
- package/dest/services/peer-manager/interface.js +1 -0
- 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 +11 -2
- package/dest/services/peer-manager/peer_manager.d.ts +126 -15
- package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_manager.js +547 -72
- package/dest/services/reqresp/config.d.ts +10 -8
- package/dest/services/reqresp/config.d.ts.map +1 -1
- package/dest/services/reqresp/config.js +18 -4
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts +1 -1
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts.map +1 -1
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.js +10 -6
- package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts +30 -13
- package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts.map +1 -1
- package/dest/services/reqresp/connection-sampler/connection_sampler.js +142 -84
- package/dest/services/reqresp/index.d.ts +2 -1
- package/dest/services/reqresp/index.d.ts.map +1 -1
- package/dest/services/reqresp/index.js +2 -1
- package/dest/services/reqresp/interface.d.ts +72 -23
- package/dest/services/reqresp/interface.d.ts.map +1 -1
- package/dest/services/reqresp/interface.js +45 -26
- package/dest/services/reqresp/metrics.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/auth.d.ts +43 -0
- package/dest/services/reqresp/protocols/auth.d.ts.map +1 -0
- package/dest/services/reqresp/protocols/auth.js +71 -0
- package/dest/services/reqresp/protocols/block.d.ts +5 -0
- package/dest/services/reqresp/protocols/block.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block.js +28 -5
- package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts +30 -0
- package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts.map +1 -0
- package/dest/services/reqresp/protocols/block_txs/bitvector.js +75 -0
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +11 -0
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -0
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.js +39 -0
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +49 -0
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -0
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +75 -0
- package/dest/services/reqresp/protocols/block_txs/index.d.ts +4 -0
- package/dest/services/reqresp/protocols/block_txs/index.d.ts.map +1 -0
- package/dest/services/reqresp/protocols/block_txs/index.js +3 -0
- package/dest/services/reqresp/protocols/goodbye.d.ts +2 -4
- package/dest/services/reqresp/protocols/goodbye.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/goodbye.js +7 -7
- package/dest/services/reqresp/protocols/index.d.ts +2 -0
- package/dest/services/reqresp/protocols/index.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/index.js +2 -0
- package/dest/services/reqresp/protocols/ping.d.ts +0 -2
- package/dest/services/reqresp/protocols/ping.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/status.d.ts +38 -6
- package/dest/services/reqresp/protocols/status.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/status.js +72 -5
- package/dest/services/reqresp/protocols/tx.d.ts +12 -1
- package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/tx.js +34 -6
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts +4 -2
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts.map +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limiter.js +10 -2
- package/dest/services/reqresp/rate-limiter/rate_limits.d.ts.map +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limits.js +21 -1
- package/dest/services/reqresp/reqresp.d.ts +45 -47
- package/dest/services/reqresp/reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/reqresp.js +298 -207
- package/dest/services/reqresp/status.d.ts +9 -3
- package/dest/services/reqresp/status.d.ts.map +1 -1
- package/dest/services/reqresp/status.js +9 -2
- package/dest/services/service.d.ts +22 -18
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/config.d.ts +25 -0
- package/dest/services/tx_collection/config.d.ts.map +1 -0
- package/dest/services/tx_collection/config.js +58 -0
- package/dest/services/tx_collection/fast_tx_collection.d.ts +56 -0
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -0
- package/dest/services/tx_collection/fast_tx_collection.js +300 -0
- package/dest/services/tx_collection/index.d.ts +3 -0
- package/dest/services/tx_collection/index.d.ts.map +1 -0
- package/dest/services/tx_collection/index.js +2 -0
- package/dest/services/tx_collection/instrumentation.d.ts +10 -0
- package/dest/services/tx_collection/instrumentation.d.ts.map +1 -0
- package/dest/services/tx_collection/instrumentation.js +34 -0
- package/dest/services/tx_collection/slow_tx_collection.d.ts +54 -0
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -0
- package/dest/services/tx_collection/slow_tx_collection.js +176 -0
- package/dest/services/tx_collection/tx_collection.d.ts +110 -0
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -0
- package/dest/services/tx_collection/tx_collection.js +128 -0
- package/dest/services/tx_collection/tx_collection_sink.d.ts +30 -0
- package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -0
- package/dest/services/tx_collection/tx_collection_sink.js +111 -0
- package/dest/services/tx_collection/tx_source.d.ts +18 -0
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -0
- package/dest/services/tx_collection/tx_source.js +31 -0
- package/dest/services/tx_provider.d.ts +49 -0
- package/dest/services/tx_provider.d.ts.map +1 -0
- package/dest/services/tx_provider.js +210 -0
- package/dest/services/tx_provider_instrumentation.d.ts +13 -0
- package/dest/services/tx_provider_instrumentation.d.ts.map +1 -0
- package/dest/services/tx_provider_instrumentation.js +34 -0
- package/dest/test-helpers/get-ports.d.ts.map +1 -1
- package/dest/test-helpers/index.d.ts +1 -0
- package/dest/test-helpers/index.d.ts.map +1 -1
- package/dest/test-helpers/index.js +1 -0
- package/dest/test-helpers/make-enrs.d.ts.map +1 -1
- package/dest/test-helpers/make-enrs.js +4 -5
- package/dest/test-helpers/make-test-p2p-clients.d.ts +32 -4
- package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
- package/dest/test-helpers/make-test-p2p-clients.js +86 -16
- package/dest/test-helpers/mock-pubsub.d.ts +59 -0
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -0
- package/dest/test-helpers/mock-pubsub.js +130 -0
- package/dest/test-helpers/mock-tx-helpers.d.ts +12 -0
- package/dest/test-helpers/mock-tx-helpers.d.ts.map +1 -0
- package/dest/test-helpers/mock-tx-helpers.js +19 -0
- package/dest/test-helpers/reqresp-nodes.d.ts +14 -10
- package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
- package/dest/test-helpers/reqresp-nodes.js +62 -28
- package/dest/testbench/p2p_client_testbench_worker.js +96 -25
- package/dest/testbench/parse_log_file.js +4 -4
- package/dest/testbench/testbench.js +4 -4
- package/dest/testbench/worker_client_manager.d.ts +0 -5
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +11 -19
- package/dest/types/index.d.ts +3 -1
- package/dest/types/index.d.ts.map +1 -1
- package/dest/types/index.js +2 -0
- package/dest/util.d.ts +22 -15
- package/dest/util.d.ts.map +1 -1
- package/dest/util.js +64 -67
- package/dest/versioning.d.ts +3 -3
- package/dest/versioning.d.ts.map +1 -1
- package/dest/versioning.js +8 -3
- package/package.json +28 -24
- package/src/bootstrap/bootstrap.ts +27 -11
- package/src/client/factory.ts +136 -45
- package/src/client/index.ts +1 -0
- package/src/client/interface.ts +195 -0
- package/src/client/p2p_client.ts +460 -327
- package/src/config.ts +288 -134
- package/src/enr/generate-enr.ts +39 -6
- package/src/index.ts +4 -0
- package/src/mem_pools/attestation_pool/attestation_pool.ts +48 -4
- package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +241 -55
- package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +117 -20
- package/src/mem_pools/attestation_pool/memory_attestation_pool.ts +114 -22
- package/src/mem_pools/attestation_pool/mocks.ts +11 -10
- package/src/mem_pools/instrumentation.ts +32 -46
- package/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +549 -108
- package/src/mem_pools/tx_pool/memory_tx_pool.ts +153 -44
- package/src/mem_pools/tx_pool/priority.ts +1 -1
- package/src/mem_pools/tx_pool/tx_pool.ts +67 -8
- package/src/mem_pools/tx_pool/tx_pool_test_suite.ts +217 -34
- package/src/msg_validators/attestation_validator/attestation_validator.ts +55 -10
- package/src/msg_validators/block_proposal_validator/block_proposal_validator.ts +66 -14
- package/src/msg_validators/msg_seen_validator/msg_seen_validator.ts +36 -0
- package/src/msg_validators/tx_validator/allowed_public_setup.ts +35 -0
- package/src/msg_validators/tx_validator/archive_cache.ts +28 -0
- package/src/msg_validators/tx_validator/block_header_validator.ts +4 -4
- package/src/msg_validators/tx_validator/data_validator.ts +81 -69
- package/src/msg_validators/tx_validator/double_spend_validator.ts +19 -17
- package/src/msg_validators/tx_validator/factory.ts +109 -0
- package/src/msg_validators/tx_validator/gas_validator.ts +134 -0
- package/src/msg_validators/tx_validator/index.ts +7 -0
- package/src/msg_validators/tx_validator/metadata_validator.ts +58 -21
- package/src/msg_validators/tx_validator/phases_validator.ts +114 -0
- package/src/msg_validators/tx_validator/test_utils.ts +43 -0
- package/src/msg_validators/tx_validator/timestamp_validator.ts +46 -0
- package/src/msg_validators/tx_validator/tx_permitted_validator.ts +17 -0
- package/src/msg_validators/tx_validator/tx_proof_validator.ts +6 -5
- package/src/services/discv5/discV5_service.ts +84 -38
- package/src/services/dummy_service.ts +147 -9
- package/src/services/encoding.ts +80 -5
- package/src/services/index.ts +4 -0
- package/src/services/libp2p/instrumentation.ts +158 -0
- package/src/services/libp2p/libp2p_service.ts +646 -263
- package/src/services/peer-manager/interface.ts +29 -0
- package/src/services/peer-manager/metrics.ts +16 -1
- package/src/services/peer-manager/peer_manager.ts +652 -78
- package/src/services/reqresp/config.ts +26 -9
- package/src/services/reqresp/connection-sampler/batch_connection_sampler.ts +12 -6
- package/src/services/reqresp/connection-sampler/connection_sampler.ts +148 -95
- package/src/services/reqresp/index.ts +2 -0
- package/src/services/reqresp/interface.ts +91 -36
- package/src/services/reqresp/metrics.ts +4 -1
- package/src/services/reqresp/protocols/auth.ts +83 -0
- package/src/services/reqresp/protocols/block.ts +24 -3
- package/src/services/reqresp/protocols/block_txs/bitvector.ts +90 -0
- package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +53 -0
- package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +79 -0
- package/src/services/reqresp/protocols/block_txs/index.ts +3 -0
- package/src/services/reqresp/protocols/goodbye.ts +9 -7
- package/src/services/reqresp/protocols/index.ts +2 -0
- package/src/services/reqresp/protocols/status.ts +117 -5
- package/src/services/reqresp/protocols/tx.ts +35 -6
- package/src/services/reqresp/rate-limiter/rate_limiter.ts +12 -3
- package/src/services/reqresp/rate-limiter/rate_limits.ts +21 -1
- package/src/services/reqresp/reqresp.ts +387 -256
- package/src/services/reqresp/status.ts +12 -3
- package/src/services/service.ts +45 -21
- package/src/services/tx_collection/config.ts +84 -0
- package/src/services/tx_collection/fast_tx_collection.ts +340 -0
- package/src/services/tx_collection/index.ts +2 -0
- package/src/services/tx_collection/instrumentation.ts +43 -0
- package/src/services/tx_collection/slow_tx_collection.ts +232 -0
- package/src/services/tx_collection/tx_collection.ts +215 -0
- package/src/services/tx_collection/tx_collection_sink.ts +129 -0
- package/src/services/tx_collection/tx_source.ts +37 -0
- package/src/services/tx_provider.ts +216 -0
- package/src/services/tx_provider_instrumentation.ts +44 -0
- package/src/test-helpers/index.ts +1 -0
- package/src/test-helpers/make-enrs.ts +4 -5
- package/src/test-helpers/make-test-p2p-clients.ts +111 -21
- package/src/test-helpers/mock-pubsub.ts +188 -0
- package/src/test-helpers/mock-tx-helpers.ts +24 -0
- package/src/test-helpers/reqresp-nodes.ts +86 -35
- package/src/testbench/p2p_client_testbench_worker.ts +145 -22
- package/src/testbench/parse_log_file.ts +4 -4
- package/src/testbench/testbench.ts +4 -4
- package/src/testbench/worker_client_manager.ts +17 -23
- package/src/types/index.ts +2 -0
- package/src/util.ts +93 -89
- package/src/versioning.ts +11 -4
package/dest/config.d.ts
CHANGED
|
@@ -1,130 +1,110 @@
|
|
|
1
|
-
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
1
|
+
import { type ConfigMappingsType, SecretValue } from '@aztec/foundation/config';
|
|
2
2
|
import { type DataStoreConfig } from '@aztec/kv-store/config';
|
|
3
|
-
import { type ChainConfig } from '@aztec/stdlib/config';
|
|
3
|
+
import { type AllowedElement, type ChainConfig } from '@aztec/stdlib/config';
|
|
4
4
|
import { type P2PReqRespConfig } from './services/reqresp/config.js';
|
|
5
|
+
import { type TxCollectionConfig } from './services/tx_collection/config.js';
|
|
5
6
|
/**
|
|
6
7
|
* P2P client configuration values.
|
|
7
8
|
*/
|
|
8
|
-
export interface P2PConfig extends P2PReqRespConfig, ChainConfig {
|
|
9
|
-
/**
|
|
10
|
-
* A flag dictating whether the P2P subsystem should be enabled.
|
|
11
|
-
*/
|
|
9
|
+
export interface P2PConfig extends P2PReqRespConfig, ChainConfig, TxCollectionConfig {
|
|
10
|
+
/** A flag dictating whether the P2P subsystem should be enabled. */
|
|
12
11
|
p2pEnabled: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* The frequency in which to check for new L2 blocks.
|
|
15
|
-
*/
|
|
12
|
+
/** The frequency in which to check for new L2 blocks. */
|
|
16
13
|
blockCheckIntervalMS: number;
|
|
17
|
-
/**
|
|
18
|
-
* The number of blocks to fetch in a single batch.
|
|
19
|
-
*/
|
|
14
|
+
/** The number of blocks to fetch in a single batch. */
|
|
20
15
|
blockRequestBatchSize: number;
|
|
21
|
-
/**
|
|
22
|
-
* DEBUG: Disable colocation penalty - for testing purposes only
|
|
23
|
-
*/
|
|
16
|
+
/** DEBUG: Disable colocation penalty - for testing purposes only */
|
|
24
17
|
debugDisableColocationPenalty: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* The frequency in which to check for new peers.
|
|
27
|
-
*/
|
|
18
|
+
/** The frequency in which to check for new peers. */
|
|
28
19
|
peerCheckIntervalMS: number;
|
|
29
|
-
/**
|
|
30
|
-
* Size of queue of L2 blocks to store.
|
|
31
|
-
*/
|
|
20
|
+
/** Size of queue of L2 blocks to store. */
|
|
32
21
|
l2QueueSize: number;
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The listen address for UDP.
|
|
47
|
-
*/
|
|
48
|
-
udpListenAddress: string;
|
|
49
|
-
/**
|
|
50
|
-
* An optional peer id private key. If blank, will generate a random key.
|
|
51
|
-
*/
|
|
52
|
-
peerIdPrivateKey?: string;
|
|
53
|
-
/**
|
|
54
|
-
* A list of bootstrap peers to connect to.
|
|
55
|
-
*/
|
|
22
|
+
/** The port for the P2P service. */
|
|
23
|
+
p2pPort: number;
|
|
24
|
+
/** The port to broadcast the P2P service on (included in the node's ENR). */
|
|
25
|
+
p2pBroadcastPort?: number;
|
|
26
|
+
/** The IP address for the P2P service. */
|
|
27
|
+
p2pIp?: string;
|
|
28
|
+
/** The listen address. */
|
|
29
|
+
listenAddress: string;
|
|
30
|
+
/** An optional peer id private key. If blank, will generate a random key. */
|
|
31
|
+
peerIdPrivateKey?: SecretValue<string>;
|
|
32
|
+
/** An optional path to store generated peer id private keys. If blank, will default to storing any generated keys in the data directory. */
|
|
33
|
+
peerIdPrivateKeyPath?: string;
|
|
34
|
+
/** A list of bootstrap peers to connect to. */
|
|
56
35
|
bootstrapNodes: string[];
|
|
57
36
|
/** Whether to execute the version check in the bootstrap node ENR. */
|
|
58
37
|
bootstrapNodeEnrVersionCheck: boolean;
|
|
59
38
|
/** Whether to consider any configured bootnodes as full peers, e.g. for transaction gossiping */
|
|
60
39
|
bootstrapNodesAsFullPeers: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* The maximum number of peers (a peer count above this will cause the node to refuse connection attempts)
|
|
63
|
-
*/
|
|
40
|
+
/** The maximum number of peers (a peer count above this will cause the node to refuse connection attempts) */
|
|
64
41
|
maxPeerCount: number;
|
|
65
|
-
/**
|
|
66
|
-
* If announceUdpAddress or announceTcpAddress are not provided, query for the IP address of the machine. Default is false.
|
|
67
|
-
*/
|
|
42
|
+
/** If announceUdpAddress or announceTcpAddress are not provided, query for the IP address of the machine. Default is false. */
|
|
68
43
|
queryForIp: boolean;
|
|
69
|
-
/**
|
|
70
|
-
keepProvenTxsInPoolFor: number;
|
|
71
|
-
/** How many slots to keep attestations for. */
|
|
72
|
-
keepAttestationsInPoolFor: number;
|
|
73
|
-
/**
|
|
74
|
-
* The interval of the gossipsub heartbeat to perform maintenance tasks.
|
|
75
|
-
*/
|
|
44
|
+
/** The interval of the gossipsub heartbeat to perform maintenance tasks. */
|
|
76
45
|
gossipsubInterval: number;
|
|
77
|
-
/**
|
|
78
|
-
* The D parameter for the gossipsub protocol.
|
|
79
|
-
*/
|
|
46
|
+
/** The D parameter for the gossipsub protocol. */
|
|
80
47
|
gossipsubD: number;
|
|
81
|
-
/**
|
|
82
|
-
* The Dlo parameter for the gossipsub protocol.
|
|
83
|
-
*/
|
|
48
|
+
/** The Dlo parameter for the gossipsub protocol. */
|
|
84
49
|
gossipsubDlo: number;
|
|
85
|
-
/**
|
|
86
|
-
* The Dhi parameter for the gossipsub protocol.
|
|
87
|
-
*/
|
|
50
|
+
/** The Dhi parameter for the gossipsub protocol. */
|
|
88
51
|
gossipsubDhi: number;
|
|
89
|
-
/**
|
|
90
|
-
* The Dlazy parameter for the gossipsub protocol.
|
|
91
|
-
*/
|
|
52
|
+
/** The Dlazy parameter for the gossipsub protocol. */
|
|
92
53
|
gossipsubDLazy: number;
|
|
93
|
-
/**
|
|
94
|
-
* Whether to flood publish messages. - For testing purposes only
|
|
95
|
-
*/
|
|
54
|
+
/** Whether to flood publish messages. - For testing purposes only */
|
|
96
55
|
gossipsubFloodPublish: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* The number of gossipsub interval message cache windows to keep.
|
|
99
|
-
*/
|
|
56
|
+
/** The number of gossipsub interval message cache windows to keep. */
|
|
100
57
|
gossipsubMcacheLength: number;
|
|
101
|
-
/**
|
|
102
|
-
* How many message cache windows to include when gossiping with other pears.
|
|
103
|
-
*/
|
|
58
|
+
/** How many message cache windows to include when gossiping with other pears. */
|
|
104
59
|
gossipsubMcacheGossip: number;
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
60
|
+
/** How long to keep message IDs in the seen cache (ms). */
|
|
61
|
+
gossipsubSeenTTL: number;
|
|
62
|
+
/** The 'age' (in # of L2 blocks) of a processed tx after which we heavily penalize a peer for re-sending it. */
|
|
108
63
|
doubleSpendSeverePeerPenaltyWindow: number;
|
|
109
|
-
/**
|
|
110
|
-
* The weight of the tx topic for the gossipsub protocol. This determines how much the score for this specific topic contributes to the overall peer score.
|
|
111
|
-
*/
|
|
64
|
+
/** The weight of the tx topic for the gossipsub protocol. This determines how much the score for this specific topic contributes to the overall peer score. */
|
|
112
65
|
gossipsubTxTopicWeight: number;
|
|
113
|
-
/**
|
|
114
|
-
* This is the weight applied to the penalty for delivering invalid messages.
|
|
115
|
-
*/
|
|
66
|
+
/** This is the weight applied to the penalty for delivering invalid messages. */
|
|
116
67
|
gossipsubTxInvalidMessageDeliveriesWeight: number;
|
|
117
|
-
/**
|
|
118
|
-
* determines how quickly the penalty for invalid message deliveries decays over time. Between 0 and 1.
|
|
119
|
-
*/
|
|
68
|
+
/** determines how quickly the penalty for invalid message deliveries decays over time. Between 0 and 1. */
|
|
120
69
|
gossipsubTxInvalidMessageDeliveriesDecay: number;
|
|
121
|
-
/**
|
|
122
|
-
* The values for the peer scoring system. Passed as a comma separated list of values in order: low, mid, high tolerance errors.
|
|
123
|
-
*/
|
|
70
|
+
/** The values for the peer scoring system. Passed as a comma separated list of values in order: low, mid, high tolerance errors. */
|
|
124
71
|
peerPenaltyValues: number[];
|
|
125
72
|
/** Limit of transactions to archive in the tx pool. Once the archived tx limit is reached, the oldest archived txs will be purged. */
|
|
126
73
|
archivedTxLimit: number;
|
|
74
|
+
/** A list of trusted peers. */
|
|
75
|
+
trustedPeers: string[];
|
|
76
|
+
/** A list of private peers. */
|
|
77
|
+
privatePeers: string[];
|
|
78
|
+
/** A list of preferred peers. */
|
|
79
|
+
preferredPeers: string[];
|
|
80
|
+
/** The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb. */
|
|
81
|
+
p2pStoreMapSizeKb?: number;
|
|
82
|
+
/** Which calls are allowed in the public setup phase of a tx. */
|
|
83
|
+
txPublicSetupAllowList: AllowedElement[];
|
|
84
|
+
/** The maximum cumulative tx size (in bytes) of pending txs before evicting lower priority txs. */
|
|
85
|
+
maxTxPoolSize: number;
|
|
86
|
+
/** If the pool is full, it will still accept a few more txs until it reached maxTxPoolOverspillFactor * maxTxPoolSize. Then it will evict */
|
|
87
|
+
txPoolOverflowFactor: number;
|
|
88
|
+
/** The node's seen message ID cache size */
|
|
89
|
+
seenMessageCacheSize: number;
|
|
90
|
+
/** True to disable the status handshake on peer connected. */
|
|
91
|
+
p2pDisableStatusHandshake?: boolean;
|
|
92
|
+
/** True to only permit validators to connect */
|
|
93
|
+
p2pAllowOnlyValidators?: boolean;
|
|
94
|
+
/** True to disable participating in discovery */
|
|
95
|
+
p2pDiscoveryDisabled?: boolean;
|
|
96
|
+
/** Number of auth attempts to allow before peer is banned. Number is inclusive*/
|
|
97
|
+
p2pMaxFailedAuthAttemptsAllowed: number;
|
|
98
|
+
/** Whether transactions are disabled for this node. This means transactions will be rejected at the RPC and P2P layers. */
|
|
99
|
+
disableTransactions: boolean;
|
|
100
|
+
/** True to simulate discarding transactions. - For testing purposes only*/
|
|
101
|
+
dropTransactions: boolean;
|
|
102
|
+
/** The probability that a transaction is discarded. - For testing purposes only */
|
|
103
|
+
dropTransactionsProbability: number;
|
|
104
|
+
/** Whether to delete transactions from the pool after a reorg instead of moving them back to pending. */
|
|
105
|
+
txPoolDeleteTxsAfterReorg: boolean;
|
|
127
106
|
}
|
|
107
|
+
export declare const DEFAULT_P2P_PORT = 40400;
|
|
128
108
|
export declare const p2pConfigMappings: ConfigMappingsType<P2PConfig>;
|
|
129
109
|
/**
|
|
130
110
|
* Gets the config values for p2p client from environment variables.
|
|
@@ -135,33 +115,44 @@ export declare function getP2PDefaultConfig(): P2PConfig;
|
|
|
135
115
|
/**
|
|
136
116
|
* Required P2P config values for a bootstrap node.
|
|
137
117
|
*/
|
|
138
|
-
export type BootnodeConfig = Pick<P2PConfig, '
|
|
118
|
+
export type BootnodeConfig = Pick<P2PConfig, 'p2pIp' | 'p2pPort' | 'p2pBroadcastPort' | 'peerIdPrivateKey' | 'peerIdPrivateKeyPath' | 'bootstrapNodes' | 'listenAddress' | 'queryForIp'> & Required<Pick<P2PConfig, 'p2pIp' | 'p2pPort'>> & Pick<DataStoreConfig, 'dataDirectory' | 'dataStoreMapSizeKb'> & Pick<ChainConfig, 'l1ChainId'>;
|
|
139
119
|
export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
140
120
|
l1ChainId: unknown;
|
|
141
|
-
|
|
121
|
+
rollupVersion: unknown;
|
|
142
122
|
l1Contracts: unknown;
|
|
143
123
|
dataDirectory: unknown;
|
|
144
|
-
|
|
124
|
+
dataStoreMapSizeKb: unknown;
|
|
145
125
|
overallRequestTimeoutMs: unknown;
|
|
146
126
|
individualRequestTimeoutMs: unknown;
|
|
127
|
+
p2pOptimisticNegotiation: unknown;
|
|
128
|
+
dialTimeoutMs: unknown;
|
|
129
|
+
txCollectionFastNodesTimeoutBeforeReqRespMs: unknown;
|
|
130
|
+
txCollectionSlowNodesIntervalMs: unknown;
|
|
131
|
+
txCollectionSlowReqRespIntervalMs: unknown;
|
|
132
|
+
txCollectionSlowReqRespTimeoutMs: unknown;
|
|
133
|
+
txCollectionReconcileIntervalMs: unknown;
|
|
134
|
+
txCollectionDisableSlowDuringFastRequests: unknown;
|
|
135
|
+
txCollectionFastNodeIntervalMs: unknown;
|
|
136
|
+
txCollectionNodeRpcUrls: unknown;
|
|
137
|
+
txCollectionFastMaxParallelRequestsPerNode: unknown;
|
|
138
|
+
txCollectionNodeRpcMaxBatchSize: unknown;
|
|
147
139
|
p2pEnabled: unknown;
|
|
148
140
|
blockCheckIntervalMS: unknown;
|
|
149
141
|
blockRequestBatchSize: unknown;
|
|
150
142
|
debugDisableColocationPenalty: unknown;
|
|
151
143
|
peerCheckIntervalMS: unknown;
|
|
152
144
|
l2QueueSize: unknown;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
145
|
+
p2pPort: unknown;
|
|
146
|
+
p2pBroadcastPort: unknown;
|
|
147
|
+
p2pIp: unknown;
|
|
148
|
+
listenAddress: unknown;
|
|
157
149
|
peerIdPrivateKey: unknown;
|
|
150
|
+
peerIdPrivateKeyPath: unknown;
|
|
158
151
|
bootstrapNodes: unknown;
|
|
159
152
|
bootstrapNodeEnrVersionCheck: unknown;
|
|
160
153
|
bootstrapNodesAsFullPeers: unknown;
|
|
161
154
|
maxPeerCount: unknown;
|
|
162
155
|
queryForIp: unknown;
|
|
163
|
-
keepProvenTxsInPoolFor: unknown;
|
|
164
|
-
keepAttestationsInPoolFor: unknown;
|
|
165
156
|
gossipsubInterval: unknown;
|
|
166
157
|
gossipsubD: unknown;
|
|
167
158
|
gossipsubDlo: unknown;
|
|
@@ -170,11 +161,40 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
|
|
|
170
161
|
gossipsubFloodPublish: unknown;
|
|
171
162
|
gossipsubMcacheLength: unknown;
|
|
172
163
|
gossipsubMcacheGossip: unknown;
|
|
164
|
+
gossipsubSeenTTL: unknown;
|
|
173
165
|
doubleSpendSeverePeerPenaltyWindow: unknown;
|
|
174
166
|
gossipsubTxTopicWeight: unknown;
|
|
175
167
|
gossipsubTxInvalidMessageDeliveriesWeight: unknown;
|
|
176
168
|
gossipsubTxInvalidMessageDeliveriesDecay: unknown;
|
|
177
169
|
peerPenaltyValues: unknown;
|
|
178
170
|
archivedTxLimit: unknown;
|
|
179
|
-
|
|
171
|
+
trustedPeers: unknown;
|
|
172
|
+
privatePeers: unknown;
|
|
173
|
+
preferredPeers: unknown;
|
|
174
|
+
p2pStoreMapSizeKb: unknown;
|
|
175
|
+
txPublicSetupAllowList: unknown;
|
|
176
|
+
maxTxPoolSize: unknown;
|
|
177
|
+
txPoolOverflowFactor: unknown;
|
|
178
|
+
seenMessageCacheSize: unknown;
|
|
179
|
+
p2pDisableStatusHandshake: unknown;
|
|
180
|
+
p2pAllowOnlyValidators: unknown;
|
|
181
|
+
p2pDiscoveryDisabled: unknown;
|
|
182
|
+
p2pMaxFailedAuthAttemptsAllowed: unknown;
|
|
183
|
+
disableTransactions: unknown;
|
|
184
|
+
dropTransactions: unknown;
|
|
185
|
+
dropTransactionsProbability: unknown;
|
|
186
|
+
txPoolDeleteTxsAfterReorg: unknown;
|
|
187
|
+
}, "p2pPort" | "p2pBroadcastPort" | "p2pIp" | "listenAddress" | "peerIdPrivateKey" | "peerIdPrivateKeyPath" | "bootstrapNodes" | "queryForIp" | "l1ChainId" | "dataDirectory" | "dataStoreMapSizeKb">>;
|
|
188
|
+
/**
|
|
189
|
+
* Parses a string to a list of allowed elements.
|
|
190
|
+
* Each encoded is expected to be of one of the following formats
|
|
191
|
+
* `I:${address}`
|
|
192
|
+
* `I:${address}:${selector}`
|
|
193
|
+
* `C:${classId}`
|
|
194
|
+
* `C:${classId}:${selector}`
|
|
195
|
+
*
|
|
196
|
+
* @param value The string to parse
|
|
197
|
+
* @returns A list of allowed elements
|
|
198
|
+
*/
|
|
199
|
+
export declare function parseAllowList(value: string): AllowedElement[];
|
|
180
200
|
//# sourceMappingURL=config.d.ts.map
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"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"}
|
package/dest/config.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import { booleanConfigHelper, getConfigFromMappings, getDefaultConfig, numberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
|
|
1
|
+
import { booleanConfigHelper, floatConfigHelper, getConfigFromMappings, getDefaultConfig, numberConfigHelper, pickConfigMappings, secretStringConfigHelper } from '@aztec/foundation/config';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
4
|
+
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
6
|
import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
4
7
|
import { p2pReqRespConfigMappings } from './services/reqresp/config.js';
|
|
8
|
+
import { txCollectionConfigMappings } from './services/tx_collection/config.js';
|
|
9
|
+
export const DEFAULT_P2P_PORT = 40400;
|
|
5
10
|
export const p2pConfigMappings = {
|
|
6
11
|
p2pEnabled: {
|
|
7
12
|
env: 'P2P_ENABLED',
|
|
8
13
|
description: 'A flag dictating whether the P2P subsystem should be enabled.',
|
|
9
14
|
...booleanConfigHelper()
|
|
10
15
|
},
|
|
16
|
+
p2pDiscoveryDisabled: {
|
|
17
|
+
env: 'P2P_DISCOVERY_DISABLED',
|
|
18
|
+
description: 'A flag dictating whether the P2P discovery system should be disabled.',
|
|
19
|
+
...booleanConfigHelper(false)
|
|
20
|
+
},
|
|
11
21
|
blockCheckIntervalMS: {
|
|
12
22
|
env: 'P2P_BLOCK_CHECK_INTERVAL_MS',
|
|
13
23
|
description: 'The frequency in which to check for new L2 blocks.',
|
|
@@ -28,32 +38,38 @@ export const p2pConfigMappings = {
|
|
|
28
38
|
description: 'Size of queue of L2 blocks to store.',
|
|
29
39
|
...numberConfigHelper(1_000)
|
|
30
40
|
},
|
|
31
|
-
|
|
32
|
-
env: '
|
|
33
|
-
defaultValue: '0.0.0.0
|
|
34
|
-
description: 'The listen address
|
|
41
|
+
listenAddress: {
|
|
42
|
+
env: 'P2P_LISTEN_ADDR',
|
|
43
|
+
defaultValue: '0.0.0.0',
|
|
44
|
+
description: 'The listen address. ipv4 address.'
|
|
35
45
|
},
|
|
36
|
-
|
|
37
|
-
env: '
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
p2pPort: {
|
|
47
|
+
env: 'P2P_PORT',
|
|
48
|
+
description: `The port for the P2P service. Defaults to ${DEFAULT_P2P_PORT}`,
|
|
49
|
+
...numberConfigHelper(DEFAULT_P2P_PORT)
|
|
40
50
|
},
|
|
41
|
-
|
|
42
|
-
env: '
|
|
43
|
-
description:
|
|
51
|
+
p2pBroadcastPort: {
|
|
52
|
+
env: 'P2P_BROADCAST_PORT',
|
|
53
|
+
description: `The port to broadcast the P2P service on (included in the node's ENR). Defaults to P2P_PORT.`
|
|
44
54
|
},
|
|
45
|
-
|
|
46
|
-
env: '
|
|
47
|
-
description: 'The
|
|
55
|
+
p2pIp: {
|
|
56
|
+
env: 'P2P_IP',
|
|
57
|
+
description: 'The IP address for the P2P service. ipv4 address.'
|
|
48
58
|
},
|
|
49
59
|
peerIdPrivateKey: {
|
|
50
60
|
env: 'PEER_ID_PRIVATE_KEY',
|
|
51
|
-
description: 'An optional peer id private key. If blank, will generate a random key.'
|
|
61
|
+
description: 'An optional peer id private key. If blank, will generate a random key.',
|
|
62
|
+
...secretStringConfigHelper()
|
|
63
|
+
},
|
|
64
|
+
peerIdPrivateKeyPath: {
|
|
65
|
+
env: 'PEER_ID_PRIVATE_KEY_PATH',
|
|
66
|
+
description: 'An optional path to store generated peer id private keys. If blank, will default to storing any generated keys in the root of the data directory.'
|
|
52
67
|
},
|
|
53
68
|
bootstrapNodes: {
|
|
54
69
|
env: 'BOOTSTRAP_NODES',
|
|
55
70
|
parseEnv: (val)=>val.split(','),
|
|
56
|
-
description: 'A list of bootstrap peer ENRs to connect to. Separated by commas.'
|
|
71
|
+
description: 'A list of bootstrap peer ENRs to connect to. Separated by commas.',
|
|
72
|
+
defaultValue: []
|
|
57
73
|
},
|
|
58
74
|
bootstrapNodeEnrVersionCheck: {
|
|
59
75
|
env: 'P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK',
|
|
@@ -75,16 +91,6 @@ export const p2pConfigMappings = {
|
|
|
75
91
|
description: 'If announceUdpAddress or announceTcpAddress are not provided, query for the IP address of the machine. Default is false.',
|
|
76
92
|
...booleanConfigHelper()
|
|
77
93
|
},
|
|
78
|
-
keepProvenTxsInPoolFor: {
|
|
79
|
-
env: 'P2P_TX_POOL_KEEP_PROVEN_FOR',
|
|
80
|
-
description: 'How many blocks have to pass after a block is proven before its txs are deleted (zero to delete immediately once proven)',
|
|
81
|
-
...numberConfigHelper(0)
|
|
82
|
-
},
|
|
83
|
-
keepAttestationsInPoolFor: {
|
|
84
|
-
env: 'P2P_ATTESTATION_POOL_KEEP_FOR',
|
|
85
|
-
description: 'How many slots to keep attestations for.',
|
|
86
|
-
...numberConfigHelper(96)
|
|
87
|
-
},
|
|
88
94
|
gossipsubInterval: {
|
|
89
95
|
env: 'P2P_GOSSIPSUB_INTERVAL_MS',
|
|
90
96
|
description: 'The interval of the gossipsub heartbeat to perform maintenance tasks.',
|
|
@@ -113,7 +119,7 @@ export const p2pConfigMappings = {
|
|
|
113
119
|
gossipsubFloodPublish: {
|
|
114
120
|
env: 'P2P_GOSSIPSUB_FLOOD_PUBLISH',
|
|
115
121
|
description: 'Whether to flood publish messages. - For testing purposes only',
|
|
116
|
-
...booleanConfigHelper(
|
|
122
|
+
...booleanConfigHelper(false)
|
|
117
123
|
},
|
|
118
124
|
gossipsubMcacheLength: {
|
|
119
125
|
env: 'P2P_GOSSIPSUB_MCACHE_LENGTH',
|
|
@@ -122,9 +128,14 @@ export const p2pConfigMappings = {
|
|
|
122
128
|
},
|
|
123
129
|
gossipsubMcacheGossip: {
|
|
124
130
|
env: 'P2P_GOSSIPSUB_MCACHE_GOSSIP',
|
|
125
|
-
description: 'How many message cache windows to include when gossiping with other
|
|
131
|
+
description: 'How many message cache windows to include when gossiping with other peers.',
|
|
126
132
|
...numberConfigHelper(3)
|
|
127
133
|
},
|
|
134
|
+
gossipsubSeenTTL: {
|
|
135
|
+
env: 'P2P_GOSSIPSUB_SEEN_TTL',
|
|
136
|
+
description: 'How long to keep message IDs in the seen cache.',
|
|
137
|
+
...numberConfigHelper(20 * 60 * 1000)
|
|
138
|
+
},
|
|
128
139
|
gossipsubTxTopicWeight: {
|
|
129
140
|
env: 'P2P_GOSSIPSUB_TX_TOPIC_WEIGHT',
|
|
130
141
|
description: 'The weight of the tx topic for the gossipsub protocol.',
|
|
@@ -165,8 +176,88 @@ export const p2pConfigMappings = {
|
|
|
165
176
|
description: 'The number of transactions that will be archived. If the limit is set to 0 then archiving will be disabled.',
|
|
166
177
|
...numberConfigHelper(0)
|
|
167
178
|
},
|
|
179
|
+
trustedPeers: {
|
|
180
|
+
env: 'P2P_TRUSTED_PEERS',
|
|
181
|
+
parseEnv: (val)=>val.split(','),
|
|
182
|
+
description: 'A list of trusted peer ENRs that will always be persisted. Separated by commas.',
|
|
183
|
+
defaultValue: []
|
|
184
|
+
},
|
|
185
|
+
privatePeers: {
|
|
186
|
+
env: 'P2P_PRIVATE_PEERS',
|
|
187
|
+
parseEnv: (val)=>val.split(','),
|
|
188
|
+
description: 'A list of private peer ENRs that will always be persisted and not be used for discovery. Separated by commas.',
|
|
189
|
+
defaultValue: []
|
|
190
|
+
},
|
|
191
|
+
preferredPeers: {
|
|
192
|
+
env: 'P2P_PREFERRED_PEERS',
|
|
193
|
+
parseEnv: (val)=>val.split(','),
|
|
194
|
+
description: 'A list of preferred peer ENRs that will always be persisted and not be used for discovery. Separated by commas.',
|
|
195
|
+
defaultValue: []
|
|
196
|
+
},
|
|
197
|
+
p2pStoreMapSizeKb: {
|
|
198
|
+
env: 'P2P_STORE_MAP_SIZE_KB',
|
|
199
|
+
parseEnv: (val)=>val ? +val : undefined,
|
|
200
|
+
description: 'The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb.'
|
|
201
|
+
},
|
|
202
|
+
txPublicSetupAllowList: {
|
|
203
|
+
env: 'TX_PUBLIC_SETUP_ALLOWLIST',
|
|
204
|
+
parseEnv: (val)=>parseAllowList(val),
|
|
205
|
+
description: 'The list of functions calls allowed to run in setup',
|
|
206
|
+
printDefault: ()=>'AuthRegistry, FeeJuice.increase_public_balance, Token.increase_public_balance, FPC.prepare_fee'
|
|
207
|
+
},
|
|
208
|
+
maxTxPoolSize: {
|
|
209
|
+
env: 'P2P_MAX_TX_POOL_SIZE',
|
|
210
|
+
description: 'The maximum cumulative tx size of pending txs (in bytes) before evicting lower priority txs.',
|
|
211
|
+
...numberConfigHelper(100_000_000)
|
|
212
|
+
},
|
|
213
|
+
txPoolOverflowFactor: {
|
|
214
|
+
env: 'P2P_TX_POOL_OVERFLOW_FACTOR',
|
|
215
|
+
description: 'How much the tx pool can overflow before it starts evicting txs. Must be greater than 1',
|
|
216
|
+
...floatConfigHelper(1.1)
|
|
217
|
+
},
|
|
218
|
+
seenMessageCacheSize: {
|
|
219
|
+
env: 'P2P_SEEN_MSG_CACHE_SIZE',
|
|
220
|
+
description: 'The number of messages to keep in the seen message cache',
|
|
221
|
+
...numberConfigHelper(100_000)
|
|
222
|
+
},
|
|
223
|
+
p2pDisableStatusHandshake: {
|
|
224
|
+
env: 'P2P_DISABLE_STATUS_HANDSHAKE',
|
|
225
|
+
description: 'True to disable the status handshake on peer connected.',
|
|
226
|
+
...booleanConfigHelper(false)
|
|
227
|
+
},
|
|
228
|
+
p2pAllowOnlyValidators: {
|
|
229
|
+
env: 'P2P_ALLOW_ONLY_VALIDATORS',
|
|
230
|
+
description: 'True to only permit validators to connect.',
|
|
231
|
+
...booleanConfigHelper(false)
|
|
232
|
+
},
|
|
233
|
+
p2pMaxFailedAuthAttemptsAllowed: {
|
|
234
|
+
env: 'P2P_MAX_AUTH_FAILED_ATTEMPTS_ALLOWED',
|
|
235
|
+
description: 'Number of auth attempts to allow before peer is banned. Number is inclusive',
|
|
236
|
+
...numberConfigHelper(3)
|
|
237
|
+
},
|
|
238
|
+
dropTransactions: {
|
|
239
|
+
env: 'P2P_DROP_TX',
|
|
240
|
+
description: 'True to simulate discarding transactions. - For testing purposes only',
|
|
241
|
+
...booleanConfigHelper(false)
|
|
242
|
+
},
|
|
243
|
+
dropTransactionsProbability: {
|
|
244
|
+
env: 'P2P_DROP_TX_CHANCE',
|
|
245
|
+
description: 'The probability that a transaction is discarded. - For testing purposes only',
|
|
246
|
+
...floatConfigHelper(0)
|
|
247
|
+
},
|
|
248
|
+
disableTransactions: {
|
|
249
|
+
env: 'TRANSACTIONS_DISABLED',
|
|
250
|
+
description: 'Whether transactions are disabled for this node. This means transactions will be rejected at the RPC and P2P layers.',
|
|
251
|
+
...booleanConfigHelper(false)
|
|
252
|
+
},
|
|
253
|
+
txPoolDeleteTxsAfterReorg: {
|
|
254
|
+
env: 'P2P_TX_POOL_DELETE_TXS_AFTER_REORG',
|
|
255
|
+
description: 'Whether to delete transactions from the pool after a reorg instead of moving them back to pending.',
|
|
256
|
+
...booleanConfigHelper(false)
|
|
257
|
+
},
|
|
168
258
|
...p2pReqRespConfigMappings,
|
|
169
|
-
...chainConfigMappings
|
|
259
|
+
...chainConfigMappings,
|
|
260
|
+
...txCollectionConfigMappings
|
|
170
261
|
};
|
|
171
262
|
/**
|
|
172
263
|
* Gets the config values for p2p client from environment variables.
|
|
@@ -178,16 +269,64 @@ export function getP2PDefaultConfig() {
|
|
|
178
269
|
return getDefaultConfig(p2pConfigMappings);
|
|
179
270
|
}
|
|
180
271
|
const bootnodeConfigKeys = [
|
|
181
|
-
'
|
|
272
|
+
'p2pIp',
|
|
273
|
+
'p2pPort',
|
|
274
|
+
'p2pBroadcastPort',
|
|
275
|
+
'listenAddress',
|
|
182
276
|
'peerIdPrivateKey',
|
|
183
|
-
'
|
|
277
|
+
'peerIdPrivateKeyPath',
|
|
184
278
|
'dataDirectory',
|
|
185
|
-
'
|
|
279
|
+
'dataStoreMapSizeKb',
|
|
186
280
|
'bootstrapNodes',
|
|
187
|
-
'l1ChainId'
|
|
281
|
+
'l1ChainId',
|
|
282
|
+
'queryForIp'
|
|
188
283
|
];
|
|
189
284
|
export const bootnodeConfigMappings = pickConfigMappings({
|
|
190
285
|
...p2pConfigMappings,
|
|
191
286
|
...dataConfigMappings,
|
|
192
287
|
...chainConfigMappings
|
|
193
288
|
}, bootnodeConfigKeys);
|
|
289
|
+
/**
|
|
290
|
+
* Parses a string to a list of allowed elements.
|
|
291
|
+
* Each encoded is expected to be of one of the following formats
|
|
292
|
+
* `I:${address}`
|
|
293
|
+
* `I:${address}:${selector}`
|
|
294
|
+
* `C:${classId}`
|
|
295
|
+
* `C:${classId}:${selector}`
|
|
296
|
+
*
|
|
297
|
+
* @param value The string to parse
|
|
298
|
+
* @returns A list of allowed elements
|
|
299
|
+
*/ export function parseAllowList(value) {
|
|
300
|
+
const entries = [];
|
|
301
|
+
if (!value) {
|
|
302
|
+
return entries;
|
|
303
|
+
}
|
|
304
|
+
for (const val of value.split(',')){
|
|
305
|
+
const [typeString, identifierString, selectorString] = val.split(':');
|
|
306
|
+
const selector = selectorString !== undefined ? FunctionSelector.fromString(selectorString) : undefined;
|
|
307
|
+
if (typeString === 'I') {
|
|
308
|
+
if (selector) {
|
|
309
|
+
entries.push({
|
|
310
|
+
address: AztecAddress.fromString(identifierString),
|
|
311
|
+
selector
|
|
312
|
+
});
|
|
313
|
+
} else {
|
|
314
|
+
entries.push({
|
|
315
|
+
address: AztecAddress.fromString(identifierString)
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
} else if (typeString === 'C') {
|
|
319
|
+
if (selector) {
|
|
320
|
+
entries.push({
|
|
321
|
+
classId: Fr.fromHexString(identifierString),
|
|
322
|
+
selector
|
|
323
|
+
});
|
|
324
|
+
} else {
|
|
325
|
+
entries.push({
|
|
326
|
+
classId: Fr.fromHexString(identifierString)
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return entries;
|
|
332
|
+
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
import {
|
|
2
|
+
import { type ChainConfig } from '@aztec/stdlib/config';
|
|
3
|
+
import type { ComponentsVersions } from '@aztec/stdlib/versioning';
|
|
3
4
|
import type { PeerId } from '@libp2p/interface';
|
|
4
|
-
|
|
5
|
+
import { type Multiaddr } from '@multiformats/multiaddr';
|
|
6
|
+
import { ENR, SignableENR } from '@nethermindeth/enr';
|
|
7
|
+
export { ENR };
|
|
8
|
+
export declare function createBootnodeENRandPeerId(privateKey: string, p2pIp: string, p2pBroadcastPort: number, l1ChainId: number): Promise<{
|
|
5
9
|
enr: SignableENR;
|
|
6
10
|
peerId: PeerId;
|
|
7
11
|
}>;
|
|
12
|
+
export declare function createNodeENR(peerId: PeerId, multiAddrUdp: Multiaddr | undefined, multiAddrTcp: Multiaddr | undefined, chainConfig: ChainConfig, packageVersion: string): {
|
|
13
|
+
enr: SignableENR;
|
|
14
|
+
versions: ComponentsVersions;
|
|
15
|
+
};
|
|
8
16
|
export declare function printENR(enr: string, log: LogFn): Promise<void>;
|
|
9
17
|
//# sourceMappingURL=generate-enr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-enr.d.ts","sourceRoot":"","sources":["../../src/enr/generate-enr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-enr.d.ts","sourceRoot":"","sources":["../../src/enr/generate-enr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMtD,OAAO,EAAE,GAAG,EAAE,CAAC;AAEf,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAa/C;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,SAAS,GAAG,SAAS,EACnC,YAAY,EAAE,SAAS,GAAG,SAAS,EACnC,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,MAAM,GACrB;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAA;CAAE,CAiBpD;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAYrD"}
|