@aztec/p2p 0.0.1-commit.f2ce05ee → 0.0.1-commit.f5d02921e
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 +9 -9
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +52 -14
- package/dest/client/interface.d.ts +47 -34
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +39 -51
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +164 -224
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +20 -10
- package/dest/config.d.ts +52 -16
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +100 -37
- 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 +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +21 -12
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +75 -40
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +57 -57
- package/dest/mem_pools/attestation_pool/index.d.ts +2 -2
- package/dest/mem_pools/attestation_pool/index.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/index.js +1 -1
- 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 +2 -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/interface.d.ts +3 -3
- package/dest/mem_pools/interface.d.ts.map +1 -1
- 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 +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 +7 -5
- 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 +3 -2
- package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/index.js +2 -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 +30 -12
- 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 +78 -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 +144 -19
- 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 +364 -189
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +1 -1
- package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
- package/dest/msg_validators/attestation_validator/attestation_validator.js +5 -4
- package/dest/msg_validators/clock_tolerance.d.ts +1 -1
- package/dest/msg_validators/clock_tolerance.d.ts.map +1 -1
- package/dest/msg_validators/clock_tolerance.js +4 -3
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +6 -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 +6 -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 +13 -8
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator.js +53 -41
- 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/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/block_header_validator.d.ts +16 -3
- package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/block_header_validator.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/double_spend_validator.d.ts +13 -3
- package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/double_spend_validator.js +4 -4
- 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 +104 -37
- 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 +20 -4
- 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/dummy_service.d.ts +12 -6
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +12 -5
- package/dest/services/encoding.d.ts +7 -3
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +18 -11
- package/dest/services/gossipsub/topic_score_params.d.ts +18 -6
- package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
- package/dest/services/gossipsub/topic_score_params.js +32 -10
- package/dest/services/libp2p/libp2p_service.d.ts +37 -23
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +274 -173
- 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 +24 -9
- package/dest/services/peer-manager/peer_scoring.d.ts +5 -2
- package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_scoring.js +28 -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/interface.d.ts +10 -1
- package/dest/services/reqresp/interface.d.ts.map +1 -1
- package/dest/services/reqresp/interface.js +15 -1
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +3 -3
- package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -1
- package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +7 -1
- 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 +15 -0
- 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/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/reqresp.d.ts +1 -1
- package/dest/services/reqresp/reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/reqresp.js +30 -14
- package/dest/services/service.d.ts +26 -4
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/config.d.ts +19 -1
- package/dest/services/tx_collection/config.d.ts.map +1 -1
- package/dest/services/tx_collection/config.js +46 -0
- package/dest/services/tx_collection/fast_tx_collection.d.ts +3 -4
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.js +80 -76
- 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 +38 -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 +100 -0
- package/dest/services/tx_collection/index.d.ts +2 -1
- package/dest/services/tx_collection/index.d.ts.map +1 -1
- package/dest/services/tx_collection/index.js +1 -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 +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 +7 -3
- 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 +23 -13
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_collection.js +75 -3
- 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 +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/config.d.ts +1 -3
- package/dest/services/tx_file_store/config.d.ts.map +1 -1
- package/dest/services/tx_file_store/config.js +0 -4
- package/dest/services/tx_file_store/tx_file_store.d.ts +4 -3
- package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -1
- package/dest/services/tx_file_store/tx_file_store.js +9 -6
- package/dest/services/tx_provider.d.ts +4 -4
- package/dest/services/tx_provider.d.ts.map +1 -1
- package/dest/services/tx_provider.js +9 -8
- 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 +2 -2
- package/dest/test-helpers/testbench-utils.d.ts +35 -24
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +115 -38
- 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 +57 -27
- package/dest/testbench/worker_client_manager.d.ts +3 -1
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +6 -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 +102 -25
- package/src/client/interface.ts +52 -34
- package/src/client/p2p_client.ts +190 -266
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +33 -14
- package/src/config.ts +149 -43
- package/src/errors/p2p-service.error.ts +11 -0
- package/src/errors/tx-pool.error.ts +12 -0
- package/src/index.ts +1 -1
- package/src/mem_pools/attestation_pool/attestation_pool.ts +104 -50
- package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +61 -57
- package/src/mem_pools/attestation_pool/index.ts +3 -3
- package/src/mem_pools/attestation_pool/mocks.ts +2 -1
- package/src/mem_pools/index.ts +1 -1
- package/src/mem_pools/instrumentation.ts +17 -13
- package/src/mem_pools/interface.ts +2 -2
- package/src/mem_pools/tx_pool_v2/README.md +85 -11
- package/src/mem_pools/tx_pool_v2/deleted_pool.ts +321 -0
- 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 +5 -5
- 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 +2 -1
- package/src/mem_pools/tx_pool_v2/instrumentation.ts +69 -0
- package/src/mem_pools/tx_pool_v2/interfaces.ts +32 -12
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +209 -27
- 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 +410 -187
- package/src/msg_validators/attestation_validator/README.md +49 -0
- package/src/msg_validators/attestation_validator/attestation_validator.ts +5 -4
- package/src/msg_validators/clock_tolerance.ts +4 -3
- package/src/msg_validators/proposal_validator/README.md +123 -0
- package/src/msg_validators/proposal_validator/block_proposal_validator.ts +14 -4
- package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +20 -7
- package/src/msg_validators/proposal_validator/proposal_validator.ts +69 -45
- package/src/msg_validators/tx_validator/README.md +119 -0
- package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +5 -5
- 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/block_header_validator.ts +15 -3
- 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/double_spend_validator.ts +11 -6
- 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 +123 -27
- 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 +23 -18
- package/src/services/dummy_service.ts +18 -7
- package/src/services/encoding.ts +18 -10
- package/src/services/gossipsub/README.md +29 -14
- package/src/services/gossipsub/topic_score_params.ts +49 -13
- package/src/services/libp2p/libp2p_service.ts +288 -198
- package/src/services/peer-manager/metrics.ts +7 -0
- package/src/services/peer-manager/peer_manager.ts +28 -9
- package/src/services/peer-manager/peer_scoring.ts +21 -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/interface.ts +26 -1
- package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +2 -2
- package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +17 -0
- package/src/services/reqresp/protocols/tx.ts +22 -0
- package/src/services/reqresp/rate-limiter/rate_limiter.ts +13 -9
- package/src/services/reqresp/reqresp.ts +35 -15
- package/src/services/service.ts +37 -3
- package/src/services/tx_collection/config.ts +68 -0
- package/src/services/tx_collection/fast_tx_collection.ts +83 -76
- package/src/services/tx_collection/file_store_tx_collection.ts +202 -0
- package/src/services/tx_collection/file_store_tx_source.ts +129 -0
- package/src/services/tx_collection/index.ts +1 -0
- 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 +66 -33
- package/src/services/tx_collection/tx_collection.ts +114 -19
- package/src/services/tx_collection/tx_collection_sink.ts +30 -34
- package/src/services/tx_collection/tx_source.ts +28 -8
- package/src/services/tx_file_store/config.ts +0 -6
- package/src/services/tx_file_store/tx_file_store.ts +10 -8
- package/src/services/tx_provider.ts +10 -9
- package/src/test-helpers/make-test-p2p-clients.ts +4 -6
- package/src/test-helpers/mock-pubsub.ts +146 -9
- package/src/test-helpers/reqresp-nodes.ts +3 -6
- package/src/test-helpers/testbench-utils.ts +137 -43
- package/src/testbench/p2p_client_testbench_worker.ts +63 -30
- package/src/testbench/worker_client_manager.ts +13 -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/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
|
@@ -19,13 +19,17 @@ export type TryAddResult = {
|
|
|
19
19
|
added: boolean;
|
|
20
20
|
/** Whether the exact item already existed */
|
|
21
21
|
alreadyExists: boolean;
|
|
22
|
-
/**
|
|
23
|
-
|
|
22
|
+
/** Count of items for the position. Meaning varies by method:
|
|
23
|
+
* - tryAddBlockProposal: proposals at (slot, indexWithinCheckpoint)
|
|
24
|
+
* - tryAddCheckpointProposal: proposals at slot
|
|
25
|
+
* - tryAddCheckpointAttestation: attestations by this signer for this slot */
|
|
26
|
+
count: number;
|
|
24
27
|
};
|
|
25
28
|
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
|
|
29
|
+
export const MAX_CHECKPOINT_PROPOSALS_PER_SLOT = 2;
|
|
30
|
+
export const MAX_BLOCK_PROPOSALS_PER_POSITION = 2;
|
|
31
|
+
/** Maximum attestations a single signer can make per slot before being rejected. */
|
|
32
|
+
export const MAX_ATTESTATIONS_PER_SLOT_AND_SIGNER = 2;
|
|
29
33
|
|
|
30
34
|
/** Public API interface for attestation pools. Used for typing mocks and test implementations. */
|
|
31
35
|
export type AttestationPoolApi = Pick<
|
|
@@ -39,6 +43,7 @@ export type AttestationPoolApi = Pick<
|
|
|
39
43
|
| 'deleteOlderThan'
|
|
40
44
|
| 'getCheckpointAttestationsForSlot'
|
|
41
45
|
| 'getCheckpointAttestationsForSlotAndProposal'
|
|
46
|
+
| 'hasBlockProposalsForSlot'
|
|
42
47
|
| 'isEmpty'
|
|
43
48
|
>;
|
|
44
49
|
|
|
@@ -69,6 +74,10 @@ export class AttestationPool {
|
|
|
69
74
|
// Key: (slot << 10) | indexWithinCheckpoint, Value: archive string
|
|
70
75
|
private blockProposalsForSlotAndIndex: AztecAsyncMultiMap<number, string>;
|
|
71
76
|
|
|
77
|
+
// Checkpoint attestations indexed by (slot, signer) for tracking attestations per (slot, signer) for duplicate detection
|
|
78
|
+
// Key: `${Fr(slot).toString()}-${signerAddress}` string (padded for lexicographic ordering), Value: `proposalId` strings
|
|
79
|
+
private checkpointAttestationsPerSlotAndSigner: AztecAsyncMultiMap<string, string>;
|
|
80
|
+
|
|
72
81
|
constructor(
|
|
73
82
|
private store: AztecAsyncKVStore,
|
|
74
83
|
telemetry: TelemetryClient = getTelemetryClient(),
|
|
@@ -80,6 +89,7 @@ export class AttestationPool {
|
|
|
80
89
|
|
|
81
90
|
// Initialize checkpoint attestations storage
|
|
82
91
|
this.checkpointAttestations = store.openMap('checkpoint_attestations');
|
|
92
|
+
this.checkpointAttestationsPerSlotAndSigner = store.openMultiMap('checkpoint_attestations_per_slot_and_signer');
|
|
83
93
|
|
|
84
94
|
// Initialize checkpoint proposal storage
|
|
85
95
|
this.checkpointProposals = store.openMap('checkpoint_proposals');
|
|
@@ -133,6 +143,12 @@ export class AttestationPool {
|
|
|
133
143
|
return { start: `${proposalKey}-`, end: `${proposalKey}-Z` };
|
|
134
144
|
}
|
|
135
145
|
|
|
146
|
+
/** Creates a key for the per-signer-per-slot attestation index. Uses padded slot for lexicographic ordering. */
|
|
147
|
+
private getSlotSignerKey(slot: SlotNumber, signerAddress: string): string {
|
|
148
|
+
const slotStr = new Fr(slot).toString();
|
|
149
|
+
return `${slotStr}-${signerAddress}`;
|
|
150
|
+
}
|
|
151
|
+
|
|
136
152
|
/** Number of bits reserved for indexWithinCheckpoint in position keys. */
|
|
137
153
|
private static readonly INDEX_BITS = 10;
|
|
138
154
|
/** Maximum indexWithinCheckpoint value (2^10 - 1 = 1023). */
|
|
@@ -166,21 +182,21 @@ export class AttestationPool {
|
|
|
166
182
|
// Check if already exists
|
|
167
183
|
const alreadyExists = await this.blockProposals.hasAsync(proposalId);
|
|
168
184
|
if (alreadyExists) {
|
|
169
|
-
const
|
|
185
|
+
const count = await this.getBlockProposalCountForPosition(
|
|
170
186
|
blockProposal.slotNumber,
|
|
171
187
|
blockProposal.indexWithinCheckpoint,
|
|
172
188
|
);
|
|
173
|
-
return { added: false, alreadyExists: true,
|
|
189
|
+
return { added: false, alreadyExists: true, count };
|
|
174
190
|
}
|
|
175
191
|
|
|
176
192
|
// Get current count for position and check cap, do not add if exceeded
|
|
177
|
-
const
|
|
193
|
+
const count = await this.getBlockProposalCountForPosition(
|
|
178
194
|
blockProposal.slotNumber,
|
|
179
195
|
blockProposal.indexWithinCheckpoint,
|
|
180
196
|
);
|
|
181
197
|
|
|
182
|
-
if (
|
|
183
|
-
return { added: false, alreadyExists: false,
|
|
198
|
+
if (count >= MAX_BLOCK_PROPOSALS_PER_POSITION) {
|
|
199
|
+
return { added: false, alreadyExists: false, count };
|
|
184
200
|
}
|
|
185
201
|
|
|
186
202
|
// Add the proposal
|
|
@@ -195,7 +211,7 @@ export class AttestationPool {
|
|
|
195
211
|
},
|
|
196
212
|
);
|
|
197
213
|
|
|
198
|
-
return { added: true, alreadyExists: false,
|
|
214
|
+
return { added: true, alreadyExists: false, count: count + 1 };
|
|
199
215
|
});
|
|
200
216
|
}
|
|
201
217
|
|
|
@@ -239,6 +255,13 @@ export class AttestationPool {
|
|
|
239
255
|
return undefined;
|
|
240
256
|
}
|
|
241
257
|
|
|
258
|
+
/** Checks if any block proposals exist for a given slot (at index 0). */
|
|
259
|
+
public async hasBlockProposalsForSlot(slot: SlotNumber): Promise<boolean> {
|
|
260
|
+
const positionKey = this.getBlockPositionKey(slot, 0);
|
|
261
|
+
const count = await this.blockProposalsForSlotAndIndex.getValueCountAsync(positionKey);
|
|
262
|
+
return count > 0;
|
|
263
|
+
}
|
|
264
|
+
|
|
242
265
|
/**
|
|
243
266
|
* Attempts to add a checkpoint proposal to the pool.
|
|
244
267
|
*
|
|
@@ -255,20 +278,20 @@ export class AttestationPool {
|
|
|
255
278
|
* @returns Result indicating whether the proposal was added and duplicate detection info
|
|
256
279
|
*/
|
|
257
280
|
public async tryAddCheckpointProposal(proposal: CheckpointProposalCore): Promise<TryAddResult> {
|
|
258
|
-
|
|
281
|
+
const result = await this.store.transactionAsync(async () => {
|
|
259
282
|
const proposalId = proposal.archive.toString();
|
|
260
283
|
|
|
261
284
|
// Check if already exists
|
|
262
285
|
const alreadyExists = await this.checkpointProposals.hasAsync(proposalId);
|
|
263
286
|
if (alreadyExists) {
|
|
264
|
-
const
|
|
265
|
-
return { added: false, alreadyExists: true,
|
|
287
|
+
const count = await this.checkpointProposalsForSlot.getValueCountAsync(proposal.slotNumber);
|
|
288
|
+
return { added: false, alreadyExists: true, count };
|
|
266
289
|
}
|
|
267
290
|
|
|
268
291
|
// Get current count for slot and check cap
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
271
|
-
return { added: false, alreadyExists: false,
|
|
292
|
+
const count = await this.checkpointProposalsForSlot.getValueCountAsync(proposal.slotNumber);
|
|
293
|
+
if (count >= MAX_CHECKPOINT_PROPOSALS_PER_SLOT) {
|
|
294
|
+
return { added: false, alreadyExists: false, count };
|
|
272
295
|
}
|
|
273
296
|
|
|
274
297
|
// Add the proposal if cap not exceeded
|
|
@@ -279,8 +302,10 @@ export class AttestationPool {
|
|
|
279
302
|
slotNumber: proposal.slotNumber,
|
|
280
303
|
});
|
|
281
304
|
|
|
282
|
-
return { added: true, alreadyExists: false,
|
|
305
|
+
return { added: true, alreadyExists: false, count: count + 1 };
|
|
283
306
|
});
|
|
307
|
+
|
|
308
|
+
return result;
|
|
284
309
|
}
|
|
285
310
|
|
|
286
311
|
/** Internal method - must be called within a transaction. */
|
|
@@ -322,7 +347,7 @@ export class AttestationPool {
|
|
|
322
347
|
await this.store.transactionAsync(async () => {
|
|
323
348
|
for (const attestation of attestations) {
|
|
324
349
|
const slotNumber = attestation.payload.header.slotNumber;
|
|
325
|
-
const proposalId = attestation.archive;
|
|
350
|
+
const proposalId = attestation.archive.toString();
|
|
326
351
|
const sender = attestation.getSender();
|
|
327
352
|
|
|
328
353
|
// Skip attestations with invalid signatures
|
|
@@ -336,11 +361,10 @@ export class AttestationPool {
|
|
|
336
361
|
}
|
|
337
362
|
|
|
338
363
|
const address = sender.toString();
|
|
364
|
+
const ownKey = this.getAttestationKey(slotNumber, proposalId, address);
|
|
339
365
|
|
|
340
|
-
await this.checkpointAttestations.set(
|
|
341
|
-
|
|
342
|
-
attestation.toBuffer(),
|
|
343
|
-
);
|
|
366
|
+
await this.checkpointAttestations.set(ownKey, attestation.toBuffer());
|
|
367
|
+
this.metrics.trackMempoolItemAdded(ownKey);
|
|
344
368
|
|
|
345
369
|
this.log.debug(`Added own checkpoint attestation for slot ${slotNumber} from ${address}`, {
|
|
346
370
|
signature: attestation.signature.toString(),
|
|
@@ -406,9 +430,18 @@ export class AttestationPool {
|
|
|
406
430
|
const attestationEndKey = new Fr(oldestSlot).toString();
|
|
407
431
|
for await (const key of this.checkpointAttestations.keysAsync({ end: attestationEndKey })) {
|
|
408
432
|
await this.checkpointAttestations.delete(key);
|
|
433
|
+
this.metrics.trackMempoolItemRemoved(key);
|
|
409
434
|
numberOfAttestations++;
|
|
410
435
|
}
|
|
411
436
|
|
|
437
|
+
// Clean up per-signer-per-slot index. Keys are formatted as `${Fr(slot).toString()}-${signerAddress}`.
|
|
438
|
+
// Since Fr pads to fixed-width hex, Fr(oldestSlot) is lexicographically greater than any key with
|
|
439
|
+
// a smaller slot (even with the signer suffix), so using it as the exclusive end bound is correct.
|
|
440
|
+
const slotSignerEndKey = new Fr(oldestSlot).toString();
|
|
441
|
+
for await (const key of this.checkpointAttestationsPerSlotAndSigner.keysAsync({ end: slotSignerEndKey })) {
|
|
442
|
+
await this.checkpointAttestationsPerSlotAndSigner.delete(key);
|
|
443
|
+
}
|
|
444
|
+
|
|
412
445
|
// Delete checkpoint proposals for slots < oldestSlot, using checkpointProposalsForSlot as index
|
|
413
446
|
for await (const slot of this.checkpointProposalsForSlot.keysAsync({ end: oldestSlot })) {
|
|
414
447
|
const proposalIds = await toArray(this.checkpointProposalsForSlot.getValuesAsync(slot));
|
|
@@ -445,61 +478,82 @@ export class AttestationPool {
|
|
|
445
478
|
*
|
|
446
479
|
* This method performs validation and addition in a single call:
|
|
447
480
|
* - Checks if the attestation already exists (returns alreadyExists: true if so)
|
|
448
|
-
* - Checks if
|
|
481
|
+
* - Checks if this signer has reached the per-signer attestation cap for this slot
|
|
449
482
|
* - Adds the attestation if validation passes
|
|
450
483
|
*
|
|
451
484
|
* @param attestation - The checkpoint attestation to add
|
|
452
|
-
* @
|
|
453
|
-
*
|
|
485
|
+
* @returns Result indicating whether the attestation was added, existence info, and count of
|
|
486
|
+
* attestations by this signer for this slot (for equivocation detection)
|
|
454
487
|
*/
|
|
455
|
-
public async tryAddCheckpointAttestation(
|
|
456
|
-
attestation: CheckpointAttestation,
|
|
457
|
-
committeeSize: number,
|
|
458
|
-
): Promise<TryAddResult> {
|
|
488
|
+
public async tryAddCheckpointAttestation(attestation: CheckpointAttestation): Promise<TryAddResult> {
|
|
459
489
|
const slotNumber = attestation.payload.header.slotNumber;
|
|
460
490
|
const proposalId = attestation.archive.toString();
|
|
461
491
|
const sender = attestation.getSender();
|
|
462
492
|
|
|
463
493
|
if (!sender) {
|
|
464
|
-
return { added: false, alreadyExists: false,
|
|
494
|
+
return { added: false, alreadyExists: false, count: 0 };
|
|
465
495
|
}
|
|
466
496
|
|
|
497
|
+
const signerAddress = sender.toString();
|
|
498
|
+
|
|
467
499
|
return await this.store.transactionAsync(async () => {
|
|
468
|
-
const key = this.getAttestationKey(slotNumber, proposalId,
|
|
500
|
+
const key = this.getAttestationKey(slotNumber, proposalId, signerAddress);
|
|
469
501
|
const alreadyExists = await this.checkpointAttestations.hasAsync(key);
|
|
470
502
|
|
|
503
|
+
// Get count of attestations by this signer for this slot (for duplicate detection)
|
|
504
|
+
const signerAttestationCount = await this.getSignerAttestationCountForSlot(slotNumber, signerAddress);
|
|
505
|
+
|
|
471
506
|
if (alreadyExists) {
|
|
472
|
-
|
|
473
|
-
|
|
507
|
+
return {
|
|
508
|
+
added: false,
|
|
509
|
+
alreadyExists: true,
|
|
510
|
+
count: signerAttestationCount,
|
|
511
|
+
};
|
|
474
512
|
}
|
|
475
513
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
514
|
+
// Check if this signer has exceeded the per-signer cap for this slot
|
|
515
|
+
if (signerAttestationCount >= MAX_ATTESTATIONS_PER_SLOT_AND_SIGNER) {
|
|
516
|
+
this.log.debug(`Rejecting attestation: signer ${signerAddress} exceeded per-slot cap for slot ${slotNumber}`, {
|
|
517
|
+
slotNumber,
|
|
518
|
+
signerAddress,
|
|
519
|
+
proposalId,
|
|
520
|
+
signerAttestationCount,
|
|
521
|
+
});
|
|
522
|
+
return {
|
|
523
|
+
added: false,
|
|
524
|
+
alreadyExists: false,
|
|
525
|
+
count: signerAttestationCount,
|
|
526
|
+
};
|
|
481
527
|
}
|
|
482
528
|
|
|
529
|
+
// Add the attestation
|
|
483
530
|
await this.checkpointAttestations.set(key, attestation.toBuffer());
|
|
531
|
+
this.metrics.trackMempoolItemAdded(key);
|
|
532
|
+
|
|
533
|
+
// Track this attestation in the per-signer-per-slot index for duplicate detection
|
|
534
|
+
const slotSignerKey = this.getSlotSignerKey(slotNumber, signerAddress);
|
|
535
|
+
await this.checkpointAttestationsPerSlotAndSigner.set(slotSignerKey, proposalId);
|
|
484
536
|
|
|
485
|
-
this.log.debug(`Added checkpoint attestation for slot ${slotNumber} from ${
|
|
537
|
+
this.log.debug(`Added checkpoint attestation for slot ${slotNumber} from ${signerAddress}`, {
|
|
486
538
|
signature: attestation.signature.toString(),
|
|
487
539
|
slotNumber,
|
|
488
|
-
address:
|
|
540
|
+
address: signerAddress,
|
|
489
541
|
proposalId,
|
|
490
542
|
});
|
|
491
|
-
|
|
543
|
+
|
|
544
|
+
// Return the new count
|
|
545
|
+
return {
|
|
546
|
+
added: true,
|
|
547
|
+
alreadyExists: false,
|
|
548
|
+
count: signerAttestationCount + 1,
|
|
549
|
+
};
|
|
492
550
|
});
|
|
493
551
|
}
|
|
494
552
|
|
|
495
|
-
/** Gets the count of attestations for a given
|
|
496
|
-
private async
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
for await (const _ of this.checkpointAttestations.keysAsync(range)) {
|
|
500
|
-
count++;
|
|
501
|
-
}
|
|
502
|
-
return count;
|
|
553
|
+
/** Gets the count of attestations by a specific signer for a given slot. */
|
|
554
|
+
private async getSignerAttestationCountForSlot(slot: SlotNumber, signerAddress: string): Promise<number> {
|
|
555
|
+
const slotSignerKey = this.getSlotSignerKey(slot, signerAddress);
|
|
556
|
+
return await this.checkpointAttestationsPerSlotAndSigner.getValueCountAsync(slotSignerKey);
|
|
503
557
|
}
|
|
504
558
|
}
|
|
505
559
|
|
|
@@ -10,7 +10,11 @@ import {
|
|
|
10
10
|
makeCheckpointProposal,
|
|
11
11
|
} from '@aztec/stdlib/testing';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
type AttestationPool,
|
|
15
|
+
MAX_BLOCK_PROPOSALS_PER_POSITION,
|
|
16
|
+
MAX_CHECKPOINT_PROPOSALS_PER_SLOT,
|
|
17
|
+
} from './attestation_pool.js';
|
|
14
18
|
import { mockCheckpointAttestation } from './mocks.js';
|
|
15
19
|
|
|
16
20
|
const NUMBER_OF_SIGNERS_PER_TEST = 4;
|
|
@@ -191,7 +195,7 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
191
195
|
|
|
192
196
|
expect(result.added).toBe(true);
|
|
193
197
|
expect(result.alreadyExists).toBe(false);
|
|
194
|
-
expect(result.
|
|
198
|
+
expect(result.count).toBe(1);
|
|
195
199
|
|
|
196
200
|
const retrievedProposal = await ap.getBlockProposal(proposalId);
|
|
197
201
|
|
|
@@ -258,7 +262,7 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
258
262
|
|
|
259
263
|
expect(result.added).toBe(true);
|
|
260
264
|
expect(result.alreadyExists).toBe(false);
|
|
261
|
-
expect(result.
|
|
265
|
+
expect(result.count).toBe(1);
|
|
262
266
|
|
|
263
267
|
const retrievedProposal = await ap.getCheckpointProposal(proposalId);
|
|
264
268
|
|
|
@@ -324,12 +328,12 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
324
328
|
it('should return added=false when exceeding capacity', async () => {
|
|
325
329
|
const slotNumber = 420;
|
|
326
330
|
|
|
327
|
-
// Add
|
|
328
|
-
for (let i = 0; i <
|
|
331
|
+
// Add MAX_CHECKPOINT_PROPOSALS_PER_SLOT proposals
|
|
332
|
+
for (let i = 0; i < MAX_CHECKPOINT_PROPOSALS_PER_SLOT; i++) {
|
|
329
333
|
const proposal = await mockCheckpointProposalForPool(signers[i % NUMBER_OF_SIGNERS_PER_TEST], slotNumber);
|
|
330
334
|
const result = await ap.tryAddCheckpointProposal(proposal);
|
|
331
335
|
expect(result.added).toBe(true);
|
|
332
|
-
expect(result.
|
|
336
|
+
expect(result.count).toBe(i + 1);
|
|
333
337
|
}
|
|
334
338
|
|
|
335
339
|
// The next proposal should not be added
|
|
@@ -337,7 +341,7 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
337
341
|
const result = await ap.tryAddCheckpointProposal(extraProposal);
|
|
338
342
|
expect(result.added).toBe(false);
|
|
339
343
|
expect(result.alreadyExists).toBe(false);
|
|
340
|
-
expect(result.
|
|
344
|
+
expect(result.count).toBe(MAX_CHECKPOINT_PROPOSALS_PER_SLOT);
|
|
341
345
|
});
|
|
342
346
|
});
|
|
343
347
|
|
|
@@ -358,13 +362,13 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
358
362
|
};
|
|
359
363
|
|
|
360
364
|
describe('tryAddBlockProposal duplicate detection', () => {
|
|
361
|
-
it('should return
|
|
365
|
+
it('should return count=1 when pool is empty', async () => {
|
|
362
366
|
const proposal = await mockBlockProposalWithIndex(signers[0], 100, 0);
|
|
363
367
|
const result = await ap.tryAddBlockProposal(proposal);
|
|
364
368
|
|
|
365
369
|
expect(result.added).toBe(true);
|
|
366
370
|
expect(result.alreadyExists).toBe(false);
|
|
367
|
-
expect(result.
|
|
371
|
+
expect(result.count).toBe(1);
|
|
368
372
|
});
|
|
369
373
|
|
|
370
374
|
it('should return alreadyExists when same proposal exists', async () => {
|
|
@@ -375,17 +379,17 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
375
379
|
|
|
376
380
|
expect(result.added).toBe(false);
|
|
377
381
|
expect(result.alreadyExists).toBe(true);
|
|
378
|
-
expect(result.
|
|
382
|
+
expect(result.count).toBe(1);
|
|
379
383
|
});
|
|
380
384
|
|
|
381
|
-
it('should detect duplicate via
|
|
385
|
+
it('should detect duplicate via count when different proposal exists at same position', async () => {
|
|
382
386
|
const slotNumber = 100;
|
|
383
387
|
const indexWithinCheckpoint = 2;
|
|
384
388
|
|
|
385
389
|
// Add first proposal
|
|
386
390
|
const proposal1 = await mockBlockProposalWithIndex(signers[0], slotNumber, indexWithinCheckpoint);
|
|
387
391
|
const result1 = await ap.tryAddBlockProposal(proposal1);
|
|
388
|
-
expect(result1.
|
|
392
|
+
expect(result1.count).toBe(1);
|
|
389
393
|
|
|
390
394
|
// Add a different proposal at same position - this is a duplicate (equivocation)
|
|
391
395
|
const proposal2 = await mockBlockProposalWithIndex(signers[1], slotNumber, indexWithinCheckpoint);
|
|
@@ -393,8 +397,8 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
393
397
|
|
|
394
398
|
expect(result2.added).toBe(true);
|
|
395
399
|
expect(result2.alreadyExists).toBe(false);
|
|
396
|
-
//
|
|
397
|
-
expect(result2.
|
|
400
|
+
// count >= 2 indicates duplicate detection
|
|
401
|
+
expect(result2.count).toBe(2);
|
|
398
402
|
});
|
|
399
403
|
|
|
400
404
|
it('should not detect duplicate for different positions in same slot', async () => {
|
|
@@ -409,8 +413,8 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
409
413
|
const result = await ap.tryAddBlockProposal(proposal2);
|
|
410
414
|
|
|
411
415
|
expect(result.added).toBe(true);
|
|
412
|
-
//
|
|
413
|
-
expect(result.
|
|
416
|
+
// count = 1 means no duplicate for this position
|
|
417
|
+
expect(result.count).toBe(1);
|
|
414
418
|
});
|
|
415
419
|
|
|
416
420
|
it('should not detect duplicate for same position in different slots', async () => {
|
|
@@ -425,37 +429,37 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
425
429
|
const result = await ap.tryAddBlockProposal(proposal2);
|
|
426
430
|
|
|
427
431
|
expect(result.added).toBe(true);
|
|
428
|
-
//
|
|
429
|
-
expect(result.
|
|
432
|
+
// count = 1 means no duplicate for this position
|
|
433
|
+
expect(result.count).toBe(1);
|
|
430
434
|
});
|
|
431
435
|
|
|
432
|
-
it('should track multiple duplicates correctly via
|
|
436
|
+
it('should track multiple duplicates correctly via count', async () => {
|
|
433
437
|
const slotNumber = 100;
|
|
434
438
|
const indexWithinCheckpoint = 0;
|
|
435
439
|
|
|
436
440
|
// Add multiple proposals for same position
|
|
437
441
|
const proposal1 = await mockBlockProposalWithIndex(signers[0], slotNumber, indexWithinCheckpoint);
|
|
438
442
|
const result1 = await ap.tryAddBlockProposal(proposal1);
|
|
439
|
-
expect(result1.
|
|
443
|
+
expect(result1.count).toBe(1);
|
|
440
444
|
|
|
441
445
|
const proposal2 = await mockBlockProposalWithIndex(signers[1], slotNumber, indexWithinCheckpoint);
|
|
442
446
|
const result2 = await ap.tryAddBlockProposal(proposal2);
|
|
443
|
-
expect(result2.
|
|
447
|
+
expect(result2.count).toBe(2);
|
|
444
448
|
|
|
445
|
-
//
|
|
449
|
+
// Third proposal for same position should be rejected (cap is 2)
|
|
446
450
|
const proposal3 = await mockBlockProposalWithIndex(signers[2], slotNumber, indexWithinCheckpoint);
|
|
447
451
|
const result3 = await ap.tryAddBlockProposal(proposal3);
|
|
448
452
|
|
|
449
|
-
expect(result3.added).toBe(
|
|
450
|
-
expect(result3.
|
|
453
|
+
expect(result3.added).toBe(false);
|
|
454
|
+
expect(result3.count).toBe(2);
|
|
451
455
|
});
|
|
452
456
|
|
|
453
457
|
it('should return added=false when exceeding capacity', async () => {
|
|
454
458
|
const slotNumber = 100;
|
|
455
459
|
const indexWithinCheckpoint = 0;
|
|
456
460
|
|
|
457
|
-
// Add
|
|
458
|
-
for (let i = 0; i <
|
|
461
|
+
// Add MAX_BLOCK_PROPOSALS_PER_POSITION proposals
|
|
462
|
+
for (let i = 0; i < MAX_BLOCK_PROPOSALS_PER_POSITION; i++) {
|
|
459
463
|
const proposal = await mockBlockProposalWithIndex(
|
|
460
464
|
signers[i % NUMBER_OF_SIGNERS_PER_TEST],
|
|
461
465
|
slotNumber,
|
|
@@ -463,7 +467,7 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
463
467
|
);
|
|
464
468
|
const result = await ap.tryAddBlockProposal(proposal);
|
|
465
469
|
expect(result.added).toBe(true);
|
|
466
|
-
expect(result.
|
|
470
|
+
expect(result.count).toBe(i + 1);
|
|
467
471
|
}
|
|
468
472
|
|
|
469
473
|
// The next proposal should not be added
|
|
@@ -471,7 +475,7 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
471
475
|
const result = await ap.tryAddBlockProposal(extraProposal);
|
|
472
476
|
expect(result.added).toBe(false);
|
|
473
477
|
expect(result.alreadyExists).toBe(false);
|
|
474
|
-
expect(result.
|
|
478
|
+
expect(result.count).toBe(MAX_BLOCK_PROPOSALS_PER_POSITION);
|
|
475
479
|
});
|
|
476
480
|
|
|
477
481
|
it('should clean up block position index when deleting old data', async () => {
|
|
@@ -482,18 +486,18 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
482
486
|
const proposal1 = await mockBlockProposalWithIndex(signers[0], slotNumber, indexWithinCheckpoint);
|
|
483
487
|
await ap.tryAddBlockProposal(proposal1);
|
|
484
488
|
|
|
485
|
-
// Verify it's tracked (adding another should show
|
|
489
|
+
// Verify it's tracked (adding another should show count = 2)
|
|
486
490
|
const proposal2 = await mockBlockProposalWithIndex(signers[1], slotNumber, indexWithinCheckpoint);
|
|
487
491
|
let result = await ap.tryAddBlockProposal(proposal2);
|
|
488
|
-
expect(result.
|
|
492
|
+
expect(result.count).toBe(2);
|
|
489
493
|
|
|
490
494
|
// Delete old data
|
|
491
495
|
await ap.deleteOlderThan(SlotNumber(slotNumber + 1));
|
|
492
496
|
|
|
493
|
-
// Verify position index is cleaned up (
|
|
497
|
+
// Verify position index is cleaned up (count should be 1 now)
|
|
494
498
|
const proposal3 = await mockBlockProposalWithIndex(signers[2], slotNumber, indexWithinCheckpoint);
|
|
495
499
|
result = await ap.tryAddBlockProposal(proposal3);
|
|
496
|
-
expect(result.
|
|
500
|
+
expect(result.count).toBe(1);
|
|
497
501
|
});
|
|
498
502
|
|
|
499
503
|
it('should correctly delete block proposals at slot boundary', async () => {
|
|
@@ -514,16 +518,16 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
514
518
|
// Slot 99 proposals should have their index cleaned up
|
|
515
519
|
const newProposal99 = await mockBlockProposalWithIndex(signers[0], 99, 0);
|
|
516
520
|
const result99 = await ap.tryAddBlockProposal(newProposal99);
|
|
517
|
-
expect(result99.
|
|
521
|
+
expect(result99.count).toBe(1); // Index was cleaned up
|
|
518
522
|
|
|
519
523
|
// Slot 100 and 101 should still be tracked
|
|
520
524
|
const newProposal100 = await mockBlockProposalWithIndex(signers[1], 100, 0);
|
|
521
525
|
const result100 = await ap.tryAddBlockProposal(newProposal100);
|
|
522
|
-
expect(result100.
|
|
526
|
+
expect(result100.count).toBe(2); // Still has the original
|
|
523
527
|
|
|
524
528
|
const newProposal101 = await mockBlockProposalWithIndex(signers[2], 101, 0);
|
|
525
529
|
const result101 = await ap.tryAddBlockProposal(newProposal101);
|
|
526
|
-
expect(result101.
|
|
530
|
+
expect(result101.count).toBe(2); // Still has the original
|
|
527
531
|
});
|
|
528
532
|
|
|
529
533
|
it('should delete all indices for a given slot', async () => {
|
|
@@ -544,15 +548,15 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
544
548
|
// All indices should be cleaned up
|
|
545
549
|
const newProposal0 = await mockBlockProposalWithIndex(signers[0], slotNumber, 0);
|
|
546
550
|
const result0 = await ap.tryAddBlockProposal(newProposal0);
|
|
547
|
-
expect(result0.
|
|
551
|
+
expect(result0.count).toBe(1);
|
|
548
552
|
|
|
549
553
|
const newProposal1 = await mockBlockProposalWithIndex(signers[1], slotNumber, 1);
|
|
550
554
|
const result1 = await ap.tryAddBlockProposal(newProposal1);
|
|
551
|
-
expect(result1.
|
|
555
|
+
expect(result1.count).toBe(1);
|
|
552
556
|
|
|
553
557
|
const newProposal2 = await mockBlockProposalWithIndex(signers[2], slotNumber, 2);
|
|
554
558
|
const result2 = await ap.tryAddBlockProposal(newProposal2);
|
|
555
|
-
expect(result2.
|
|
559
|
+
expect(result2.count).toBe(1);
|
|
556
560
|
});
|
|
557
561
|
|
|
558
562
|
it('should delete block proposals from storage when deleting old data', async () => {
|
|
@@ -598,13 +602,13 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
598
602
|
return proposal.toCore();
|
|
599
603
|
};
|
|
600
604
|
|
|
601
|
-
it('should return
|
|
605
|
+
it('should return count=1 when pool is empty', async () => {
|
|
602
606
|
const proposal = await mockCheckpointProposalCoreForPool(signers[0], 100);
|
|
603
607
|
const result = await ap.tryAddCheckpointProposal(proposal);
|
|
604
608
|
|
|
605
609
|
expect(result.added).toBe(true);
|
|
606
610
|
expect(result.alreadyExists).toBe(false);
|
|
607
|
-
expect(result.
|
|
611
|
+
expect(result.count).toBe(1);
|
|
608
612
|
});
|
|
609
613
|
|
|
610
614
|
it('should return alreadyExists when same proposal exists', async () => {
|
|
@@ -615,16 +619,16 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
615
619
|
|
|
616
620
|
expect(result.added).toBe(false);
|
|
617
621
|
expect(result.alreadyExists).toBe(true);
|
|
618
|
-
expect(result.
|
|
622
|
+
expect(result.count).toBe(1);
|
|
619
623
|
});
|
|
620
624
|
|
|
621
|
-
it('should detect duplicate via
|
|
625
|
+
it('should detect duplicate via count when different proposal exists for same slot', async () => {
|
|
622
626
|
const slotNumber = 100;
|
|
623
627
|
|
|
624
628
|
// Add first proposal
|
|
625
629
|
const proposal1 = await mockCheckpointProposalCoreForPool(signers[0], slotNumber);
|
|
626
630
|
const result1 = await ap.tryAddCheckpointProposal(proposal1);
|
|
627
|
-
expect(result1.
|
|
631
|
+
expect(result1.count).toBe(1);
|
|
628
632
|
|
|
629
633
|
// Add a different proposal for same slot - this is a duplicate (equivocation)
|
|
630
634
|
const proposal2 = await mockCheckpointProposalCoreForPool(signers[1], slotNumber);
|
|
@@ -632,8 +636,8 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
632
636
|
|
|
633
637
|
expect(result2.added).toBe(true);
|
|
634
638
|
expect(result2.alreadyExists).toBe(false);
|
|
635
|
-
//
|
|
636
|
-
expect(result2.
|
|
639
|
+
// count >= 2 indicates duplicate detection
|
|
640
|
+
expect(result2.count).toBe(2);
|
|
637
641
|
});
|
|
638
642
|
|
|
639
643
|
it('should not detect duplicate for different slots', async () => {
|
|
@@ -646,28 +650,28 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
646
650
|
const result = await ap.tryAddCheckpointProposal(proposal2);
|
|
647
651
|
|
|
648
652
|
expect(result.added).toBe(true);
|
|
649
|
-
//
|
|
650
|
-
expect(result.
|
|
653
|
+
// count = 1 means no duplicate for this slot
|
|
654
|
+
expect(result.count).toBe(1);
|
|
651
655
|
});
|
|
652
656
|
|
|
653
|
-
it('should track multiple duplicates correctly via
|
|
657
|
+
it('should track multiple duplicates correctly via count', async () => {
|
|
654
658
|
const slotNumber = 100;
|
|
655
659
|
|
|
656
660
|
// Add multiple proposals for same slot
|
|
657
661
|
const proposal1 = await mockCheckpointProposalCoreForPool(signers[0], slotNumber);
|
|
658
662
|
const result1 = await ap.tryAddCheckpointProposal(proposal1);
|
|
659
|
-
expect(result1.
|
|
663
|
+
expect(result1.count).toBe(1);
|
|
660
664
|
|
|
661
665
|
const proposal2 = await mockCheckpointProposalCoreForPool(signers[1], slotNumber);
|
|
662
666
|
const result2 = await ap.tryAddCheckpointProposal(proposal2);
|
|
663
|
-
expect(result2.
|
|
667
|
+
expect(result2.count).toBe(2);
|
|
664
668
|
|
|
665
|
-
//
|
|
669
|
+
// Third proposal for same slot should be rejected (cap is 2)
|
|
666
670
|
const proposal3 = await mockCheckpointProposalCoreForPool(signers[2], slotNumber);
|
|
667
671
|
const result3 = await ap.tryAddCheckpointProposal(proposal3);
|
|
668
672
|
|
|
669
|
-
expect(result3.added).toBe(
|
|
670
|
-
expect(result3.
|
|
673
|
+
expect(result3.added).toBe(false);
|
|
674
|
+
expect(result3.count).toBe(2);
|
|
671
675
|
});
|
|
672
676
|
|
|
673
677
|
it('should not count attestations as proposals for duplicate detection', async () => {
|
|
@@ -684,8 +688,8 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
684
688
|
|
|
685
689
|
expect(result.added).toBe(true);
|
|
686
690
|
expect(result.alreadyExists).toBe(false);
|
|
687
|
-
//
|
|
688
|
-
expect(result.
|
|
691
|
+
// count should be 1, NOT 2 - attestations should not count as proposals
|
|
692
|
+
expect(result.count).toBe(1);
|
|
689
693
|
});
|
|
690
694
|
|
|
691
695
|
it('should not count attestations for different proposals as duplicates', async () => {
|
|
@@ -703,14 +707,14 @@ export function describeAttestationPool(getAttestationPool: () => AttestationPoo
|
|
|
703
707
|
const result1 = await ap.tryAddCheckpointProposal(proposal1);
|
|
704
708
|
|
|
705
709
|
expect(result1.added).toBe(true);
|
|
706
|
-
expect(result1.
|
|
710
|
+
expect(result1.count).toBe(1);
|
|
707
711
|
|
|
708
712
|
// Add the second checkpoint proposal - this IS a duplicate (different archive, same slot)
|
|
709
713
|
const proposal2 = await mockCheckpointProposalCoreForPool(signers[3], slotNumber, archive2);
|
|
710
714
|
const result2 = await ap.tryAddCheckpointProposal(proposal2);
|
|
711
715
|
|
|
712
716
|
expect(result2.added).toBe(true);
|
|
713
|
-
expect(result2.
|
|
717
|
+
expect(result2.count).toBe(2);
|
|
714
718
|
});
|
|
715
719
|
});
|
|
716
720
|
});
|
|
@@ -3,7 +3,7 @@ export {
|
|
|
3
3
|
type AttestationPoolApi,
|
|
4
4
|
type TryAddResult,
|
|
5
5
|
createTestAttestationPool,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
MAX_CHECKPOINT_PROPOSALS_PER_SLOT,
|
|
7
|
+
MAX_BLOCK_PROPOSALS_PER_POSITION,
|
|
8
|
+
MAX_ATTESTATIONS_PER_SLOT_AND_SIGNER,
|
|
9
9
|
} from './attestation_pool.js';
|