@aztec/p2p 0.0.1-commit.d431d1c → 0.0.1-commit.dbf9cec
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 +4 -3
- package/dest/bootstrap/bootstrap.d.ts.map +1 -1
- package/dest/bootstrap/bootstrap.js +4 -4
- package/dest/client/factory.d.ts +10 -10
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +45 -18
- package/dest/client/interface.d.ts +46 -33
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +41 -51
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +156 -200
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts +2 -0
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts.map +1 -0
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +304 -0
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts +73 -0
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts.map +1 -0
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.js +8 -0
- package/dest/config.d.ts +35 -7
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +21 -7
- package/dest/errors/tx-pool.error.d.ts +8 -0
- package/dest/errors/tx-pool.error.d.ts.map +1 -0
- package/dest/errors/tx-pool.error.js +9 -0
- package/dest/index.d.ts +2 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -0
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +104 -88
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +441 -3
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +2 -2
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +353 -87
- package/dest/mem_pools/attestation_pool/index.d.ts +2 -3
- package/dest/mem_pools/attestation_pool/index.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/index.js +1 -2
- package/dest/mem_pools/attestation_pool/mocks.d.ts +2 -2
- package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/mocks.js +2 -2
- package/dest/mem_pools/index.d.ts +3 -2
- package/dest/mem_pools/index.d.ts.map +1 -1
- package/dest/mem_pools/index.js +1 -1
- package/dest/mem_pools/instrumentation.d.ts +1 -1
- package/dest/mem_pools/instrumentation.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.js +2 -2
- package/dest/mem_pools/interface.d.ts +5 -5
- package/dest/mem_pools/interface.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +3 -3
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts +3 -2
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts +3 -2
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts +3 -3
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.js +8 -1
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.js +3 -3
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts +3 -3
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.js +2 -0
- package/dest/mem_pools/tx_pool_v2/archive/index.d.ts +2 -0
- package/dest/mem_pools/tx_pool_v2/archive/index.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/archive/index.js +1 -0
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts +43 -0
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/archive/tx_archive.js +103 -0
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +104 -0
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/deleted_pool.js +251 -0
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts +47 -0
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.js +128 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +17 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +93 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +19 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +97 -0
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +10 -0
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/index.js +11 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +174 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.js +25 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts +15 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.js +65 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts +17 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +93 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +16 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +78 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +20 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +73 -0
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +15 -0
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +19 -0
- package/dest/mem_pools/tx_pool_v2/index.d.ts +6 -0
- package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/index.js +5 -0
- package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts +15 -0
- package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/instrumentation.js +43 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +211 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/interfaces.js +9 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +119 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +193 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts +26 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.js +70 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +108 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +354 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +60 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +161 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +77 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +905 -0
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +3 -3
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/attestation_validator.js +40 -9
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +5 -5
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.js +18 -6
- package/dest/msg_validators/clock_tolerance.d.ts +21 -0
- package/dest/msg_validators/clock_tolerance.d.ts.map +1 -0
- package/dest/msg_validators/clock_tolerance.js +37 -0
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +3 -3
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator.js +46 -15
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +3 -3
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +66 -11
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +4 -4
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +3 -3
- package/dest/msg_validators/tx_validator/archive_cache.d.ts +3 -3
- package/dest/msg_validators/tx_validator/archive_cache.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/archive_cache.js +1 -1
- package/dest/msg_validators/tx_validator/block_header_validator.d.ts +20 -6
- 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 -3
- package/dest/msg_validators/tx_validator/data_validator.d.ts +3 -1
- package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/data_validator.js +4 -1
- package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +15 -4
- package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/double_spend_validator.js +7 -6
- package/dest/msg_validators/tx_validator/factory.d.ts +118 -5
- package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/factory.js +228 -57
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +59 -3
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.js +76 -38
- package/dest/msg_validators/tx_validator/index.d.ts +2 -1
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +1 -0
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts +3 -2
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.js +2 -2
- package/dest/msg_validators/tx_validator/nullifier_cache.d.ts +14 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/nullifier_cache.js +24 -0
- package/dest/msg_validators/tx_validator/phases_validator.d.ts +3 -2
- package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/phases_validator.js +3 -3
- package/dest/msg_validators/tx_validator/size_validator.d.ts +3 -1
- package/dest/msg_validators/tx_validator/size_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/size_validator.js +4 -1
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +22 -5
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/timestamp_validator.js +8 -8
- package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts +3 -2
- package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/tx_permitted_validator.js +2 -2
- package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts +3 -2
- 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 -2
- 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 +10 -6
- package/dest/services/discv5/discV5_service.js +1 -1
- package/dest/services/dummy_service.d.ts +24 -4
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +46 -1
- package/dest/services/encoding.d.ts +3 -3
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +11 -10
- package/dest/services/gossipsub/index.d.ts +3 -0
- package/dest/services/gossipsub/index.d.ts.map +1 -0
- package/dest/services/gossipsub/index.js +2 -0
- package/dest/services/gossipsub/scoring.d.ts +21 -3
- package/dest/services/gossipsub/scoring.d.ts.map +1 -1
- package/dest/services/gossipsub/scoring.js +24 -7
- package/dest/services/gossipsub/topic_score_params.d.ts +173 -0
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -0
- package/dest/services/gossipsub/topic_score_params.js +346 -0
- package/dest/services/index.d.ts +2 -1
- package/dest/services/index.d.ts.map +1 -1
- package/dest/services/index.js +1 -0
- package/dest/services/libp2p/instrumentation.d.ts +1 -1
- package/dest/services/libp2p/instrumentation.d.ts.map +1 -1
- package/dest/services/libp2p/instrumentation.js +14 -3
- package/dest/services/libp2p/libp2p_service.d.ts +101 -43
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +455 -363
- package/dest/services/peer-manager/metrics.d.ts +2 -2
- package/dest/services/peer-manager/metrics.d.ts.map +1 -1
- package/dest/services/peer-manager/metrics.js +20 -5
- package/dest/services/peer-manager/peer_scoring.d.ts +1 -1
- package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_scoring.js +33 -4
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +48 -0
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -0
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +539 -0
- package/dest/services/reqresp/batch-tx-requester/config.d.ts +17 -0
- package/dest/services/reqresp/batch-tx-requester/config.d.ts.map +1 -0
- package/dest/services/reqresp/batch-tx-requester/config.js +27 -0
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts +46 -0
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -0
- package/dest/services/reqresp/batch-tx-requester/interface.js +1 -0
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +34 -0
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -0
- package/dest/services/reqresp/batch-tx-requester/missing_txs.js +130 -0
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +60 -0
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -0
- package/dest/services/reqresp/batch-tx-requester/peer_collection.js +173 -0
- package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts +20 -0
- package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts.map +1 -0
- package/dest/services/reqresp/batch-tx-requester/tx_validator.js +21 -0
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts +22 -3
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts.map +1 -1
- package/dest/services/reqresp/connection-sampler/batch_connection_sampler.js +63 -4
- package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts +2 -1
- package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts.map +1 -1
- package/dest/services/reqresp/connection-sampler/connection_sampler.js +12 -0
- package/dest/services/reqresp/interface.d.ts +14 -3
- package/dest/services/reqresp/interface.d.ts.map +1 -1
- package/dest/services/reqresp/interface.js +17 -3
- package/dest/services/reqresp/metrics.d.ts +6 -5
- package/dest/services/reqresp/metrics.d.ts.map +1 -1
- package/dest/services/reqresp/metrics.js +17 -5
- package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts +5 -1
- package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block_txs/bitvector.js +5 -0
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +7 -5
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.js +27 -9
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +29 -6
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +59 -13
- package/dest/services/reqresp/protocols/tx.d.ts +7 -1
- package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/tx.js +20 -0
- package/dest/services/reqresp/reqresp.d.ts +6 -1
- package/dest/services/reqresp/reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/reqresp.js +71 -27
- package/dest/services/service.d.ts +42 -3
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/config.d.ts +22 -1
- package/dest/services/tx_collection/config.d.ts.map +1 -1
- package/dest/services/tx_collection/config.js +55 -1
- package/dest/services/tx_collection/fast_tx_collection.d.ts +7 -4
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.js +71 -44
- package/dest/services/tx_collection/file_store_tx_collection.d.ts +53 -0
- package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -0
- package/dest/services/tx_collection/file_store_tx_collection.js +167 -0
- package/dest/services/tx_collection/file_store_tx_source.d.ts +37 -0
- package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -0
- package/dest/services/tx_collection/file_store_tx_source.js +90 -0
- package/dest/services/tx_collection/index.d.ts +3 -1
- package/dest/services/tx_collection/index.d.ts.map +1 -1
- package/dest/services/tx_collection/index.js +2 -0
- package/dest/services/tx_collection/instrumentation.d.ts +1 -1
- package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
- package/dest/services/tx_collection/instrumentation.js +10 -2
- package/dest/services/tx_collection/missing_txs_tracker.d.ts +32 -0
- package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +1 -0
- package/dest/services/tx_collection/missing_txs_tracker.js +27 -0
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +49 -0
- package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -0
- package/dest/services/tx_collection/proposal_tx_collector.js +50 -0
- package/dest/services/tx_collection/slow_tx_collection.d.ts +9 -5
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/slow_tx_collection.js +60 -26
- package/dest/services/tx_collection/tx_collection.d.ts +29 -16
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection.js +79 -7
- package/dest/services/tx_collection/tx_collection_sink.d.ts +18 -8
- package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection_sink.js +26 -29
- package/dest/services/tx_collection/tx_source.d.ts +8 -3
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_source.js +19 -2
- package/dest/services/tx_file_store/config.d.ts +16 -0
- package/dest/services/tx_file_store/config.d.ts.map +1 -0
- package/dest/services/tx_file_store/config.js +22 -0
- package/dest/services/tx_file_store/index.d.ts +4 -0
- package/dest/services/tx_file_store/index.d.ts.map +1 -0
- package/dest/services/tx_file_store/index.js +3 -0
- package/dest/services/tx_file_store/instrumentation.d.ts +15 -0
- package/dest/services/tx_file_store/instrumentation.d.ts.map +1 -0
- package/dest/services/tx_file_store/instrumentation.js +29 -0
- package/dest/services/tx_file_store/tx_file_store.d.ts +48 -0
- package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -0
- package/dest/services/tx_file_store/tx_file_store.js +152 -0
- package/dest/services/tx_provider.d.ts +6 -6
- package/dest/services/tx_provider.d.ts.map +1 -1
- package/dest/services/tx_provider.js +9 -8
- package/dest/services/tx_provider_instrumentation.d.ts +1 -1
- package/dest/services/tx_provider_instrumentation.d.ts.map +1 -1
- package/dest/services/tx_provider_instrumentation.js +5 -5
- package/dest/test-helpers/index.d.ts +3 -1
- package/dest/test-helpers/index.d.ts.map +1 -1
- package/dest/test-helpers/index.js +2 -0
- package/dest/test-helpers/make-test-p2p-clients.d.ts +7 -8
- package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
- package/dest/test-helpers/make-test-p2p-clients.js +1 -2
- package/dest/test-helpers/mock-pubsub.d.ts +30 -4
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +105 -4
- package/dest/test-helpers/reqresp-nodes.d.ts +2 -3
- package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
- package/dest/test-helpers/reqresp-nodes.js +4 -3
- package/dest/test-helpers/test_tx_provider.d.ts +40 -0
- package/dest/test-helpers/test_tx_provider.d.ts.map +1 -0
- package/dest/test-helpers/test_tx_provider.js +41 -0
- package/dest/test-helpers/testbench-utils.d.ts +163 -0
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -0
- package/dest/test-helpers/testbench-utils.js +366 -0
- package/dest/testbench/p2p_client_testbench_worker.d.ts +28 -2
- package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
- package/dest/testbench/p2p_client_testbench_worker.js +219 -137
- package/dest/testbench/worker_client_manager.d.ts +51 -6
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +226 -44
- package/dest/util.d.ts +2 -2
- package/dest/util.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/bootstrap/bootstrap.ts +7 -4
- package/src/client/factory.ts +83 -36
- package/src/client/interface.ts +56 -34
- package/src/client/p2p_client.ts +196 -251
- package/src/client/test/tx_proposal_collector/README.md +227 -0
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +345 -0
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.ts +43 -0
- package/src/config.ts +47 -11
- package/src/errors/tx-pool.error.ts +12 -0
- package/src/index.ts +1 -0
- package/src/mem_pools/attestation_pool/attestation_pool.ts +496 -91
- package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +442 -102
- package/src/mem_pools/attestation_pool/index.ts +9 -2
- package/src/mem_pools/attestation_pool/mocks.ts +2 -1
- package/src/mem_pools/index.ts +4 -1
- package/src/mem_pools/instrumentation.ts +2 -1
- package/src/mem_pools/interface.ts +4 -4
- package/src/mem_pools/tx_pool/README.md +1 -1
- package/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +2 -2
- package/src/mem_pools/tx_pool/eviction/eviction_manager.ts +2 -1
- package/src/mem_pools/tx_pool/eviction/eviction_strategy.ts +2 -1
- package/src/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.ts +10 -7
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +3 -3
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.ts +4 -2
- package/src/mem_pools/tx_pool_v2/README.md +275 -0
- package/src/mem_pools/tx_pool_v2/archive/index.ts +1 -0
- package/src/mem_pools/tx_pool_v2/archive/tx_archive.ts +120 -0
- package/src/mem_pools/tx_pool_v2/deleted_pool.ts +321 -0
- package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +160 -0
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +121 -0
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +125 -0
- package/src/mem_pools/tx_pool_v2/eviction/index.ts +27 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +209 -0
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +74 -0
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +101 -0
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +91 -0
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +90 -0
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +31 -0
- package/src/mem_pools/tx_pool_v2/index.ts +12 -0
- package/src/mem_pools/tx_pool_v2/instrumentation.ts +69 -0
- package/src/mem_pools/tx_pool_v2/interfaces.ts +242 -0
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +297 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_bench_metrics.ts +77 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +444 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +223 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +1083 -0
- package/src/msg_validators/attestation_validator/attestation_validator.ts +25 -13
- package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +16 -10
- package/src/msg_validators/clock_tolerance.ts +51 -0
- package/src/msg_validators/proposal_validator/proposal_validator.ts +21 -14
- package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +53 -14
- package/src/msg_validators/tx_validator/README.md +115 -0
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +5 -5
- package/src/msg_validators/tx_validator/archive_cache.ts +3 -3
- package/src/msg_validators/tx_validator/block_header_validator.ts +21 -8
- package/src/msg_validators/tx_validator/data_validator.ts +6 -2
- package/src/msg_validators/tx_validator/double_spend_validator.ts +15 -9
- package/src/msg_validators/tx_validator/factory.ts +372 -55
- package/src/msg_validators/tx_validator/gas_validator.ts +98 -29
- package/src/msg_validators/tx_validator/index.ts +1 -0
- package/src/msg_validators/tx_validator/metadata_validator.ts +6 -3
- package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
- package/src/msg_validators/tx_validator/phases_validator.ts +5 -3
- package/src/msg_validators/tx_validator/size_validator.ts +6 -2
- package/src/msg_validators/tx_validator/timestamp_validator.ts +29 -21
- package/src/msg_validators/tx_validator/tx_permitted_validator.ts +8 -3
- package/src/msg_validators/tx_validator/tx_proof_validator.ts +8 -3
- package/src/services/data_store.ts +10 -7
- package/src/services/discv5/discV5_service.ts +1 -1
- package/src/services/dummy_service.ts +59 -2
- package/src/services/encoding.ts +9 -9
- package/src/services/gossipsub/README.md +641 -0
- package/src/services/gossipsub/index.ts +2 -0
- package/src/services/gossipsub/scoring.ts +29 -5
- package/src/services/gossipsub/topic_score_params.ts +487 -0
- package/src/services/index.ts +1 -0
- package/src/services/libp2p/instrumentation.ts +15 -2
- package/src/services/libp2p/libp2p_service.ts +505 -396
- package/src/services/peer-manager/metrics.ts +21 -4
- package/src/services/peer-manager/peer_scoring.ts +29 -1
- package/src/services/reqresp/batch-tx-requester/README.md +305 -0
- package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +678 -0
- package/src/services/reqresp/batch-tx-requester/config.ts +40 -0
- package/src/services/reqresp/batch-tx-requester/interface.ts +53 -0
- package/src/services/reqresp/batch-tx-requester/missing_txs.ts +161 -0
- package/src/services/reqresp/batch-tx-requester/peer_collection.ts +244 -0
- package/src/services/reqresp/batch-tx-requester/tx_validator.ts +37 -0
- package/src/services/reqresp/connection-sampler/batch_connection_sampler.ts +65 -4
- package/src/services/reqresp/connection-sampler/connection_sampler.ts +16 -0
- package/src/services/reqresp/interface.ts +31 -3
- package/src/services/reqresp/metrics.ts +34 -9
- package/src/services/reqresp/protocols/block_txs/bitvector.ts +7 -0
- package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +35 -12
- package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +74 -9
- package/src/services/reqresp/protocols/tx.ts +22 -0
- package/src/services/reqresp/reqresp.ts +82 -23
- package/src/services/service.ts +55 -2
- package/src/services/tx_collection/config.ts +83 -1
- package/src/services/tx_collection/fast_tx_collection.ts +93 -47
- package/src/services/tx_collection/file_store_tx_collection.ts +202 -0
- package/src/services/tx_collection/file_store_tx_source.ts +117 -0
- package/src/services/tx_collection/index.ts +6 -0
- package/src/services/tx_collection/instrumentation.ts +17 -2
- package/src/services/tx_collection/missing_txs_tracker.ts +52 -0
- package/src/services/tx_collection/proposal_tx_collector.ts +113 -0
- package/src/services/tx_collection/slow_tx_collection.ts +68 -35
- package/src/services/tx_collection/tx_collection.ts +121 -24
- package/src/services/tx_collection/tx_collection_sink.ts +30 -34
- package/src/services/tx_collection/tx_source.ts +22 -3
- package/src/services/tx_file_store/config.ts +37 -0
- package/src/services/tx_file_store/index.ts +3 -0
- package/src/services/tx_file_store/instrumentation.ts +36 -0
- package/src/services/tx_file_store/tx_file_store.ts +175 -0
- package/src/services/tx_provider.ts +12 -11
- package/src/services/tx_provider_instrumentation.ts +11 -5
- package/src/test-helpers/index.ts +2 -0
- package/src/test-helpers/make-test-p2p-clients.ts +3 -5
- package/src/test-helpers/mock-pubsub.ts +146 -9
- package/src/test-helpers/reqresp-nodes.ts +4 -6
- package/src/test-helpers/test_tx_provider.ts +64 -0
- package/src/test-helpers/testbench-utils.ts +430 -0
- package/src/testbench/p2p_client_testbench_worker.ts +333 -131
- package/src/testbench/worker_client_manager.ts +304 -47
- package/src/util.ts +7 -1
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +0 -40
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +0 -1
- package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +0 -218
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +0 -31
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +0 -1
- package/dest/mem_pools/attestation_pool/memory_attestation_pool.js +0 -180
- package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +0 -320
- package/src/mem_pools/attestation_pool/memory_attestation_pool.ts +0 -264
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
3
|
+
PRIVATE_TX_L2_GAS_OVERHEAD,
|
|
4
|
+
PUBLIC_TX_L2_GAS_OVERHEAD,
|
|
5
|
+
TX_DA_GAS_OVERHEAD,
|
|
6
|
+
} from '@aztec/constants';
|
|
7
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
3
8
|
import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
4
9
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
10
|
import { Gas, GasFees } from '@aztec/stdlib/gas';
|
|
@@ -16,20 +21,106 @@ import {
|
|
|
16
21
|
|
|
17
22
|
import { getFeePayerClaimAmount, getTxFeeLimit } from './fee_payer_balance.js';
|
|
18
23
|
|
|
24
|
+
/** Structural interface for types that carry gas limit data, used by {@link GasLimitsValidator}. */
|
|
25
|
+
export interface HasGasLimitData {
|
|
26
|
+
txHash: { toString(): string };
|
|
27
|
+
data: {
|
|
28
|
+
// We just need to know whether there is something here or not
|
|
29
|
+
forPublic?: unknown;
|
|
30
|
+
constants: {
|
|
31
|
+
txContext: {
|
|
32
|
+
gasSettings: { gasLimits: Gas };
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Validates that a transaction's gas limits are within acceptable bounds.
|
|
40
|
+
*
|
|
41
|
+
* Rejects transactions whose gas limits fall below the fixed minimums (FIXED_DA_GAS,
|
|
42
|
+
* FIXED_L2_GAS) or exceed the AVM's maximum processable L2 gas. This is a cheap,
|
|
43
|
+
* stateless check that operates on gas settings alone.
|
|
44
|
+
*
|
|
45
|
+
* Generic over T so it can validate both full {@link Tx} objects and {@link TxMetaData}
|
|
46
|
+
* (used during pending pool migration).
|
|
47
|
+
*
|
|
48
|
+
* Used by: pending pool migration (via factory), and indirectly by {@link GasTxValidator}.
|
|
49
|
+
*/
|
|
50
|
+
export class GasLimitsValidator<T extends HasGasLimitData> implements TxValidator<T> {
|
|
51
|
+
#log: Logger;
|
|
52
|
+
|
|
53
|
+
constructor(bindings?: LoggerBindings) {
|
|
54
|
+
this.#log = createLogger('sequencer:tx_validator:tx_gas', bindings);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
validateTx(tx: T): Promise<TxValidationResult> {
|
|
58
|
+
return Promise.resolve(this.validateGasLimit(tx));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Checks gas limits are >= fixed minimums and <= AVM max processable L2 gas. */
|
|
62
|
+
validateGasLimit(tx: T): TxValidationResult {
|
|
63
|
+
const gasLimits = tx.data.constants.txContext.gasSettings.gasLimits;
|
|
64
|
+
const minGasLimits = new Gas(
|
|
65
|
+
TX_DA_GAS_OVERHEAD,
|
|
66
|
+
tx.data.forPublic ? PUBLIC_TX_L2_GAS_OVERHEAD : PRIVATE_TX_L2_GAS_OVERHEAD,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (minGasLimits.gtAny(gasLimits)) {
|
|
70
|
+
this.#log.verbose(`Rejecting transaction due to the gas limit(s) not being above the minimum gas limit`, {
|
|
71
|
+
gasLimits,
|
|
72
|
+
minGasLimits,
|
|
73
|
+
});
|
|
74
|
+
return { result: 'invalid', reason: [TX_ERROR_INSUFFICIENT_GAS_LIMIT] };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (gasLimits.l2Gas > MAX_PROCESSABLE_L2_GAS) {
|
|
78
|
+
this.#log.verbose(`Rejecting transaction due to the gas limit(s) being higher than the maximum processable gas`, {
|
|
79
|
+
gasLimits,
|
|
80
|
+
minGasLimits,
|
|
81
|
+
});
|
|
82
|
+
return { result: 'invalid', reason: [TX_ERROR_GAS_LIMIT_TOO_HIGH] };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return { result: 'valid' };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Validates that a transaction can pay its gas fees.
|
|
91
|
+
*
|
|
92
|
+
* Runs three checks in order:
|
|
93
|
+
* 1. **Gas limits** (delegates to {@link GasLimitsValidator}) — rejects if limits are
|
|
94
|
+
* out of bounds.
|
|
95
|
+
* 2. **Max fee per gas** — skips (not rejects) the tx if its maxFeesPerGas is below
|
|
96
|
+
* the current block's gas fees. We skip rather than reject because the tx may
|
|
97
|
+
* become eligible in a later block with lower fees.
|
|
98
|
+
* 3. **Fee payer balance** — reads the fee payer's FeeJuice balance from public state,
|
|
99
|
+
* adds any pending claim from a setup-phase `_increase_public_balance` call, and
|
|
100
|
+
* rejects if the total is less than the tx's fee limit (gasLimits * maxFeePerGas).
|
|
101
|
+
*
|
|
102
|
+
* Used by: gossip (stage 1), RPC, and block building validators.
|
|
103
|
+
*/
|
|
19
104
|
export class GasTxValidator implements TxValidator<Tx> {
|
|
20
|
-
#log
|
|
105
|
+
#log: Logger;
|
|
21
106
|
#publicDataSource: PublicStateSource;
|
|
22
107
|
#feeJuiceAddress: AztecAddress;
|
|
23
108
|
#gasFees: GasFees;
|
|
24
109
|
|
|
25
|
-
constructor(
|
|
110
|
+
constructor(
|
|
111
|
+
publicDataSource: PublicStateSource,
|
|
112
|
+
feeJuiceAddress: AztecAddress,
|
|
113
|
+
gasFees: GasFees,
|
|
114
|
+
private bindings?: LoggerBindings,
|
|
115
|
+
) {
|
|
116
|
+
this.#log = createLogger('sequencer:tx_validator:tx_gas', bindings);
|
|
26
117
|
this.#publicDataSource = publicDataSource;
|
|
27
118
|
this.#feeJuiceAddress = feeJuiceAddress;
|
|
28
119
|
this.#gasFees = gasFees;
|
|
29
120
|
}
|
|
30
121
|
|
|
31
122
|
async validateTx(tx: Tx): Promise<TxValidationResult> {
|
|
32
|
-
const gasLimitValidation = this
|
|
123
|
+
const gasLimitValidation = new GasLimitsValidator(this.bindings).validateGasLimit(tx);
|
|
33
124
|
if (gasLimitValidation.result === 'invalid') {
|
|
34
125
|
return Promise.resolve(gasLimitValidation);
|
|
35
126
|
}
|
|
@@ -63,31 +154,9 @@ export class GasTxValidator implements TxValidator<Tx> {
|
|
|
63
154
|
}
|
|
64
155
|
|
|
65
156
|
/**
|
|
66
|
-
*
|
|
157
|
+
* Checks the fee payer has enough FeeJuice balance to cover the tx's fee limit.
|
|
158
|
+
* Accounts for any pending claim from a setup-phase `_increase_public_balance` call.
|
|
67
159
|
*/
|
|
68
|
-
#validateGasLimit(tx: Tx): TxValidationResult {
|
|
69
|
-
const gasLimits = tx.data.constants.txContext.gasSettings.gasLimits;
|
|
70
|
-
const minGasLimits = new Gas(FIXED_DA_GAS, FIXED_L2_GAS);
|
|
71
|
-
|
|
72
|
-
if (minGasLimits.gtAny(gasLimits)) {
|
|
73
|
-
this.#log.verbose(`Rejecting transaction due to the gas limit(s) not being above the minimum gas limit`, {
|
|
74
|
-
gasLimits,
|
|
75
|
-
minGasLimits,
|
|
76
|
-
});
|
|
77
|
-
return { result: 'invalid', reason: [TX_ERROR_INSUFFICIENT_GAS_LIMIT] };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (gasLimits.l2Gas > AVM_MAX_PROCESSABLE_L2_GAS) {
|
|
81
|
-
this.#log.verbose(`Rejecting transaction due to the gas limit(s) being higher than the maximum processable gas`, {
|
|
82
|
-
gasLimits,
|
|
83
|
-
minGasLimits,
|
|
84
|
-
});
|
|
85
|
-
return { result: 'invalid', reason: [TX_ERROR_GAS_LIMIT_TOO_HIGH] };
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return { result: 'valid' };
|
|
89
|
-
}
|
|
90
|
-
|
|
91
160
|
public async validateTxFee(tx: Tx): Promise<TxValidationResult> {
|
|
92
161
|
const feePayer = tx.data.feePayer;
|
|
93
162
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import {
|
|
4
4
|
type AnyTx,
|
|
5
5
|
TX_ERROR_INCORRECT_L1_CHAIN_ID,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from '@aztec/stdlib/tx';
|
|
12
12
|
|
|
13
13
|
export class MetadataTxValidator<T extends AnyTx> implements TxValidator<T> {
|
|
14
|
-
#log
|
|
14
|
+
#log: Logger;
|
|
15
15
|
|
|
16
16
|
constructor(
|
|
17
17
|
private values: {
|
|
@@ -20,7 +20,10 @@ export class MetadataTxValidator<T extends AnyTx> implements TxValidator<T> {
|
|
|
20
20
|
vkTreeRoot: Fr;
|
|
21
21
|
protocolContractsHash: Fr;
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
bindings?: LoggerBindings,
|
|
24
|
+
) {
|
|
25
|
+
this.#log = createLogger('p2p:tx_validator:tx_metadata', bindings);
|
|
26
|
+
}
|
|
24
27
|
|
|
25
28
|
validateTx(tx: T): Promise<TxValidationResult> {
|
|
26
29
|
const errors = [];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { NullifierSource } from '@aztec/p2p';
|
|
2
|
+
import type { MerkleTreeReadOperations } from '@aztec/stdlib/interfaces/server';
|
|
3
|
+
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Implements a nullifier source by checking a DB and an in-memory collection.
|
|
7
|
+
* Intended for validating transactions as they are added to a block.
|
|
8
|
+
*/
|
|
9
|
+
export class NullifierCache implements NullifierSource {
|
|
10
|
+
nullifiers: Set<string>;
|
|
11
|
+
|
|
12
|
+
constructor(private db: MerkleTreeReadOperations) {
|
|
13
|
+
this.nullifiers = new Set();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public async nullifiersExist(nullifiers: Buffer[]): Promise<boolean[]> {
|
|
17
|
+
const cacheResults = nullifiers.map(n => this.nullifiers.has(n.toString()));
|
|
18
|
+
const toCheckDb = nullifiers.filter((_n, index) => !cacheResults[index]);
|
|
19
|
+
const dbHits = await this.db.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, toCheckDb);
|
|
20
|
+
|
|
21
|
+
let dbIndex = 0;
|
|
22
|
+
return nullifiers.map((_n, index) => cacheResults[index] || dbHits[dbIndex++] !== undefined);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public addNullifiers(nullifiers: Buffer[]) {
|
|
26
|
+
for (const nullifier of nullifiers) {
|
|
27
|
+
this.nullifiers.add(nullifier.toString());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
1
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { PublicContractsDB, getCallRequestsWithCalldataByPhase } from '@aztec/simulator/server';
|
|
3
3
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
4
4
|
import type { AllowedElement } from '@aztec/stdlib/interfaces/server';
|
|
@@ -14,15 +14,17 @@ import {
|
|
|
14
14
|
import type { UInt64 } from '@aztec/stdlib/types';
|
|
15
15
|
|
|
16
16
|
export class PhasesTxValidator implements TxValidator<Tx> {
|
|
17
|
-
#log
|
|
17
|
+
#log: Logger;
|
|
18
18
|
private contractsDB: PublicContractsDB;
|
|
19
19
|
|
|
20
20
|
constructor(
|
|
21
21
|
contracts: ContractDataSource,
|
|
22
22
|
private setupAllowList: AllowedElement[],
|
|
23
23
|
private timestamp: UInt64,
|
|
24
|
+
bindings?: LoggerBindings,
|
|
24
25
|
) {
|
|
25
|
-
this
|
|
26
|
+
this.#log = createLogger('sequencer:tx_validator:tx_phases', bindings);
|
|
27
|
+
this.contractsDB = new PublicContractsDB(contracts, bindings);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
async validateTx(tx: Tx): Promise<TxValidationResult> {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
1
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { MAX_TX_SIZE_KB } from '@aztec/stdlib/p2p';
|
|
3
3
|
import { Tx, type TxValidationResult, type TxValidator } from '@aztec/stdlib/tx';
|
|
4
4
|
|
|
5
5
|
export class SizeTxValidator implements TxValidator<Tx> {
|
|
6
|
-
#log
|
|
6
|
+
#log: Logger;
|
|
7
|
+
|
|
8
|
+
constructor(bindings?: LoggerBindings) {
|
|
9
|
+
this.#log = createLogger('p2p:tx_validator:tx_size', bindings);
|
|
10
|
+
}
|
|
7
11
|
|
|
8
12
|
validateTx(tx: Tx): Promise<TxValidationResult> {
|
|
9
13
|
const txSize = tx.getSize();
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
4
|
-
type AnyTx,
|
|
5
|
-
TX_ERROR_INVALID_INCLUDE_BY_TIMESTAMP,
|
|
6
|
-
type TxValidationResult,
|
|
7
|
-
type TxValidator,
|
|
8
|
-
getTxHash,
|
|
9
|
-
} from '@aztec/stdlib/tx';
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { TX_ERROR_INVALID_EXPIRATION_TIMESTAMP, type TxValidationResult, type TxValidator } from '@aztec/stdlib/tx';
|
|
10
4
|
import type { UInt64 } from '@aztec/stdlib/types';
|
|
11
5
|
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
/** Structural interface for timestamp validation. */
|
|
7
|
+
export interface HasTimestampData {
|
|
8
|
+
txHash: { toString(): string };
|
|
9
|
+
data: {
|
|
10
|
+
expirationTimestamp: bigint;
|
|
11
|
+
constants: {
|
|
12
|
+
anchorBlockHeader: {
|
|
13
|
+
globalVariables: {
|
|
14
|
+
blockNumber: BlockNumber;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class TimestampTxValidator<T extends HasTimestampData> implements TxValidator<T> {
|
|
22
|
+
#log: Logger;
|
|
14
23
|
|
|
15
24
|
constructor(
|
|
16
25
|
private values: {
|
|
@@ -20,28 +29,27 @@ export class TimestampTxValidator<T extends AnyTx> implements TxValidator<T> {
|
|
|
20
29
|
// Block number in which the tx is considered to be included.
|
|
21
30
|
blockNumber: BlockNumber;
|
|
22
31
|
},
|
|
23
|
-
|
|
32
|
+
bindings?: LoggerBindings,
|
|
33
|
+
) {
|
|
34
|
+
this.#log = createLogger('p2p:tx_validator:timestamp', bindings);
|
|
35
|
+
}
|
|
24
36
|
|
|
25
37
|
validateTx(tx: T): Promise<TxValidationResult> {
|
|
26
|
-
const
|
|
27
|
-
// If building block 1, we skip the expiration check. For details on why see the `
|
|
38
|
+
const expirationTimestamp = tx.data.expirationTimestamp;
|
|
39
|
+
// If building block 1, we skip the expiration check. For details on why see the `validate_expiration_timestamp`
|
|
28
40
|
// function in `noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/components/validation_requests.nr`.
|
|
29
41
|
const buildingBlock1 = this.values.blockNumber === 1;
|
|
30
42
|
|
|
31
|
-
if (!buildingBlock1 &&
|
|
43
|
+
if (!buildingBlock1 && expirationTimestamp < this.values.timestamp) {
|
|
32
44
|
if (tx.data.constants.anchorBlockHeader.globalVariables.blockNumber === 0) {
|
|
33
45
|
this.#log.warn(
|
|
34
46
|
`A tx built against a genesis block failed to be included in block 1 which is the only block in which txs built against a genesis block are allowed to be included.`,
|
|
35
47
|
);
|
|
36
48
|
}
|
|
37
49
|
this.#log.verbose(
|
|
38
|
-
`Rejecting tx ${
|
|
39
|
-
tx,
|
|
40
|
-
)} for low expiration timestamp. Tx expiration timestamp: ${includeByTimestamp}, timestamp: ${
|
|
41
|
-
this.values.timestamp
|
|
42
|
-
}.`,
|
|
50
|
+
`Rejecting tx ${tx.txHash} for low expiration timestamp. Tx expiration timestamp: ${expirationTimestamp}, timestamp: ${this.values.timestamp}.`,
|
|
43
51
|
);
|
|
44
|
-
return Promise.resolve({ result: 'invalid', reason: [
|
|
52
|
+
return Promise.resolve({ result: 'invalid', reason: [TX_ERROR_INVALID_EXPIRATION_TIMESTAMP] });
|
|
45
53
|
} else {
|
|
46
54
|
return Promise.resolve({ result: 'valid' });
|
|
47
55
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
1
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import type { Tx, TxValidationResult, TxValidator } from '@aztec/stdlib/tx';
|
|
3
3
|
|
|
4
4
|
export class TxPermittedValidator implements TxValidator<Tx> {
|
|
5
|
-
#log
|
|
5
|
+
#log: Logger;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(
|
|
8
|
+
private permitted: boolean,
|
|
9
|
+
bindings?: LoggerBindings,
|
|
10
|
+
) {
|
|
11
|
+
this.#log = createLogger('p2p:tx_validator:tx_permitted', bindings);
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
validateTx(tx: Tx): Promise<TxValidationResult> {
|
|
10
15
|
if (!this.permitted) {
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
1
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import type { ClientProtocolCircuitVerifier } from '@aztec/stdlib/interfaces/server';
|
|
3
3
|
import { TX_ERROR_INVALID_PROOF, Tx, type TxValidationResult, type TxValidator } from '@aztec/stdlib/tx';
|
|
4
4
|
|
|
5
5
|
export class TxProofValidator implements TxValidator<Tx> {
|
|
6
|
-
#log
|
|
6
|
+
#log: Logger;
|
|
7
7
|
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(
|
|
9
|
+
private verifier: ClientProtocolCircuitVerifier,
|
|
10
|
+
bindings?: LoggerBindings,
|
|
11
|
+
) {
|
|
12
|
+
this.#log = createLogger('p2p:tx_validator:proof', bindings);
|
|
13
|
+
}
|
|
9
14
|
|
|
10
15
|
async validateTx(tx: Tx): Promise<TxValidationResult> {
|
|
11
16
|
const result = await this.verifier.verifyProof(tx);
|
|
@@ -24,6 +24,7 @@ class KeyNotFoundError extends Error {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export class AztecDatastore implements Datastore {
|
|
27
|
+
#db: AztecAsyncKVStore;
|
|
27
28
|
#memoryDatastore: Map<string, MemoryItem>;
|
|
28
29
|
#dbDatastore: AztecAsyncMap<string, Uint8Array>;
|
|
29
30
|
|
|
@@ -32,9 +33,9 @@ export class AztecDatastore implements Datastore {
|
|
|
32
33
|
private maxMemoryItems: number;
|
|
33
34
|
|
|
34
35
|
constructor(db: AztecAsyncKVStore, { maxMemoryItems } = { maxMemoryItems: 50 }) {
|
|
36
|
+
this.#db = db;
|
|
35
37
|
this.#memoryDatastore = new Map();
|
|
36
38
|
this.#dbDatastore = db.openMap('p2p_datastore');
|
|
37
|
-
|
|
38
39
|
this.maxMemoryItems = maxMemoryItems;
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -106,13 +107,15 @@ export class AztecDatastore implements Datastore {
|
|
|
106
107
|
});
|
|
107
108
|
},
|
|
108
109
|
commit: async () => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
await this.#db.transactionAsync(async () => {
|
|
111
|
+
for (const op of this.#batchOps) {
|
|
112
|
+
if (op.type === 'put' && op.value) {
|
|
113
|
+
await this.put(op.key, op.value);
|
|
114
|
+
} else if (op.type === 'del') {
|
|
115
|
+
await this.delete(op.key);
|
|
116
|
+
}
|
|
114
117
|
}
|
|
115
|
-
}
|
|
118
|
+
});
|
|
116
119
|
this.#batchOps = []; // Clear operations after commit
|
|
117
120
|
},
|
|
118
121
|
};
|
|
@@ -87,7 +87,7 @@ export class DiscV5Service extends EventEmitter implements PeerDiscoveryService
|
|
|
87
87
|
this.packageVersion,
|
|
88
88
|
));
|
|
89
89
|
|
|
90
|
-
const metricsRegistry = new OtelMetricsAdapter(telemetry);
|
|
90
|
+
const metricsRegistry = new OtelMetricsAdapter(telemetry, this.logger.getBindings());
|
|
91
91
|
this.discv5 = Discv5.create({
|
|
92
92
|
enr: this.enr,
|
|
93
93
|
peerId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
2
|
import type { PeerInfo } from '@aztec/stdlib/interfaces/server';
|
|
3
|
-
import type { Gossipable, PeerErrorSeverity } from '@aztec/stdlib/p2p';
|
|
3
|
+
import type { Gossipable, PeerErrorSeverity, TopicType } from '@aztec/stdlib/p2p';
|
|
4
4
|
import { Tx, TxHash } from '@aztec/stdlib/tx';
|
|
5
5
|
|
|
6
6
|
import type { PeerId } from '@libp2p/interface';
|
|
@@ -8,7 +8,9 @@ import type { ENR } from '@nethermindeth/enr';
|
|
|
8
8
|
import EventEmitter from 'events';
|
|
9
9
|
|
|
10
10
|
import type { PeerManagerInterface } from './peer-manager/interface.js';
|
|
11
|
+
import type { BatchTxRequesterLibP2PService } from './reqresp/batch-tx-requester/interface.js';
|
|
11
12
|
import type { P2PReqRespConfig } from './reqresp/config.js';
|
|
13
|
+
import type { ConnectionSampler } from './reqresp/connection-sampler/connection_sampler.js';
|
|
12
14
|
import { type AuthRequest, StatusMessage } from './reqresp/index.js';
|
|
13
15
|
import type {
|
|
14
16
|
ReqRespInterface,
|
|
@@ -24,6 +26,8 @@ import { ReqRespStatus } from './reqresp/status.js';
|
|
|
24
26
|
import {
|
|
25
27
|
type P2PBlockReceivedCallback,
|
|
26
28
|
type P2PCheckpointReceivedCallback,
|
|
29
|
+
type P2PDuplicateAttestationCallback,
|
|
30
|
+
type P2PDuplicateProposalCallback,
|
|
27
31
|
type P2PService,
|
|
28
32
|
type PeerDiscoveryService,
|
|
29
33
|
PeerDiscoveryState,
|
|
@@ -40,6 +44,10 @@ export class DummyP2PService implements P2PService {
|
|
|
40
44
|
return [];
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
getGossipMeshPeerCount(_topicType: TopicType): number {
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
/**
|
|
44
52
|
* Starts the dummy implementation.
|
|
45
53
|
* @returns A resolved promise.
|
|
@@ -80,6 +88,16 @@ export class DummyP2PService implements P2PService {
|
|
|
80
88
|
*/
|
|
81
89
|
public registerCheckpointReceivedCallback(_callback: P2PCheckpointReceivedCallback) {}
|
|
82
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Register a callback for when a duplicate proposal is detected
|
|
93
|
+
*/
|
|
94
|
+
public registerDuplicateProposalCallback(_callback: P2PDuplicateProposalCallback): void {}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Register a callback for when a duplicate attestation is detected
|
|
98
|
+
*/
|
|
99
|
+
public registerDuplicateAttestationCallback(_callback: P2PDuplicateAttestationCallback): void {}
|
|
100
|
+
|
|
83
101
|
/**
|
|
84
102
|
* Sends a request to a peer.
|
|
85
103
|
* @param _protocol - The protocol to send the request on.
|
|
@@ -106,6 +124,15 @@ export class DummyP2PService implements P2PService {
|
|
|
106
124
|
return Promise.resolve([]);
|
|
107
125
|
}
|
|
108
126
|
|
|
127
|
+
public sendRequestToPeer(
|
|
128
|
+
_peerId: PeerId,
|
|
129
|
+
_subProtocol: ReqRespSubProtocol,
|
|
130
|
+
_payload: Buffer,
|
|
131
|
+
_dialTimeout?: number,
|
|
132
|
+
): Promise<ReqRespResponse> {
|
|
133
|
+
return Promise.resolve({ status: ReqRespStatus.SUCCESS, data: Buffer.from([]) });
|
|
134
|
+
}
|
|
135
|
+
|
|
109
136
|
/**
|
|
110
137
|
* Returns the ENR of the peer.
|
|
111
138
|
* @returns The ENR of the peer, otherwise undefined.
|
|
@@ -114,7 +141,7 @@ export class DummyP2PService implements P2PService {
|
|
|
114
141
|
return undefined;
|
|
115
142
|
}
|
|
116
143
|
|
|
117
|
-
|
|
144
|
+
validateTxsReceivedInBlockProposal(_txs: Tx[]): Promise<void> {
|
|
118
145
|
return Promise.resolve();
|
|
119
146
|
}
|
|
120
147
|
|
|
@@ -132,6 +159,27 @@ export class DummyP2PService implements P2PService {
|
|
|
132
159
|
|
|
133
160
|
//this is no-op
|
|
134
161
|
registerThisValidatorAddresses(_address: EthAddress[]): void {}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Get dummy BatchTxRequesterLibP2PService for testing
|
|
165
|
+
*/
|
|
166
|
+
getBatchTxRequesterService(): BatchTxRequesterLibP2PService {
|
|
167
|
+
return {
|
|
168
|
+
reqResp: this, // The dummy service implements ReqRespInterface
|
|
169
|
+
connectionSampler: new DummyReqResp().getConnectionSampler(),
|
|
170
|
+
txValidatorConfig: {
|
|
171
|
+
l1ChainId: 1,
|
|
172
|
+
rollupVersion: 1,
|
|
173
|
+
proofVerifier: {
|
|
174
|
+
verifyProof: () => Promise.resolve({ valid: true, durationMs: 0, totalDurationMs: 0 }),
|
|
175
|
+
stop: () => Promise.resolve(),
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
peerScoring: {
|
|
179
|
+
penalizePeer: (_peerId, _penalty) => {},
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
135
183
|
}
|
|
136
184
|
|
|
137
185
|
/**
|
|
@@ -268,6 +316,15 @@ export class DummyReqResp implements ReqRespInterface {
|
|
|
268
316
|
return Promise.resolve({ status: ReqRespStatus.SUCCESS, data: Buffer.from([]) });
|
|
269
317
|
}
|
|
270
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Get dummy connection sampler for testing
|
|
321
|
+
*/
|
|
322
|
+
getConnectionSampler(): Pick<ConnectionSampler, 'getPeerListSortedByConnectionCountAsc'> {
|
|
323
|
+
return {
|
|
324
|
+
getPeerListSortedByConnectionCountAsc: () => [],
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
|
|
271
328
|
addSubProtocol(
|
|
272
329
|
_subProtocol: ReqRespSubProtocol,
|
|
273
330
|
_handler: ReqRespSubProtocolHandler,
|
package/src/services/encoding.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Taken from lodestar: https://github.com/ChainSafe/lodestar
|
|
2
|
-
import { sha256 } from '@aztec/foundation/crypto/sha256';
|
|
3
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
3
|
import { MAX_TX_SIZE_KB, TopicType, getTopicFromString } from '@aztec/stdlib/p2p';
|
|
5
4
|
|
|
6
5
|
import type { RPC } from '@chainsafe/libp2p-gossipsub/message';
|
|
7
6
|
import type { DataTransform } from '@chainsafe/libp2p-gossipsub/types';
|
|
8
7
|
import type { Message } from '@libp2p/interface';
|
|
8
|
+
import { webcrypto } from 'node:crypto';
|
|
9
9
|
import { compressSync, uncompressSync } from 'snappy';
|
|
10
10
|
import xxhashFactory from 'xxhash-wasm';
|
|
11
11
|
|
|
@@ -44,11 +44,10 @@ export function msgIdToStrFn(msgId: Uint8Array): string {
|
|
|
44
44
|
* @param message - The libp2p message
|
|
45
45
|
* @returns The message identifier
|
|
46
46
|
*/
|
|
47
|
-
export function getMsgIdFn(
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return sha256(Buffer.concat(vec)).subarray(0, 20);
|
|
47
|
+
export async function getMsgIdFn({ topic, data }: Message): Promise<Uint8Array> {
|
|
48
|
+
const buffer = Buffer.concat([Buffer.from(topic), data]);
|
|
49
|
+
const hash = await webcrypto.subtle.digest('SHA-256', buffer);
|
|
50
|
+
return Buffer.from(hash.slice(0, 20));
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
const DefaultMaxSizesKb: Record<TopicType, number> = {
|
|
@@ -58,7 +57,8 @@ const DefaultMaxSizesKb: Record<TopicType, number> = {
|
|
|
58
57
|
// Proposals may carry some tx objects, so we allow a larger size capped at 10mb
|
|
59
58
|
// Note this may not be enough for carrying all tx objects in a block
|
|
60
59
|
[TopicType.block_proposal]: 1024 * 10,
|
|
61
|
-
//
|
|
60
|
+
// Checkpoint proposals carry almost the same data as a block proposal (see the lastBlockProposal)
|
|
61
|
+
// Only diff is an additional header, which is pretty small compared to the 10mb limit
|
|
62
62
|
[TopicType.checkpoint_proposal]: 1024 * 10,
|
|
63
63
|
};
|
|
64
64
|
|
|
@@ -78,11 +78,11 @@ export class SnappyTransform implements DataTransform {
|
|
|
78
78
|
return this.inboundTransformData(Buffer.from(data), topic);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
public inboundTransformData(data: Buffer, topic?: TopicType): Buffer {
|
|
81
|
+
public inboundTransformData(data: Buffer, topic?: TopicType, maxSizeKbOverride?: number): Buffer {
|
|
82
82
|
if (data.length === 0) {
|
|
83
83
|
return data;
|
|
84
84
|
}
|
|
85
|
-
const maxSizeKb = this.maxSizesKb[topic!] ?? this.defaultMaxSizeKb;
|
|
85
|
+
const maxSizeKb = maxSizeKbOverride ?? this.maxSizesKb[topic!] ?? this.defaultMaxSizeKb;
|
|
86
86
|
const { decompressedSize } = readSnappyPreamble(data);
|
|
87
87
|
if (decompressedSize > maxSizeKb * 1024) {
|
|
88
88
|
this.logger.warn(`Decompressed size ${decompressedSize} exceeds maximum allowed size of ${maxSizeKb}kb`);
|