@aztec/p2p 0.0.1-commit.d6f2b3f94 → 0.0.1-commit.d939eb5aa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -3
- package/dest/client/factory.d.ts +7 -7
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +37 -30
- package/dest/client/interface.d.ts +22 -20
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +11 -19
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +92 -104
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +20 -10
- package/dest/config.d.ts +128 -96
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +97 -38
- package/dest/errors/p2p-service.error.d.ts +9 -0
- package/dest/errors/p2p-service.error.d.ts.map +1 -0
- package/dest/errors/p2p-service.error.js +10 -0
- package/dest/errors/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 +1 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +10 -6
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +21 -9
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +6 -6
- 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 +1 -2
- package/dest/mem_pools/index.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.d.ts +4 -2
- package/dest/mem_pools/instrumentation.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.js +16 -14
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +30 -13
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/deleted_pool.js +91 -20
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts +3 -3
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.js +18 -9
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +7 -3
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +3 -3
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +12 -4
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/index.js +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +54 -5
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.js +8 -0
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.js +7 -5
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +9 -7
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +14 -6
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +4 -4
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +16 -4
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +3 -3
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +3 -3
- package/dest/mem_pools/tx_pool_v2/index.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/index.js +1 -1
- 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 +28 -10
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.js +5 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +56 -15
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +113 -20
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +12 -3
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +50 -45
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +12 -5
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +17 -6
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +14 -5
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +319 -147
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +5 -2
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/attestation_validator.js +20 -11
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +4 -2
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.js +2 -2
- package/dest/msg_validators/clock_tolerance.d.ts +12 -1
- package/dest/msg_validators/clock_tolerance.d.ts.map +1 -1
- package/dest/msg_validators/clock_tolerance.js +54 -3
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +7 -4
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/block_proposal_validator.js +10 -2
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +7 -4
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +16 -2
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +15 -8
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator.js +67 -47
- package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +2 -2
- 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/allowed_public_setup.d.ts +2 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.js +24 -20
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts +17 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.js +24 -0
- package/dest/msg_validators/tx_validator/archive_cache.js +1 -1
- package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts +9 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/contract_instance_validator.js +48 -0
- package/dest/msg_validators/tx_validator/data_validator.d.ts +1 -1
- package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/data_validator.js +35 -2
- package/dest/msg_validators/tx_validator/factory.d.ts +133 -6
- package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/factory.js +247 -60
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.js +6 -2
- package/dest/msg_validators/tx_validator/gas_validator.d.ts +67 -3
- package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/gas_validator.js +112 -43
- package/dest/msg_validators/tx_validator/index.d.ts +3 -1
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +2 -0
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.js +4 -4
- package/dest/msg_validators/tx_validator/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 +22 -2
- package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/phases_validator.js +72 -24
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +2 -2
- package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/timestamp_validator.js +6 -6
- package/dest/services/data_store.d.ts +1 -1
- package/dest/services/data_store.d.ts.map +1 -1
- package/dest/services/data_store.js +5 -5
- package/dest/services/dummy_service.d.ts +8 -5
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +10 -5
- package/dest/services/encoding.d.ts +6 -2
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +16 -9
- package/dest/services/gossipsub/topic_score_params.d.ts +30 -7
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
- package/dest/services/gossipsub/topic_score_params.js +53 -14
- package/dest/services/libp2p/libp2p_service.d.ts +29 -36
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +224 -197
- package/dest/services/peer-manager/metrics.d.ts +3 -1
- package/dest/services/peer-manager/metrics.d.ts.map +1 -1
- package/dest/services/peer-manager/metrics.js +6 -0
- package/dest/services/peer-manager/peer_manager.d.ts +6 -2
- package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_manager.js +39 -11
- package/dest/services/peer-manager/peer_scoring.d.ts +7 -2
- package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_scoring.js +32 -10
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +12 -8
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +83 -106
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts +4 -7
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +11 -13
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.js +31 -46
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +19 -11
- package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/peer_collection.js +52 -15
- package/dest/services/reqresp/batch-tx-requester/tx_validator.js +2 -2
- package/dest/services/reqresp/config.d.ts +3 -3
- package/dest/services/reqresp/config.d.ts.map +1 -1
- package/dest/services/reqresp/interface.d.ts +14 -9
- package/dest/services/reqresp/interface.d.ts.map +1 -1
- package/dest/services/reqresp/interface.js +10 -11
- package/dest/services/reqresp/metrics.d.ts +1 -1
- package/dest/services/reqresp/metrics.d.ts.map +1 -1
- package/dest/services/reqresp/metrics.js +0 -1
- package/dest/services/reqresp/protocols/index.d.ts +1 -2
- package/dest/services/reqresp/protocols/index.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/index.js +0 -1
- package/dest/services/reqresp/protocols/tx.d.ts +1 -1
- package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/tx.js +1 -3
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts +5 -4
- package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts.map +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limiter.js +10 -8
- package/dest/services/reqresp/rate-limiter/rate_limits.d.ts +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limits.d.ts.map +1 -1
- package/dest/services/reqresp/rate-limiter/rate_limits.js +0 -10
- package/dest/services/reqresp/reqresp.d.ts +4 -2
- package/dest/services/reqresp/reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/reqresp.js +30 -12
- package/dest/services/service.d.ts +9 -4
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/config.d.ts +13 -1
- package/dest/services/tx_collection/config.d.ts.map +1 -1
- package/dest/services/tx_collection/config.js +30 -0
- package/dest/services/tx_collection/fast_tx_collection.d.ts +1 -4
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.js +65 -75
- package/dest/services/tx_collection/file_store_tx_collection.d.ts +38 -29
- package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_collection.js +126 -77
- package/dest/services/tx_collection/file_store_tx_source.d.ts +17 -6
- package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_source.js +53 -10
- package/dest/services/tx_collection/instrumentation.d.ts +1 -1
- package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
- package/dest/services/tx_collection/instrumentation.js +2 -1
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +7 -7
- package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -1
- package/dest/services/tx_collection/proposal_tx_collector.js +5 -4
- package/dest/services/tx_collection/request_tracker.d.ts +53 -0
- package/dest/services/tx_collection/request_tracker.d.ts.map +1 -0
- package/dest/services/tx_collection/request_tracker.js +84 -0
- package/dest/services/tx_collection/slow_tx_collection.d.ts +5 -3
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/slow_tx_collection.js +17 -12
- package/dest/services/tx_collection/tx_collection.d.ts +9 -9
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection.js +26 -10
- package/dest/services/tx_collection/tx_collection_sink.d.ts +6 -5
- package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection_sink.js +13 -22
- package/dest/services/tx_collection/tx_source.d.ts +13 -7
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_source.js +26 -7
- package/dest/services/tx_file_store/tx_file_store.d.ts +3 -2
- package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -1
- package/dest/services/tx_file_store/tx_file_store.js +9 -6
- package/dest/services/tx_provider.d.ts +3 -3
- package/dest/services/tx_provider.d.ts.map +1 -1
- package/dest/services/tx_provider.js +4 -4
- package/dest/test-helpers/make-test-p2p-clients.d.ts +5 -6
- 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 +14 -6
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +43 -12
- 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 +3 -4
- package/dest/test-helpers/testbench-utils.d.ts +8 -3
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +30 -4
- package/dest/testbench/p2p_client_testbench_worker.d.ts +2 -2
- package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
- package/dest/testbench/p2p_client_testbench_worker.js +78 -26
- package/dest/testbench/worker_client_manager.d.ts +10 -1
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +55 -3
- package/dest/util.d.ts +3 -3
- package/dest/util.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/client/factory.ts +68 -48
- package/src/client/interface.ts +26 -21
- package/src/client/p2p_client.ts +102 -135
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +33 -14
- package/src/config.ts +146 -44
- package/src/errors/p2p-service.error.ts +11 -0
- package/src/errors/tx-pool.error.ts +12 -0
- package/src/index.ts +0 -1
- package/src/mem_pools/attestation_pool/attestation_pool.ts +25 -12
- package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +6 -6
- package/src/mem_pools/attestation_pool/mocks.ts +2 -1
- package/src/mem_pools/index.ts +0 -3
- package/src/mem_pools/instrumentation.ts +17 -13
- package/src/mem_pools/tx_pool_v2/README.md +52 -28
- package/src/mem_pools/tx_pool_v2/deleted_pool.ts +109 -22
- package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +21 -8
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +7 -3
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +18 -4
- package/src/mem_pools/tx_pool_v2/eviction/index.ts +4 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +59 -4
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +5 -5
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +8 -8
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +14 -9
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +33 -6
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +4 -3
- package/src/mem_pools/tx_pool_v2/index.ts +1 -1
- package/src/mem_pools/tx_pool_v2/instrumentation.ts +69 -0
- package/src/mem_pools/tx_pool_v2/interfaces.ts +30 -10
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +164 -28
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +58 -45
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +34 -8
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +353 -143
- package/src/msg_validators/attestation_validator/README.md +49 -0
- package/src/msg_validators/attestation_validator/attestation_validator.ts +21 -9
- package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +4 -1
- package/src/msg_validators/clock_tolerance.ts +72 -3
- package/src/msg_validators/proposal_validator/README.md +123 -0
- package/src/msg_validators/proposal_validator/block_proposal_validator.ts +17 -4
- package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +23 -7
- package/src/msg_validators/proposal_validator/proposal_validator.ts +79 -49
- package/src/msg_validators/tx_validator/README.md +119 -0
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -3
- package/src/msg_validators/tx_validator/allowed_public_setup.ts +22 -27
- package/src/msg_validators/tx_validator/allowed_setup_helpers.ts +31 -0
- package/src/msg_validators/tx_validator/archive_cache.ts +1 -1
- package/src/msg_validators/tx_validator/contract_instance_validator.ts +56 -0
- package/src/msg_validators/tx_validator/data_validator.ts +42 -1
- package/src/msg_validators/tx_validator/factory.ts +394 -78
- package/src/msg_validators/tx_validator/fee_payer_balance.ts +6 -2
- package/src/msg_validators/tx_validator/gas_validator.ts +145 -33
- package/src/msg_validators/tx_validator/index.ts +2 -0
- package/src/msg_validators/tx_validator/metadata_validator.ts +12 -4
- package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
- package/src/msg_validators/tx_validator/phases_validator.ts +82 -27
- package/src/msg_validators/tx_validator/timestamp_validator.ts +7 -7
- package/src/services/data_store.ts +5 -13
- package/src/services/dummy_service.ts +13 -7
- package/src/services/encoding.ts +16 -8
- package/src/services/gossipsub/README.md +29 -14
- package/src/services/gossipsub/topic_score_params.ts +85 -17
- package/src/services/libp2p/libp2p_service.ts +240 -225
- package/src/services/peer-manager/metrics.ts +7 -0
- package/src/services/peer-manager/peer_manager.ts +45 -11
- package/src/services/peer-manager/peer_scoring.ts +27 -5
- package/src/services/reqresp/README.md +229 -0
- package/src/services/reqresp/batch-tx-requester/README.md +46 -7
- package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +79 -112
- package/src/services/reqresp/batch-tx-requester/interface.ts +3 -6
- package/src/services/reqresp/batch-tx-requester/missing_txs.ts +30 -71
- package/src/services/reqresp/batch-tx-requester/peer_collection.ts +68 -24
- package/src/services/reqresp/batch-tx-requester/tx_validator.ts +2 -2
- package/src/services/reqresp/config.ts +2 -2
- package/src/services/reqresp/interface.ts +21 -11
- package/src/services/reqresp/metrics.ts +0 -1
- package/src/services/reqresp/protocols/index.ts +0 -1
- package/src/services/reqresp/protocols/tx.ts +1 -3
- package/src/services/reqresp/rate-limiter/rate_limiter.ts +13 -9
- package/src/services/reqresp/rate-limiter/rate_limits.ts +0 -10
- package/src/services/reqresp/reqresp.ts +40 -13
- package/src/services/service.ts +17 -3
- package/src/services/tx_collection/config.ts +42 -0
- package/src/services/tx_collection/fast_tx_collection.ts +71 -76
- package/src/services/tx_collection/file_store_tx_collection.ts +143 -93
- package/src/services/tx_collection/file_store_tx_source.ts +69 -10
- package/src/services/tx_collection/instrumentation.ts +7 -1
- package/src/services/tx_collection/proposal_tx_collector.ts +9 -13
- package/src/services/tx_collection/request_tracker.ts +127 -0
- package/src/services/tx_collection/slow_tx_collection.ts +17 -13
- package/src/services/tx_collection/tx_collection.ts +46 -17
- package/src/services/tx_collection/tx_collection_sink.ts +15 -29
- package/src/services/tx_collection/tx_source.ts +28 -8
- package/src/services/tx_file_store/tx_file_store.ts +6 -4
- package/src/services/tx_provider.ts +2 -2
- package/src/test-helpers/make-test-p2p-clients.ts +1 -3
- package/src/test-helpers/mock-pubsub.ts +44 -11
- package/src/test-helpers/reqresp-nodes.ts +5 -8
- package/src/test-helpers/testbench-utils.ts +41 -6
- package/src/testbench/p2p_client_testbench_worker.ts +89 -29
- package/src/testbench/worker_client_manager.ts +68 -6
- package/src/util.ts +8 -2
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +0 -125
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.js +0 -596
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts +0 -32
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/eviction_manager.js +0 -112
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts +0 -157
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/eviction_strategy.js +0 -52
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts +0 -16
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.js +0 -122
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.d.ts +0 -17
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.js +0 -84
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts +0 -19
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.js +0 -78
- package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.d.ts +0 -26
- package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.js +0 -84
- package/dest/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.d.ts +0 -25
- package/dest/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.js +0 -57
- package/dest/mem_pools/tx_pool/index.d.ts +0 -3
- package/dest/mem_pools/tx_pool/index.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/index.js +0 -2
- package/dest/mem_pools/tx_pool/priority.d.ts +0 -12
- package/dest/mem_pools/tx_pool/priority.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/priority.js +0 -15
- package/dest/mem_pools/tx_pool/tx_pool.d.ts +0 -127
- package/dest/mem_pools/tx_pool/tx_pool.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/tx_pool.js +0 -3
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts +0 -7
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +0 -1
- package/dest/mem_pools/tx_pool/tx_pool_test_suite.js +0 -400
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +0 -23
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +0 -1
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +0 -212
- package/dest/services/reqresp/protocols/block.d.ts +0 -9
- package/dest/services/reqresp/protocols/block.d.ts.map +0 -1
- package/dest/services/reqresp/protocols/block.js +0 -32
- package/src/mem_pools/tx_pool/README.md +0 -270
- package/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +0 -746
- package/src/mem_pools/tx_pool/eviction/eviction_manager.ts +0 -132
- package/src/mem_pools/tx_pool/eviction/eviction_strategy.ts +0 -208
- package/src/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.ts +0 -162
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +0 -104
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.ts +0 -93
- package/src/mem_pools/tx_pool/eviction/low_priority_eviction_rule.ts +0 -106
- package/src/mem_pools/tx_pool/eviction/nullifier_conflict_pre_add_rule.ts +0 -75
- package/src/mem_pools/tx_pool/index.ts +0 -2
- package/src/mem_pools/tx_pool/priority.ts +0 -20
- package/src/mem_pools/tx_pool/tx_pool.ts +0 -141
- package/src/mem_pools/tx_pool/tx_pool_test_suite.ts +0 -319
- package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +0 -230
- package/src/services/reqresp/protocols/block.ts +0 -37
|
@@ -30,19 +30,20 @@ TxPoolV2 manages transactions through a state machine with clear transitions:
|
|
|
30
30
|
└─────────────────────────────────────┘ (reorg)
|
|
31
31
|
│ │
|
|
32
32
|
│ handleFinalizedBlock() │ eviction after reorg
|
|
33
|
+
│ / eviction / failed exec │ (validation failure)
|
|
33
34
|
▼ ▼
|
|
34
35
|
┌─────────────────────────────────────┐ ┌─────────────────────────────────────┐
|
|
35
|
-
│
|
|
36
|
-
│
|
|
36
|
+
│ SLOT-SOFT-DELETED │ │ PRUNE-SOFT-DELETED │
|
|
37
|
+
│ (kept in DB until next slot) │ │ (kept in DB until finalized) │
|
|
38
|
+
└─────────────────────────────────────┘ └─────────────────────────────────────┘
|
|
39
|
+
│ │
|
|
40
|
+
│ prepareForSlot() │ handleFinalizedBlock()
|
|
41
|
+
│ (slot advanced) │ (mined block finalized)
|
|
42
|
+
▼ ▼
|
|
43
|
+
┌─────────────────────────────────────┐ ┌─────────────────────────────────────┐
|
|
44
|
+
│ HARD-DELETED │ │ HARD-DELETED │
|
|
45
|
+
│ (permanently removed from DB) │ │ (permanently removed from DB) │
|
|
37
46
|
└─────────────────────────────────────┘ └─────────────────────────────────────┘
|
|
38
|
-
│
|
|
39
|
-
│ handleFinalizedBlock()
|
|
40
|
-
│ (mined block finalized)
|
|
41
|
-
▼
|
|
42
|
-
┌─────────────────────────────────────┐
|
|
43
|
-
│ HARD-DELETED │
|
|
44
|
-
│ (permanently removed from DB) │
|
|
45
|
-
└─────────────────────────────────────┘
|
|
46
47
|
```
|
|
47
48
|
|
|
48
49
|
## Key Components
|
|
@@ -62,13 +63,11 @@ Core implementation containing:
|
|
|
62
63
|
|
|
63
64
|
### DeletedPool (`deleted_pool.ts`)
|
|
64
65
|
|
|
65
|
-
Manages
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
- Soft-deleted transactions remain in the database for debugging and potential resubmission
|
|
69
|
-
- When the original mined block is finalized on the new chain, soft-deleted transactions are permanently hard-deleted
|
|
66
|
+
Manages all transaction deletions in the pool with two soft-deletion mechanisms:
|
|
67
|
+
- **Slot-based**: Non-pruned txs are kept in DB until the next slot, allowing other nodes to fetch them via reqresp
|
|
68
|
+
- **Prune-based**: Txs from pruned blocks are kept in DB until their original mined block is finalized
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
All deletions go through `DeletedPool.deleteTx()`, which routes to the appropriate path based on whether the tx is tracked as being from a pruned block.
|
|
72
71
|
|
|
73
72
|
### TxMetaData (`tx_metadata.ts`)
|
|
74
73
|
|
|
@@ -80,33 +79,46 @@ Lightweight metadata stored alongside each transaction:
|
|
|
80
79
|
- `claimAmount`: Fee payer's claim from bridging
|
|
81
80
|
- `feeLimit`: Maximum fee the tx can pay
|
|
82
81
|
- `nullifiers`: For conflict detection
|
|
83
|
-
- `
|
|
82
|
+
- `expirationTimestamp`: Expiration timestamp
|
|
84
83
|
- `minedL2BlockId`: Set when mined (undefined otherwise)
|
|
85
84
|
|
|
86
85
|
State is derived by TxPoolIndices:
|
|
87
86
|
- `mined` if `minedL2BlockId` is set
|
|
88
87
|
- `protected` if in protection map
|
|
89
|
-
- `deleted` if soft-deleted (
|
|
88
|
+
- `deleted` if soft-deleted (slot-based or prune-based, evicted but kept in DB)
|
|
90
89
|
- `pending` otherwise
|
|
91
90
|
|
|
92
91
|
## Soft Deletion
|
|
93
92
|
|
|
94
|
-
|
|
93
|
+
Deleted transactions are kept in the database for a grace period before being permanently removed. There are two soft-deletion mechanisms:
|
|
94
|
+
|
|
95
|
+
### Slot-Based Soft Deletion
|
|
96
|
+
|
|
97
|
+
When a transaction is deleted from the pool (eviction, validation failure, failed execution) and is **not** from a pruned block, it is "slot-soft-deleted":
|
|
98
|
+
|
|
99
|
+
1. **Soft Delete**: The tx is removed from indices but kept in the database, tagged with the current slot number
|
|
100
|
+
2. **Retrieval**: Slot-soft-deleted txs can still be retrieved via `getTxByHash` and return status `'deleted'` from `getTxStatus`
|
|
101
|
+
3. **Hard Delete**: When `prepareForSlot` advances to a new slot, txs deleted in earlier slots are permanently removed
|
|
102
|
+
4. **Re-addition**: If a slot-soft-deleted tx is re-added to the pool, the slot-deleted tracking is cleared
|
|
103
|
+
|
|
104
|
+
This allows other nodes to still fetch recently-deleted transactions via reqresp during the current slot.
|
|
105
|
+
|
|
106
|
+
### Prune-Based Soft Deletion
|
|
107
|
+
|
|
108
|
+
When a chain reorganization occurs, transactions that were mined in pruned blocks are handled with longer retention:
|
|
95
109
|
|
|
96
110
|
1. **Tracking**: When `handlePrunedBlocks` is called, all un-mined transactions are tracked by their original mined block number
|
|
97
|
-
2. **Soft Delete**: If these transactions are later evicted (failed validation, nullifier conflict, etc.), they are "soft-deleted" - removed from indices but kept in the database
|
|
98
|
-
3. **Retrieval**:
|
|
111
|
+
2. **Soft Delete**: If these transactions are later evicted (failed validation, nullifier conflict, etc.), they are "prune-soft-deleted" - removed from indices but kept in the database
|
|
112
|
+
3. **Retrieval**: Prune-soft-deleted txs can still be retrieved via `getTxByHash` and return status `'deleted'` from `getTxStatus`
|
|
99
113
|
4. **Hard Delete**: When `handleFinalizedBlock` is called and the finalized block number reaches or exceeds the transaction's original mined block, the transaction is permanently removed
|
|
114
|
+
5. **Re-addition**: If a prune-soft-deleted tx is re-added, the `softDeleted` flag is reset to `false` but the prune tracking is preserved, so a subsequent deletion still uses the prune path
|
|
100
115
|
|
|
101
|
-
|
|
102
|
-
- Debugging reorg scenarios by keeping transaction data available
|
|
103
|
-
- Potential resubmission of transactions that failed validation after a reorg
|
|
104
|
-
- Clean eventual cleanup once we're certain the transaction won't be needed
|
|
116
|
+
Prune-soft-deleted transactions are **not** affected by slot cleanup - they survive across slot boundaries until finalized.
|
|
105
117
|
|
|
106
|
-
**
|
|
118
|
+
**Prune example:**
|
|
107
119
|
1. Tx mined at block 10
|
|
108
120
|
2. Chain prunes to block 5 (tx becomes un-mined, tracked as minedAtBlock=10)
|
|
109
|
-
3. Tx fails validation and is soft-deleted
|
|
121
|
+
3. Tx fails validation and is prune-soft-deleted
|
|
110
122
|
4. Block 9 finalized → tx still in DB (minedAtBlock=10 > finalized=9)
|
|
111
123
|
5. Block 10 finalized → tx hard-deleted (minedAtBlock=10 ≤ finalized=10)
|
|
112
124
|
|
|
@@ -117,6 +129,10 @@ If the tx is re-mined at a higher block before being soft-deleted:
|
|
|
117
129
|
4. Block 10 finalized → tx still in DB
|
|
118
130
|
5. Block 15 finalized → tx hard-deleted
|
|
119
131
|
|
|
132
|
+
### Hydration
|
|
133
|
+
|
|
134
|
+
On node restart, slot-soft-deleted transactions are immediately hard-deleted (they are stale by definition). Prune-soft-deleted transactions are loaded from the database and tracked normally.
|
|
135
|
+
|
|
120
136
|
## Architecture: Pre-add vs Post-event Rules
|
|
121
137
|
|
|
122
138
|
**Pre-add rules** (run during `addPendingTxs`):
|
|
@@ -142,7 +158,7 @@ Checked before adding a transaction to the pending pool:
|
|
|
142
158
|
|
|
143
159
|
| Rule | Purpose |
|
|
144
160
|
|------|---------|
|
|
145
|
-
| `NullifierConflictRule` | Handles transactions with conflicting nullifiers. Higher priority tx wins. |
|
|
161
|
+
| `NullifierConflictRule` | Handles transactions with conflicting nullifiers. Higher priority tx wins. For RPC submissions, a configurable price bump percentage is required. |
|
|
146
162
|
| `FeePayerBalancePreAddRule` | Ensures fee payer has sufficient balance for all their pending txs. |
|
|
147
163
|
| `LowPriorityPreAddRule` | Rejects txs when pool is full and new tx has lowest priority. |
|
|
148
164
|
|
|
@@ -217,6 +233,14 @@ await pool.updateConfig({
|
|
|
217
233
|
});
|
|
218
234
|
```
|
|
219
235
|
|
|
236
|
+
### Price Bump (RPC Transaction Replacement)
|
|
237
|
+
|
|
238
|
+
When a transaction is submitted via RPC and clashes on nullifiers with an existing pool transaction, the incoming tx must pay at least `priceBumpPercentage`% more in priority fee (i.e. `>= existingFee + existingFee * bump / 100`) to replace it. This prevents spam via small fee increments. The same bump applies when the pool is full and the incoming tx needs to evict the lowest-priority tx.
|
|
239
|
+
|
|
240
|
+
- **Env var**: `P2P_RPC_PRICE_BUMP_PERCENTAGE` (default: 10)
|
|
241
|
+
- **Scope**: RPC submissions only. P2P gossip uses `comparePriority` (fee + hash tiebreaker) with no bump.
|
|
242
|
+
- Even with a 0% bump, a replacement tx must pay at least 1 unit more than the existing fee.
|
|
243
|
+
|
|
220
244
|
## Return Values
|
|
221
245
|
|
|
222
246
|
### AddTxsResult
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
|
+
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
|
-
import type { AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store';
|
|
3
|
+
import type { AztecAsyncKVStore, AztecAsyncMap, AztecAsyncSet } from '@aztec/kv-store';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* State stored for each transaction from a pruned block.
|
|
@@ -39,15 +39,17 @@ function deserializeState(buffer: Buffer): DeletedTxState {
|
|
|
39
39
|
* When a chain prune (reorg) happens, transactions from pruned blocks are tracked here.
|
|
40
40
|
* This class is responsible for ALL deletion decisions:
|
|
41
41
|
*
|
|
42
|
-
* - Transactions from pruned blocks are "soft
|
|
43
|
-
* in the database for later re-execution
|
|
44
|
-
* - Transactions NOT from pruned blocks are "
|
|
42
|
+
* - Transactions from pruned blocks are "prune-soft-deleted" - removed from indices but kept
|
|
43
|
+
* in the database for later re-execution until their mined block is finalized
|
|
44
|
+
* - Transactions NOT from pruned blocks are "slot-soft-deleted" - kept in the database
|
|
45
|
+
* until the next slot, so other nodes can still fetch them via reqresp
|
|
45
46
|
*
|
|
46
|
-
* When a block is finalized, soft-deleted transactions that were originally mined at or
|
|
47
|
-
* before that block number are permanently (hard) deleted.
|
|
47
|
+
* When a block is finalized, prune-soft-deleted transactions that were originally mined at or
|
|
48
|
+
* before that block number are permanently (hard) deleted. Slot-soft-deleted transactions
|
|
49
|
+
* are hard-deleted when `prepareForSlot` advances to a new slot.
|
|
48
50
|
*/
|
|
49
51
|
export class DeletedPool {
|
|
50
|
-
/** Persisted map: txHash -> DeletedTxState (serialized) */
|
|
52
|
+
/** Persisted map: txHash -> DeletedTxState (serialized) - for prune-based soft deletions */
|
|
51
53
|
#deletedTxsDB: AztecAsyncMap<string, Buffer>;
|
|
52
54
|
|
|
53
55
|
/** Reference to the main txs database for hard deletion */
|
|
@@ -56,16 +58,27 @@ export class DeletedPool {
|
|
|
56
58
|
/** In-memory state for transactions from pruned blocks */
|
|
57
59
|
#state: Map<string, DeletedTxState> = new Map();
|
|
58
60
|
|
|
61
|
+
/** In-memory tracking: txHash -> slot at which the tx was deleted */
|
|
62
|
+
#slotDeletedTxs: Map<string, SlotNumber> = new Map();
|
|
63
|
+
|
|
64
|
+
/** Persisted set tracking which txs are slot-deleted, for hydration cleanup. */
|
|
65
|
+
#slotDeletedDB: AztecAsyncSet<string>;
|
|
66
|
+
|
|
67
|
+
/** Current slot number, updated by cleanupSlotDeleted */
|
|
68
|
+
#currentSlot: SlotNumber = SlotNumber(0);
|
|
69
|
+
|
|
59
70
|
#log: Logger;
|
|
60
71
|
|
|
61
72
|
constructor(store: AztecAsyncKVStore, txsDB: AztecAsyncMap<string, Buffer>, log: Logger) {
|
|
62
73
|
this.#deletedTxsDB = store.openMap('deleted_txs');
|
|
74
|
+
this.#slotDeletedDB = store.openSet('slot_deleted_txs');
|
|
63
75
|
this.#txsDB = txsDB;
|
|
64
76
|
this.#log = log;
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
/**
|
|
68
80
|
* Loads state from the database on startup.
|
|
81
|
+
* Slot-deleted txs are stale after restart and are immediately hard-deleted.
|
|
69
82
|
*/
|
|
70
83
|
async hydrateFromDatabase(): Promise<void> {
|
|
71
84
|
let prunedCount = 0;
|
|
@@ -83,6 +96,18 @@ export class DeletedPool {
|
|
|
83
96
|
if (prunedCount > 0 || softDeletedCount > 0) {
|
|
84
97
|
this.#log.info(`Loaded ${prunedCount} txs from pruned blocks, ${softDeletedCount} soft-deleted`);
|
|
85
98
|
}
|
|
99
|
+
|
|
100
|
+
// Slot-deleted txs are stale after restart - hard-delete them all
|
|
101
|
+
let slotDeletedCount = 0;
|
|
102
|
+
for await (const txHash of this.#slotDeletedDB.entriesAsync()) {
|
|
103
|
+
await this.#txsDB.delete(txHash);
|
|
104
|
+
await this.#slotDeletedDB.delete(txHash);
|
|
105
|
+
slotDeletedCount++;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (slotDeletedCount > 0) {
|
|
109
|
+
this.#log.info(`Hard-deleted ${slotDeletedCount} stale slot-deleted txs on startup`);
|
|
110
|
+
}
|
|
86
111
|
}
|
|
87
112
|
|
|
88
113
|
/**
|
|
@@ -117,33 +142,31 @@ export class DeletedPool {
|
|
|
117
142
|
}
|
|
118
143
|
|
|
119
144
|
if (count > 0) {
|
|
120
|
-
this.#log.
|
|
145
|
+
this.#log.info(`Marked ${count} transactions from pruned blocks`);
|
|
121
146
|
}
|
|
122
147
|
}
|
|
123
148
|
|
|
124
149
|
/**
|
|
125
150
|
* Deletes a transaction. This is the single entry point for ALL deletions.
|
|
151
|
+
* The tx is always soft-deleted (kept in DB):
|
|
126
152
|
*
|
|
127
|
-
* - If the tx is from a pruned block: soft-delete (
|
|
128
|
-
* - If the tx is NOT from a pruned block:
|
|
129
|
-
*
|
|
130
|
-
* @returns 'soft' if soft-deleted, 'hard' if hard-deleted
|
|
153
|
+
* - If the tx is from a pruned block: prune-soft-delete (kept until finalized)
|
|
154
|
+
* - If the tx is NOT from a pruned block: slot-soft-delete (kept until next slot)
|
|
131
155
|
*/
|
|
132
|
-
async deleteTx(txHash: string): Promise<
|
|
156
|
+
async deleteTx(txHash: string): Promise<void> {
|
|
133
157
|
const existing = this.#state.get(txHash);
|
|
134
158
|
if (existing !== undefined) {
|
|
135
|
-
//
|
|
159
|
+
// Prune-soft-delete - keep in DB until finalized
|
|
136
160
|
const state: DeletedTxState = {
|
|
137
161
|
minedAtBlock: existing.minedAtBlock,
|
|
138
162
|
softDeleted: true,
|
|
139
163
|
};
|
|
140
164
|
this.#state.set(txHash, state);
|
|
141
165
|
await this.#deletedTxsDB.set(txHash, serializeState(state));
|
|
142
|
-
return 'soft';
|
|
143
166
|
} else {
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
167
|
+
// Slot-soft-delete - keep in DB until next slot
|
|
168
|
+
this.#slotDeletedTxs.set(txHash, this.#currentSlot);
|
|
169
|
+
await this.#slotDeletedDB.add(txHash);
|
|
147
170
|
}
|
|
148
171
|
}
|
|
149
172
|
|
|
@@ -176,10 +199,10 @@ export class DeletedPool {
|
|
|
176
199
|
}
|
|
177
200
|
|
|
178
201
|
/**
|
|
179
|
-
* Checks if a transaction is soft-deleted.
|
|
202
|
+
* Checks if a transaction is soft-deleted (either prune-based or slot-based).
|
|
180
203
|
*/
|
|
181
204
|
isSoftDeleted(txHash: string): boolean {
|
|
182
|
-
return this.#state.get(txHash)?.softDeleted ?? false;
|
|
205
|
+
return (this.#state.get(txHash)?.softDeleted ?? false) || this.#slotDeletedTxs.has(txHash);
|
|
183
206
|
}
|
|
184
207
|
|
|
185
208
|
/**
|
|
@@ -214,10 +237,63 @@ export class DeletedPool {
|
|
|
214
237
|
await this.#txsDB.delete(txHash);
|
|
215
238
|
}
|
|
216
239
|
|
|
217
|
-
this.#log.debug(`Finalized ${toHardDelete.length} txs from pruned blocks at block ${finalizedBlockNumber}
|
|
240
|
+
this.#log.debug(`Finalized ${toHardDelete.length} txs from pruned blocks at block ${finalizedBlockNumber}`, {
|
|
241
|
+
txHashes: toHardDelete,
|
|
242
|
+
});
|
|
218
243
|
return toHardDelete;
|
|
219
244
|
}
|
|
220
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Cleans up slot-deleted transactions from previous slots.
|
|
248
|
+
* Called at the start of prepareForSlot. Updates #currentSlot and hard-deletes
|
|
249
|
+
* any txs that were deleted in an earlier slot.
|
|
250
|
+
*/
|
|
251
|
+
async cleanupSlotDeleted(currentSlot: SlotNumber): Promise<void> {
|
|
252
|
+
const previousSlot = this.#currentSlot;
|
|
253
|
+
this.#currentSlot = currentSlot;
|
|
254
|
+
|
|
255
|
+
const toHardDelete: string[] = [];
|
|
256
|
+
for (const [txHash, deletedAtSlot] of this.#slotDeletedTxs) {
|
|
257
|
+
if (deletedAtSlot < currentSlot) {
|
|
258
|
+
toHardDelete.push(txHash);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (toHardDelete.length === 0) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
for (const txHash of toHardDelete) {
|
|
267
|
+
this.#slotDeletedTxs.delete(txHash);
|
|
268
|
+
await this.#slotDeletedDB.delete(txHash);
|
|
269
|
+
await this.#txsDB.delete(txHash);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
this.#log.debug(
|
|
273
|
+
`Cleaned up ${toHardDelete.length} slot-deleted txs from slot ${previousSlot} (now slot ${currentSlot})`,
|
|
274
|
+
{ txHashes: toHardDelete },
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Clears soft-deletion status for a transaction being re-added to the pool.
|
|
280
|
+
* Removes slot-deleted tracking entirely, and resets the prune-soft-deleted flag
|
|
281
|
+
* while preserving the prune tracking itself (so a subsequent delete still uses
|
|
282
|
+
* the prune path).
|
|
283
|
+
*/
|
|
284
|
+
async clearSoftDeleted(txHash: string): Promise<void> {
|
|
285
|
+
if (this.#slotDeletedTxs.has(txHash)) {
|
|
286
|
+
this.#slotDeletedTxs.delete(txHash);
|
|
287
|
+
await this.#slotDeletedDB.delete(txHash);
|
|
288
|
+
}
|
|
289
|
+
const existing = this.#state.get(txHash);
|
|
290
|
+
if (existing?.softDeleted) {
|
|
291
|
+
const state: DeletedTxState = { minedAtBlock: existing.minedAtBlock, softDeleted: false };
|
|
292
|
+
this.#state.set(txHash, state);
|
|
293
|
+
await this.#deletedTxsDB.set(txHash, serializeState(state));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
221
297
|
/**
|
|
222
298
|
* Gets the count of transactions from pruned blocks.
|
|
223
299
|
*/
|
|
@@ -225,6 +301,17 @@ export class DeletedPool {
|
|
|
225
301
|
return this.#state.size;
|
|
226
302
|
}
|
|
227
303
|
|
|
304
|
+
/** Gets the count of soft-deleted transactions (both prune-based and slot-based). */
|
|
305
|
+
getSoftDeletedCount(): number {
|
|
306
|
+
let count = this.#slotDeletedTxs.size;
|
|
307
|
+
for (const state of this.#state.values()) {
|
|
308
|
+
if (state.softDeleted) {
|
|
309
|
+
count++;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return count;
|
|
313
|
+
}
|
|
314
|
+
|
|
228
315
|
/**
|
|
229
316
|
* Gets all transaction hashes from pruned blocks.
|
|
230
317
|
*/
|
|
@@ -9,9 +9,12 @@ import {
|
|
|
9
9
|
EvictionEvent,
|
|
10
10
|
type EvictionRule,
|
|
11
11
|
type PoolOperations,
|
|
12
|
+
type PreAddContext,
|
|
12
13
|
type PreAddPoolAccess,
|
|
13
14
|
type PreAddResult,
|
|
14
15
|
type PreAddRule,
|
|
16
|
+
type TaggedEviction,
|
|
17
|
+
TxPoolRejectionCode,
|
|
15
18
|
} from './interfaces.js';
|
|
16
19
|
|
|
17
20
|
/**
|
|
@@ -47,21 +50,27 @@ export class EvictionManager {
|
|
|
47
50
|
* Runs all pre-add rules for an incoming transaction.
|
|
48
51
|
* Returns combined result of all rules.
|
|
49
52
|
*/
|
|
50
|
-
async runPreAddRules(
|
|
51
|
-
|
|
53
|
+
async runPreAddRules(
|
|
54
|
+
incomingMeta: TxMetaData,
|
|
55
|
+
poolAccess: PreAddPoolAccess,
|
|
56
|
+
context?: PreAddContext,
|
|
57
|
+
): Promise<PreAddResult> {
|
|
58
|
+
const evictions: TaggedEviction[] = [];
|
|
59
|
+
const seen = new Set<string>();
|
|
52
60
|
|
|
53
61
|
for (const rule of this.preAddRules) {
|
|
54
62
|
try {
|
|
55
|
-
const result = await rule.check(incomingMeta, poolAccess);
|
|
63
|
+
const result = await rule.check(incomingMeta, poolAccess, context);
|
|
56
64
|
|
|
57
65
|
if (result.shouldIgnore) {
|
|
58
66
|
return result;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
// Collect txs to evict from all rules
|
|
69
|
+
// Collect txs to evict from all rules, tagged with the rule name
|
|
62
70
|
for (const txHash of result.txHashesToEvict) {
|
|
63
|
-
if (!
|
|
64
|
-
|
|
71
|
+
if (!seen.has(txHash)) {
|
|
72
|
+
seen.add(txHash);
|
|
73
|
+
evictions.push({ txHash, reason: rule.name });
|
|
65
74
|
}
|
|
66
75
|
}
|
|
67
76
|
} catch (err) {
|
|
@@ -70,14 +79,18 @@ export class EvictionManager {
|
|
|
70
79
|
return {
|
|
71
80
|
shouldIgnore: true,
|
|
72
81
|
txHashesToEvict: [],
|
|
73
|
-
reason:
|
|
82
|
+
reason: {
|
|
83
|
+
code: TxPoolRejectionCode.INTERNAL_ERROR,
|
|
84
|
+
message: `Pre-add rule ${rule.name} error: ${err}`,
|
|
85
|
+
},
|
|
74
86
|
};
|
|
75
87
|
}
|
|
76
88
|
}
|
|
77
89
|
|
|
78
90
|
return {
|
|
79
91
|
shouldIgnore: false,
|
|
80
|
-
txHashesToEvict:
|
|
92
|
+
txHashesToEvict: evictions.map(e => e.txHash),
|
|
93
|
+
evictions,
|
|
81
94
|
};
|
|
82
95
|
}
|
|
83
96
|
|
|
@@ -29,12 +29,13 @@ export class FeePayerBalanceEvictionRule implements EvictionRule {
|
|
|
29
29
|
|
|
30
30
|
if (context.event === EvictionEvent.BLOCK_MINED) {
|
|
31
31
|
const blockNumber = context.block.getBlockNumber();
|
|
32
|
-
await
|
|
32
|
+
const blockHash = await context.block.hash();
|
|
33
|
+
await this.worldState.syncImmediate(blockNumber, blockHash);
|
|
33
34
|
return await this.evictForFeePayers(context.feePayers, this.worldState.getSnapshot(blockNumber), pool);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
if (context.event === EvictionEvent.CHAIN_PRUNED) {
|
|
37
|
-
await this.worldState.syncImmediate(
|
|
38
|
+
await this.worldState.syncImmediate();
|
|
38
39
|
const feePayers = pool.getPendingFeePayers();
|
|
39
40
|
return await this.evictForFeePayers(feePayers, this.worldState.getSnapshot(context.blockNumber), pool);
|
|
40
41
|
}
|
|
@@ -67,7 +68,10 @@ export class FeePayerBalanceEvictionRule implements EvictionRule {
|
|
|
67
68
|
).flat();
|
|
68
69
|
|
|
69
70
|
if (txsToEvict.length > 0) {
|
|
70
|
-
await pool.deleteTxs(txsToEvict);
|
|
71
|
+
await pool.deleteTxs(txsToEvict, this.name);
|
|
72
|
+
this.log.debug(`Evicted ${txsToEvict.length} txs due to insufficient fee payer balance`, {
|
|
73
|
+
txHashes: txsToEvict,
|
|
74
|
+
});
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
return {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
2
|
|
|
3
3
|
import { type TxMetaData, comparePriority } from '../tx_metadata.js';
|
|
4
|
-
import
|
|
4
|
+
import {
|
|
5
|
+
type PreAddContext,
|
|
6
|
+
type PreAddPoolAccess,
|
|
7
|
+
type PreAddResult,
|
|
8
|
+
type PreAddRule,
|
|
9
|
+
TxPoolRejectionCode,
|
|
10
|
+
} from './interfaces.js';
|
|
5
11
|
|
|
6
12
|
/**
|
|
7
13
|
* Pre-add rule that checks if a fee payer has sufficient balance to cover the incoming transaction.
|
|
@@ -19,7 +25,7 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
|
|
|
19
25
|
|
|
20
26
|
private log = createLogger('p2p:tx_pool_v2:fee_payer_balance_pre_add_rule');
|
|
21
27
|
|
|
22
|
-
async check(incomingMeta: TxMetaData, poolAccess: PreAddPoolAccess): Promise<PreAddResult> {
|
|
28
|
+
async check(incomingMeta: TxMetaData, poolAccess: PreAddPoolAccess, _context?: PreAddContext): Promise<PreAddResult> {
|
|
23
29
|
// Get fee payer's on-chain balance
|
|
24
30
|
const initialBalance = await poolAccess.getFeePayerBalance(incomingMeta.feePayer);
|
|
25
31
|
|
|
@@ -29,6 +35,7 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
|
|
|
29
35
|
// Create combined list with incoming tx
|
|
30
36
|
const allTxs: Array<{
|
|
31
37
|
txHash: string;
|
|
38
|
+
txHashBigInt: bigint;
|
|
32
39
|
priorityFee: bigint;
|
|
33
40
|
feeLimit: bigint;
|
|
34
41
|
claimAmount: bigint;
|
|
@@ -36,6 +43,7 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
|
|
|
36
43
|
}> = [
|
|
37
44
|
...existingTxs.map(t => ({
|
|
38
45
|
txHash: t.txHash,
|
|
46
|
+
txHashBigInt: t.txHashBigInt,
|
|
39
47
|
priorityFee: t.priorityFee,
|
|
40
48
|
feeLimit: t.feeLimit,
|
|
41
49
|
claimAmount: t.claimAmount,
|
|
@@ -43,6 +51,7 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
|
|
|
43
51
|
})),
|
|
44
52
|
{
|
|
45
53
|
txHash: incomingMeta.txHash,
|
|
54
|
+
txHashBigInt: incomingMeta.txHashBigInt,
|
|
46
55
|
priorityFee: incomingMeta.priorityFee,
|
|
47
56
|
feeLimit: incomingMeta.feeLimit,
|
|
48
57
|
claimAmount: incomingMeta.claimAmount,
|
|
@@ -78,7 +87,13 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
|
|
|
78
87
|
return {
|
|
79
88
|
shouldIgnore: true,
|
|
80
89
|
txHashesToEvict: [],
|
|
81
|
-
reason:
|
|
90
|
+
reason: {
|
|
91
|
+
code: TxPoolRejectionCode.INSUFFICIENT_FEE_PAYER_BALANCE,
|
|
92
|
+
message: `Fee payer ${incomingMeta.feePayer} has insufficient balance. Balance at transaction: ${available}, required: ${incomingMeta.feeLimit}`,
|
|
93
|
+
currentBalance: initialBalance,
|
|
94
|
+
availableBalance: available,
|
|
95
|
+
feeLimit: incomingMeta.feeLimit,
|
|
96
|
+
},
|
|
82
97
|
};
|
|
83
98
|
} else {
|
|
84
99
|
// Existing tx cannot be covered after adding incoming - mark for eviction
|
|
@@ -93,7 +108,6 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
|
|
|
93
108
|
return {
|
|
94
109
|
shouldIgnore: true,
|
|
95
110
|
txHashesToEvict: [],
|
|
96
|
-
reason: 'internal error: tx coverage not determined',
|
|
97
111
|
};
|
|
98
112
|
}
|
|
99
113
|
|
|
@@ -6,9 +6,13 @@ export {
|
|
|
6
6
|
type EvictionResult,
|
|
7
7
|
type EvictionRule,
|
|
8
8
|
type PoolOperations,
|
|
9
|
+
type PreAddContext,
|
|
9
10
|
type PreAddPoolAccess,
|
|
10
11
|
type PreAddResult,
|
|
11
12
|
type PreAddRule,
|
|
13
|
+
type TaggedEviction,
|
|
14
|
+
TxPoolRejectionCode,
|
|
15
|
+
type TxPoolRejectionError,
|
|
12
16
|
} from './interfaces.js';
|
|
13
17
|
|
|
14
18
|
// Pre-add rules
|
|
@@ -67,6 +67,50 @@ export interface PreAddPoolAccess {
|
|
|
67
67
|
getLowestPriorityPendingTx(): TxMetaData | undefined;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/** A single eviction tagged with the rule that caused it. */
|
|
71
|
+
export interface TaggedEviction {
|
|
72
|
+
readonly txHash: string;
|
|
73
|
+
readonly reason: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Machine-readable rejection codes for pre-add rule rejections.
|
|
78
|
+
*/
|
|
79
|
+
export const TxPoolRejectionCode = {
|
|
80
|
+
LOW_PRIORITY_FEE: 'LOW_PRIORITY_FEE',
|
|
81
|
+
INSUFFICIENT_FEE_PAYER_BALANCE: 'INSUFFICIENT_FEE_PAYER_BALANCE',
|
|
82
|
+
NULLIFIER_CONFLICT: 'NULLIFIER_CONFLICT',
|
|
83
|
+
INTERNAL_ERROR: 'INTERNAL_ERROR',
|
|
84
|
+
} as const;
|
|
85
|
+
|
|
86
|
+
export type TxPoolRejectionCode = (typeof TxPoolRejectionCode)[keyof typeof TxPoolRejectionCode];
|
|
87
|
+
|
|
88
|
+
/** Structured rejection reason returned by pre-add rules. */
|
|
89
|
+
export type TxPoolRejectionError =
|
|
90
|
+
| {
|
|
91
|
+
code: typeof TxPoolRejectionCode.LOW_PRIORITY_FEE;
|
|
92
|
+
message: string;
|
|
93
|
+
minimumPriorityFee: bigint;
|
|
94
|
+
txPriorityFee: bigint;
|
|
95
|
+
}
|
|
96
|
+
| {
|
|
97
|
+
code: typeof TxPoolRejectionCode.INSUFFICIENT_FEE_PAYER_BALANCE;
|
|
98
|
+
message: string;
|
|
99
|
+
currentBalance: bigint;
|
|
100
|
+
availableBalance: bigint;
|
|
101
|
+
feeLimit: bigint;
|
|
102
|
+
}
|
|
103
|
+
| {
|
|
104
|
+
code: typeof TxPoolRejectionCode.NULLIFIER_CONFLICT;
|
|
105
|
+
message: string;
|
|
106
|
+
conflictingTxHash: string;
|
|
107
|
+
/** Minimum fee needed to replace the conflicting tx (only set when price bump applies). */
|
|
108
|
+
minimumPriceBumpFee?: bigint;
|
|
109
|
+
/** Incoming tx's priority fee. */
|
|
110
|
+
txPriorityFee?: bigint;
|
|
111
|
+
}
|
|
112
|
+
| { code: typeof TxPoolRejectionCode.INTERNAL_ERROR; message: string };
|
|
113
|
+
|
|
70
114
|
/**
|
|
71
115
|
* Result of a pre-add check for a single transaction.
|
|
72
116
|
*/
|
|
@@ -75,8 +119,18 @@ export interface PreAddResult {
|
|
|
75
119
|
readonly shouldIgnore: boolean;
|
|
76
120
|
/** Tx hashes (as strings) that should be evicted if this tx is added */
|
|
77
121
|
readonly txHashesToEvict: string[];
|
|
122
|
+
/** Evictions tagged with the rule name that produced them. Populated by EvictionManager. */
|
|
123
|
+
readonly evictions?: TaggedEviction[];
|
|
78
124
|
/** Optional reason for ignoring */
|
|
79
|
-
readonly reason?:
|
|
125
|
+
readonly reason?: TxPoolRejectionError;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Context passed to pre-add rules from addPendingTxs. */
|
|
129
|
+
export interface PreAddContext {
|
|
130
|
+
/** If true, compare priority fee only (no tx hash tiebreaker). Used for RPC submissions. */
|
|
131
|
+
feeComparisonOnly?: boolean;
|
|
132
|
+
/** Percentage-based price bump required for tx replacement. Only set for RPC submissions. */
|
|
133
|
+
priceBumpPercentage?: bigint;
|
|
80
134
|
}
|
|
81
135
|
|
|
82
136
|
/**
|
|
@@ -90,9 +144,10 @@ export interface PreAddRule {
|
|
|
90
144
|
* Check if incoming tx should be added and which existing txs to evict.
|
|
91
145
|
* @param incomingMeta - Metadata for the incoming transaction
|
|
92
146
|
* @param poolAccess - Read-only access to current pool state
|
|
147
|
+
* @param context - Optional context from addPendingTxs caller
|
|
93
148
|
* @returns Result indicating whether to ignore and what to evict
|
|
94
149
|
*/
|
|
95
|
-
check(incomingMeta: TxMetaData, poolAccess: PreAddPoolAccess): Promise<PreAddResult>;
|
|
150
|
+
check(incomingMeta: TxMetaData, poolAccess: PreAddPoolAccess, context?: PreAddContext): Promise<PreAddResult>;
|
|
96
151
|
|
|
97
152
|
/**
|
|
98
153
|
* Updates the configuration for this rule.
|
|
@@ -120,8 +175,8 @@ export interface PoolOperations {
|
|
|
120
175
|
/** Get the N lowest priority pending tx hashes */
|
|
121
176
|
getLowestPriorityPending(limit: number): string[];
|
|
122
177
|
|
|
123
|
-
/** Delete transactions by hash */
|
|
124
|
-
deleteTxs(txHashes: string[]): Promise<void>;
|
|
178
|
+
/** Delete transactions by hash, with an optional reason for metrics */
|
|
179
|
+
deleteTxs(txHashes: string[], reason?: string): Promise<void>;
|
|
125
180
|
}
|
|
126
181
|
|
|
127
182
|
/**
|
|
@@ -35,15 +35,14 @@ export class InvalidTxsAfterMiningRule implements EvictionRule {
|
|
|
35
35
|
for (const meta of pendingTxs) {
|
|
36
36
|
// Evict pending txs that share nullifiers with mined txs
|
|
37
37
|
if (meta.nullifiers.some(nullifier => minedNullifiers.has(nullifier))) {
|
|
38
|
-
this.log.verbose(`Evicting tx ${meta.txHash} from pool due to a duplicate nullifier with a mined tx`);
|
|
39
38
|
txsToEvict.push(meta.txHash);
|
|
40
39
|
continue;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
// Evict pending txs with an expiration timestamp less than or equal to the mined block timestamp
|
|
44
|
-
if (meta.
|
|
43
|
+
if (meta.expirationTimestamp <= timestamp) {
|
|
45
44
|
this.log.verbose(
|
|
46
|
-
`Evicting tx ${meta.txHash} from pool due to the tx being expired (
|
|
45
|
+
`Evicting tx ${meta.txHash} from pool due to the tx being expired (expirationTimestamp: ${meta.expirationTimestamp}, mined block timestamp: ${timestamp})`,
|
|
47
46
|
);
|
|
48
47
|
txsToEvict.push(meta.txHash);
|
|
49
48
|
continue;
|
|
@@ -51,10 +50,11 @@ export class InvalidTxsAfterMiningRule implements EvictionRule {
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
if (txsToEvict.length > 0) {
|
|
54
|
-
|
|
53
|
+
this.log.info(`Evicted ${txsToEvict.length} invalid txs after block mined`);
|
|
54
|
+
await pool.deleteTxs(txsToEvict, this.name);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
this.log.debug(`Evicted ${txsToEvict.length} invalid txs after block mined
|
|
57
|
+
this.log.debug(`Evicted ${txsToEvict.length} invalid txs after block mined`, { txHashes: txsToEvict });
|
|
58
58
|
|
|
59
59
|
return {
|
|
60
60
|
reason: 'block_mined_invalid_txs',
|