@aztec/p2p 0.0.1-commit.4ad48494d → 0.0.1-commit.4eabbdb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/client/factory.d.ts +3 -2
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +3 -2
- package/dest/client/interface.d.ts +7 -9
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +4 -7
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +38 -14
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +5 -5
- package/dest/config.d.ts +3 -2
- package/dest/config.d.ts.map +1 -1
- 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/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/tx_pool/eviction/invalid_txs_after_mining_rule.js +3 -3
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +3 -1
- package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/deleted_pool.js +9 -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.js +2 -2
- 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 +10 -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 +48 -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 +4 -4
- package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +3 -3
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +1 -1
- 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 +6 -4
- 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 +14 -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 +2 -2
- 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 +10 -2
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.js +2 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +7 -5
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +29 -5
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +5 -2
- 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 +12 -2
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +5 -2
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +6 -5
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +10 -4
- 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 +135 -37
- 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/dummy_service.d.ts +3 -2
- package/dest/services/dummy_service.d.ts.map +1 -1
- package/dest/services/dummy_service.js +3 -0
- package/dest/services/encoding.d.ts +1 -1
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +2 -1
- 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 +2 -1
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +7 -3
- package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +4 -3
- 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 +5 -9
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts +2 -6
- package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
- package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +10 -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 +25 -46
- package/dest/services/service.d.ts +4 -2
- package/dest/services/service.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.d.ts +1 -1
- package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/fast_tx_collection.js +39 -33
- package/dest/services/tx_collection/file_store_tx_collection.d.ts +1 -1
- package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/file_store_tx_collection.js +4 -2
- package/dest/services/tx_collection/file_store_tx_source.d.ts +15 -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 +47 -16
- 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/missing_txs_tracker.d.ts +32 -0
- package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +1 -0
- package/dest/services/tx_collection/missing_txs_tracker.js +27 -0
- package/dest/services/tx_collection/proposal_tx_collector.d.ts +7 -6
- 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/slow_tx_collection.d.ts +2 -2
- package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
- package/dest/services/tx_collection/slow_tx_collection.js +10 -8
- package/dest/services/tx_collection/tx_collection.d.ts +5 -4
- package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
- 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 +8 -3
- package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
- package/dest/services/tx_collection/tx_source.js +19 -2
- package/dest/services/tx_file_store/tx_file_store.js +1 -1
- package/dest/test-helpers/mock-pubsub.d.ts +3 -2
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +6 -0
- package/dest/test-helpers/testbench-utils.d.ts +5 -2
- package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
- package/dest/test-helpers/testbench-utils.js +1 -1
- 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 +8 -8
- package/dest/util.d.ts +2 -2
- package/dest/util.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/client/factory.ts +5 -2
- package/src/client/interface.ts +14 -9
- package/src/client/p2p_client.ts +44 -17
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +18 -8
- package/src/config.ts +1 -1
- package/src/errors/tx-pool.error.ts +12 -0
- package/src/mem_pools/attestation_pool/mocks.ts +2 -1
- package/src/mem_pools/tx_pool/README.md +1 -1
- package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/README.md +1 -1
- package/src/mem_pools/tx_pool_v2/deleted_pool.ts +11 -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 +2 -2
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +15 -4
- package/src/mem_pools/tx_pool_v2/eviction/index.ts +4 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +49 -4
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +4 -4
- package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +6 -7
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +24 -6
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +3 -3
- package/src/mem_pools/tx_pool_v2/instrumentation.ts +69 -0
- package/src/mem_pools/tx_pool_v2/interfaces.ts +8 -2
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +40 -9
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +14 -3
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +11 -6
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +157 -29
- package/src/msg_validators/tx_validator/timestamp_validator.ts +7 -7
- package/src/services/dummy_service.ts +5 -1
- package/src/services/encoding.ts +2 -1
- 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 +7 -2
- package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +6 -6
- package/src/services/reqresp/batch-tx-requester/interface.ts +1 -5
- package/src/services/reqresp/batch-tx-requester/missing_txs.ts +23 -71
- package/src/services/service.ts +10 -1
- package/src/services/tx_collection/fast_tx_collection.ts +51 -30
- package/src/services/tx_collection/file_store_tx_collection.ts +7 -3
- package/src/services/tx_collection/file_store_tx_source.ts +61 -17
- package/src/services/tx_collection/instrumentation.ts +7 -1
- package/src/services/tx_collection/missing_txs_tracker.ts +52 -0
- package/src/services/tx_collection/proposal_tx_collector.ts +8 -7
- package/src/services/tx_collection/slow_tx_collection.ts +8 -9
- package/src/services/tx_collection/tx_collection.ts +4 -3
- package/src/services/tx_collection/tx_collection_sink.ts +15 -29
- package/src/services/tx_collection/tx_source.ts +22 -3
- package/src/services/tx_file_store/tx_file_store.ts +1 -1
- package/src/test-helpers/mock-pubsub.ts +10 -0
- package/src/test-helpers/testbench-utils.ts +2 -2
- package/src/testbench/p2p_client_testbench_worker.ts +20 -13
- package/src/util.ts +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testbench-utils.d.ts","sourceRoot":"","sources":["../../src/test-helpers/testbench-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAe,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAGtE;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,YAAa,YAAW,QAAQ;IAClE,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,MAAM,CAAuB;IAErC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE9B;IAED,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,MAAM,CAGxB;IAED,SAAS,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,MAAM,CAU3B;IAED,QAAQ,IAAI,IAAI,CAEf;IAED,UAAU,IAAI,IAAI,CAGjB;IAID,aAAa,CAA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O,MAAM,uBAAuB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAGjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAC9B,kEAAkE;;IAElE,gDAAgD;;IAEhD,8CAA8C;;IAE9C,mCAAmC;;IAEnC,kDAAkD;;IAElD,8BAA8B;;IAE9B,gFAAgF;;IAEhF,oDAAoD;;IAEpD,4CAA4C;;IAE5C,qDAAqD;;IAErD,gEAAgE;;CAExD,CAAC;AAEX;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,EAAE,EAAE,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,mBAAmB,EACjC,eAAe,GAAE,MAAU,GAC1B,EAAE,EAAE,CAsBN;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE"}
|
|
@@ -101,7 +101,7 @@ import { RateLimitStatus } from '../services/reqresp/rate-limiter/rate_limiter.j
|
|
|
101
101
|
prepareForSlot(_slotNumber) {
|
|
102
102
|
return Promise.resolve();
|
|
103
103
|
}
|
|
104
|
-
handlePrunedBlocks(_latestBlock) {
|
|
104
|
+
handlePrunedBlocks(_latestBlock, _options) {
|
|
105
105
|
return Promise.resolve();
|
|
106
106
|
}
|
|
107
107
|
handleFailedExecution(txHashes) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CollectorType, type DistributionPattern } from '../test-helpers/
|
|
1
|
+
import { type CollectorType, type DistributionPattern } from '../test-helpers/index.js';
|
|
2
2
|
export type { DistributionPattern, CollectorType } from '../test-helpers/testbench-utils.js';
|
|
3
3
|
export { COLLECTOR_DISPLAY_NAMES } from '../test-helpers/testbench-utils.js';
|
|
4
4
|
export interface BenchReqRespCommand {
|
|
@@ -25,4 +25,4 @@ export interface BenchResultMessage {
|
|
|
25
25
|
export interface BenchReadyMessage {
|
|
26
26
|
type: 'BENCH_READY';
|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FBVSxFQUFFLE1BQU0sQ0FBQztJQUNuQixZQUFZLEVBQUUsTUFBTSxDQUFDO0lBQ3JCLE9BQU8sRUFBRSxPQUFPLENBQUM7SUFDakIsS0FBSyxDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ2hCO0FBRUQsTUFBTSxXQUFXLGlCQUFpQjtJQUNoQyxJQUFJLEVBQUUsYUFBYSxDQUFDO0NBQ3JCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_client_testbench_worker.d.ts","sourceRoot":"","sources":["../../src/testbench/p2p_client_testbench_worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"p2p_client_testbench_worker.d.ts","sourceRoot":"","sources":["../../src/testbench/p2p_client_testbench_worker.ts"],"names":[],"mappings":"AA4CA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAOzB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,mBAAmB,CAAC;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,CAAC;CACrB"}
|
|
@@ -21,11 +21,11 @@ import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
|
21
21
|
import { TopicValidatorResult } from '@libp2p/interface';
|
|
22
22
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
23
23
|
import { createP2PClient } from '../index.js';
|
|
24
|
-
import { LibP2PService } from '../services/
|
|
24
|
+
import { BatchTxRequesterCollector, LibP2PService, SendBatchRequestCollector } from '../services/index.js';
|
|
25
25
|
import { RateLimitStatus } from '../services/reqresp/rate-limiter/rate_limiter.js';
|
|
26
|
-
import {
|
|
27
|
-
import { AlwaysTrueCircuitVerifier } from '../test-helpers/
|
|
28
|
-
import { BENCHMARK_CONSTANTS, InMemoryAttestationPool, InMemoryTxPool, UNLIMITED_RATE_LIMIT_QUOTA, createMockEpochCache, createMockWorldStateSynchronizer, filterTxsByDistribution } from '../test-helpers/
|
|
26
|
+
import { MissingTxsTracker } from '../services/tx_collection/missing_txs_tracker.js';
|
|
27
|
+
import { AlwaysTrueCircuitVerifier } from '../test-helpers/index.js';
|
|
28
|
+
import { BENCHMARK_CONSTANTS, InMemoryAttestationPool, InMemoryTxPool, UNLIMITED_RATE_LIMIT_QUOTA, createMockEpochCache, createMockWorldStateSynchronizer, filterTxsByDistribution } from '../test-helpers/index.js';
|
|
29
29
|
export { COLLECTOR_DISPLAY_NAMES } from '../test-helpers/testbench-utils.js';
|
|
30
30
|
const txCache = new Map();
|
|
31
31
|
class TestLibP2PService extends LibP2PService {
|
|
@@ -70,7 +70,7 @@ async function generateDeterministicTxs(txCount, seed, config) {
|
|
|
70
70
|
if (cached.length >= txCount) {
|
|
71
71
|
return cached.slice(0, txCount);
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const expirationTimestampBase = BigInt(seed);
|
|
74
74
|
for(let i = cached.length; i < txCount; i++){
|
|
75
75
|
const txSeed = seed * 10000 + i;
|
|
76
76
|
const tx = await mockTx(txSeed, {
|
|
@@ -86,7 +86,7 @@ async function generateDeterministicTxs(txCount, seed, config) {
|
|
|
86
86
|
hasPublicTeardownCallRequest: false,
|
|
87
87
|
publicCalldataSize: 0
|
|
88
88
|
});
|
|
89
|
-
tx.data.
|
|
89
|
+
tx.data.expirationTimestamp = expirationTimestampBase + BigInt(i);
|
|
90
90
|
await tx.recomputeHash();
|
|
91
91
|
cached.push(tx);
|
|
92
92
|
}
|
|
@@ -154,7 +154,7 @@ async function runAggregatorBenchmark(client, blockProposal, collectorType, time
|
|
|
154
154
|
timer = new Timer();
|
|
155
155
|
if (collectorType === 'batch-requester') {
|
|
156
156
|
const collector = new BatchTxRequesterCollector(batchTxRequesterService, logger, new DateProvider(), noopTxValidator);
|
|
157
|
-
const fetchedTxs = await collector.collectTxs(txHashes, blockProposal, pinnedPeer, timeoutMs);
|
|
157
|
+
const fetchedTxs = await collector.collectTxs(MissingTxsTracker.fromArray(txHashes), blockProposal, pinnedPeer, timeoutMs);
|
|
158
158
|
const durationMs = timer.ms();
|
|
159
159
|
return {
|
|
160
160
|
type: 'BENCH_RESULT',
|
|
@@ -164,7 +164,7 @@ async function runAggregatorBenchmark(client, blockProposal, collectorType, time
|
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
const collector = new SendBatchRequestCollector(batchTxRequesterService, BENCHMARK_CONSTANTS.FIXED_MAX_PEERS, BENCHMARK_CONSTANTS.FIXED_MAX_RETRY_ATTEMPTS);
|
|
167
|
-
const fetchedTxs = await collector.collectTxs(txHashes, blockProposal, pinnedPeer, timeoutMs);
|
|
167
|
+
const fetchedTxs = await collector.collectTxs(MissingTxsTracker.fromArray(txHashes), blockProposal, pinnedPeer, timeoutMs);
|
|
168
168
|
const durationMs = timer.ms();
|
|
169
169
|
return {
|
|
170
170
|
type: 'BENCH_RESULT',
|
package/dest/util.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Libp2p } from 'libp2p';
|
|
|
10
10
|
import type { P2PConfig } from './config.js';
|
|
11
11
|
export interface PubSubLibp2p extends Pick<Libp2p, 'status' | 'start' | 'stop' | 'peerId'> {
|
|
12
12
|
services: {
|
|
13
|
-
pubsub: Pick<GossipSub, 'addEventListener' | 'removeEventListener' | 'publish' | 'subscribe' | 'reportMessageValidationResult' | 'direct'> & {
|
|
13
|
+
pubsub: Pick<GossipSub, 'addEventListener' | 'removeEventListener' | 'publish' | 'subscribe' | 'reportMessageValidationResult' | 'direct' | 'getMeshPeers'> & {
|
|
14
14
|
score: Pick<GossipSub['score'], 'score'>;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -58,4 +58,4 @@ export declare function getPeerIdPrivateKey(config: {
|
|
|
58
58
|
* @returns The peer ID.
|
|
59
59
|
*/
|
|
60
60
|
export declare function createLibP2PPeerIdFromPrivateKey(privateKey: string): Promise<PeerId>;
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3V0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ3ZELE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUF1QixNQUFNLGlCQUFpQixDQUFDO0FBQzlFLE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRTlELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRTdELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRS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CAAC,MAAM,CAAC,CAAC;IAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EACzG,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CA2D9B;AAED;;;;GAIG;AACH,wBAAsB,gCAAgC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS1F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/p2p",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.4eabbdb",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/constants": "0.0.1-commit.
|
|
71
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
72
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
73
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
74
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
75
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
77
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
78
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
79
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
80
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
70
|
+
"@aztec/constants": "0.0.1-commit.4eabbdb",
|
|
71
|
+
"@aztec/epoch-cache": "0.0.1-commit.4eabbdb",
|
|
72
|
+
"@aztec/ethereum": "0.0.1-commit.4eabbdb",
|
|
73
|
+
"@aztec/foundation": "0.0.1-commit.4eabbdb",
|
|
74
|
+
"@aztec/kv-store": "0.0.1-commit.4eabbdb",
|
|
75
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.4eabbdb",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.4eabbdb",
|
|
77
|
+
"@aztec/protocol-contracts": "0.0.1-commit.4eabbdb",
|
|
78
|
+
"@aztec/simulator": "0.0.1-commit.4eabbdb",
|
|
79
|
+
"@aztec/stdlib": "0.0.1-commit.4eabbdb",
|
|
80
|
+
"@aztec/telemetry-client": "0.0.1-commit.4eabbdb",
|
|
81
81
|
"@chainsafe/libp2p-gossipsub": "13.0.0",
|
|
82
82
|
"@chainsafe/libp2p-noise": "^15.0.0",
|
|
83
83
|
"@chainsafe/libp2p-yamux": "^6.0.2",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"xxhash-wasm": "^1.1.0"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
108
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
107
|
+
"@aztec/archiver": "0.0.1-commit.4eabbdb",
|
|
108
|
+
"@aztec/world-state": "0.0.1-commit.4eabbdb",
|
|
109
109
|
"@jest/globals": "^30.0.0",
|
|
110
110
|
"@types/jest": "^30.0.0",
|
|
111
111
|
"@types/node": "^22.15.17",
|
package/src/client/factory.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { AztecLMDBStoreV2, createStore } from '@aztec/kv-store/lmdb-v2';
|
|
|
7
7
|
import type { BlockHash, L2BlockSource } from '@aztec/stdlib/block';
|
|
8
8
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
9
9
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
10
|
-
import type { ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
10
|
+
import type { AztecNode, ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
11
11
|
import { P2PClientType } from '@aztec/stdlib/p2p';
|
|
12
12
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
13
13
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -26,7 +26,7 @@ import { DummyP2PService } from '../services/dummy_service.js';
|
|
|
26
26
|
import { LibP2PService } from '../services/index.js';
|
|
27
27
|
import { createFileStoreTxSources } from '../services/tx_collection/file_store_tx_source.js';
|
|
28
28
|
import { TxCollection } from '../services/tx_collection/tx_collection.js';
|
|
29
|
-
import { type TxSource, createNodeRpcTxSources } from '../services/tx_collection/tx_source.js';
|
|
29
|
+
import { NodeRpcTxSource, type TxSource, createNodeRpcTxSources } from '../services/tx_collection/tx_source.js';
|
|
30
30
|
import { TxFileStore } from '../services/tx_file_store/tx_file_store.js';
|
|
31
31
|
import { configureP2PClientAddresses, createLibP2PPeerIdFromPrivateKey, getPeerIdPrivateKey } from '../util.js';
|
|
32
32
|
|
|
@@ -36,6 +36,7 @@ export type P2PClientDeps<T extends P2PClientType> = {
|
|
|
36
36
|
attestationPool?: AttestationPoolApi;
|
|
37
37
|
logger?: Logger;
|
|
38
38
|
txCollectionNodeSources?: TxSource[];
|
|
39
|
+
rpcTxProviders?: AztecNode[];
|
|
39
40
|
p2pServiceFactory?: (...args: Parameters<(typeof LibP2PService)['new']>) => Promise<LibP2PService<T>>;
|
|
40
41
|
};
|
|
41
42
|
|
|
@@ -147,6 +148,7 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
147
148
|
|
|
148
149
|
const nodeSources = [
|
|
149
150
|
...createNodeRpcTxSources(config.txCollectionNodeRpcUrls, config),
|
|
151
|
+
...(deps.rpcTxProviders ?? []).map((node, i) => new NodeRpcTxSource(node, `node-rpc-provider-${i}`)),
|
|
150
152
|
...(deps.txCollectionNodeSources ?? []),
|
|
151
153
|
];
|
|
152
154
|
if (nodeSources.length > 0) {
|
|
@@ -159,6 +161,7 @@ export async function createP2PClient<T extends P2PClientType>(
|
|
|
159
161
|
config.txCollectionFileStoreUrls,
|
|
160
162
|
txFileStoreBasePath,
|
|
161
163
|
logger.createChild('file-store-tx-source'),
|
|
164
|
+
telemetry,
|
|
162
165
|
);
|
|
163
166
|
if (fileStoreSources.length > 0) {
|
|
164
167
|
logger.info(`Using ${fileStoreSources.length} file store sources for tx collection.`, {
|
package/src/client/interface.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { EthAddress, L2BlockId } from '@aztec/stdlib/block';
|
|
3
|
-
import type { P2PApiFull } from '@aztec/stdlib/interfaces/server';
|
|
4
|
-
import type {
|
|
3
|
+
import type { ITxProvider, P2PApiFull } from '@aztec/stdlib/interfaces/server';
|
|
4
|
+
import type {
|
|
5
|
+
BlockProposal,
|
|
6
|
+
CheckpointAttestation,
|
|
7
|
+
CheckpointProposal,
|
|
8
|
+
P2PClientType,
|
|
9
|
+
TopicType,
|
|
10
|
+
} from '@aztec/stdlib/p2p';
|
|
5
11
|
import type { BlockHeader, Tx, TxHash } from '@aztec/stdlib/tx';
|
|
6
12
|
|
|
7
13
|
import type { PeerId } from '@libp2p/interface';
|
|
@@ -107,13 +113,6 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
107
113
|
**/
|
|
108
114
|
sendTx(tx: Tx): Promise<void>;
|
|
109
115
|
|
|
110
|
-
/**
|
|
111
|
-
* Adds transactions to the pool. Does not send to peers or validate the tx.
|
|
112
|
-
* @param txs - The transactions.
|
|
113
|
-
* @returns The number of txs added to the pool. Note if the transaction already exists, it will not be added again.
|
|
114
|
-
**/
|
|
115
|
-
addTxsToPool(txs: Tx[]): Promise<number>;
|
|
116
|
-
|
|
117
116
|
/**
|
|
118
117
|
* Handles failed transaction execution by removing txs from the pool.
|
|
119
118
|
* @param txHashes - Hashes of the transactions that failed execution.
|
|
@@ -220,6 +219,9 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
220
219
|
/** Identifies a p2p client. */
|
|
221
220
|
isP2PClient(): true;
|
|
222
221
|
|
|
222
|
+
/** Returns the tx provider used for fetching transactions. */
|
|
223
|
+
getTxProvider(): ITxProvider;
|
|
224
|
+
|
|
223
225
|
updateP2PConfig(config: Partial<P2PConfig>): Promise<void>;
|
|
224
226
|
|
|
225
227
|
/** Validates a set of txs. */
|
|
@@ -241,4 +243,7 @@ export type P2P<T extends P2PClientType = P2PClientType.Full> = P2PApiFull<T> &
|
|
|
241
243
|
|
|
242
244
|
/** If node running this P2P stack is validator, passes in validator address to P2P layer */
|
|
243
245
|
registerThisValidatorAddresses(address: EthAddress[]): void;
|
|
246
|
+
|
|
247
|
+
/** Returns the number of peers in the GossipSub mesh for a given topic type. */
|
|
248
|
+
getGossipMeshPeerCount(topicType: TopicType): Promise<number>;
|
|
244
249
|
};
|
package/src/client/p2p_client.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/constants';
|
|
2
2
|
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
3
|
-
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
5
|
import { RunningPromise } from '@aztec/foundation/promise';
|
|
6
6
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
7
7
|
import type { AztecAsyncKVStore, AztecAsyncSingleton } from '@aztec/kv-store';
|
|
8
8
|
import { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
9
9
|
import {
|
|
10
|
+
type CheckpointId,
|
|
10
11
|
type EthAddress,
|
|
11
12
|
type L2Block,
|
|
12
13
|
type L2BlockId,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
CheckpointAttestation,
|
|
25
26
|
type CheckpointProposal,
|
|
26
27
|
type P2PClientType,
|
|
28
|
+
type TopicType,
|
|
27
29
|
} from '@aztec/stdlib/p2p';
|
|
28
30
|
import type { BlockHeader, Tx, TxHash } from '@aztec/stdlib/tx';
|
|
29
31
|
import { Attributes, type TelemetryClient, WithTracer, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
@@ -32,6 +34,7 @@ import type { PeerId } from '@libp2p/interface';
|
|
|
32
34
|
import type { ENR } from '@nethermindeth/enr';
|
|
33
35
|
|
|
34
36
|
import { type P2PConfig, getP2PDefaultConfig } from '../config.js';
|
|
37
|
+
import { TxPoolError } from '../errors/tx-pool.error.js';
|
|
35
38
|
import type { AttestationPoolApi } from '../mem_pools/attestation_pool/attestation_pool.js';
|
|
36
39
|
import type { MemPools } from '../mem_pools/interface.js';
|
|
37
40
|
import type { TxPoolV2 } from '../mem_pools/tx_pool_v2/interfaces.js';
|
|
@@ -165,6 +168,10 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
165
168
|
return Promise.resolve(this.p2pService.getPeers(includePending));
|
|
166
169
|
}
|
|
167
170
|
|
|
171
|
+
public getGossipMeshPeerCount(topicType: TopicType): Promise<number> {
|
|
172
|
+
return Promise.resolve(this.p2pService.getGossipMeshPeerCount(topicType));
|
|
173
|
+
}
|
|
174
|
+
|
|
168
175
|
public getL2BlockHash(number: BlockNumber): Promise<string | undefined> {
|
|
169
176
|
return this.l2Tips.getL2BlockHash(number);
|
|
170
177
|
}
|
|
@@ -200,7 +207,7 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
200
207
|
break;
|
|
201
208
|
case 'chain-pruned':
|
|
202
209
|
this.txCollection.stopCollectingForBlocksAfter(event.block.number);
|
|
203
|
-
await this.handlePruneL2Blocks(event.block);
|
|
210
|
+
await this.handlePruneL2Blocks(event.block, event.checkpoint);
|
|
204
211
|
break;
|
|
205
212
|
case 'chain-checkpointed':
|
|
206
213
|
break;
|
|
@@ -582,23 +589,22 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
582
589
|
**/
|
|
583
590
|
public async sendTx(tx: Tx): Promise<void> {
|
|
584
591
|
this.#assertIsReady();
|
|
585
|
-
const result = await this.txPool.addPendingTxs([tx]);
|
|
592
|
+
const result = await this.txPool.addPendingTxs([tx], { feeComparisonOnly: true });
|
|
586
593
|
if (result.accepted.length === 1) {
|
|
587
594
|
await this.p2pService.propagate(tx);
|
|
588
|
-
|
|
589
|
-
this.log.warn(
|
|
590
|
-
`Tx ${tx.getTxHash()} not propagated: accepted=${result.accepted.length} ignored=${result.ignored.length} rejected=${result.rejected.length}`,
|
|
591
|
-
);
|
|
595
|
+
return;
|
|
592
596
|
}
|
|
593
|
-
}
|
|
594
597
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
598
|
+
const txHashStr = tx.getTxHash().toString();
|
|
599
|
+
const reason = result.errors?.get(txHashStr);
|
|
600
|
+
if (reason) {
|
|
601
|
+
this.log.warn(`Tx ${txHashStr} not added to pool: ${reason.message}`);
|
|
602
|
+
throw new TxPoolError(reason);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
this.log.warn(
|
|
606
|
+
`Tx ${txHashStr} not propagated: accepted=${result.accepted.length} ignored=${result.ignored.length} rejected=${result.rejected.length}`,
|
|
607
|
+
);
|
|
602
608
|
}
|
|
603
609
|
|
|
604
610
|
/**
|
|
@@ -759,10 +765,31 @@ export class P2PClient<T extends P2PClientType = P2PClientType.Full>
|
|
|
759
765
|
|
|
760
766
|
/**
|
|
761
767
|
* Updates the tx pool after a chain prune.
|
|
768
|
+
* Detects epoch prunes (checkpoint number changed) and deletes all txs in that case.
|
|
762
769
|
* @param latestBlock - The block ID the chain was pruned to.
|
|
770
|
+
* @param newCheckpoint - The checkpoint ID after the prune.
|
|
763
771
|
*/
|
|
764
|
-
private async handlePruneL2Blocks(latestBlock: L2BlockId): Promise<void> {
|
|
765
|
-
|
|
772
|
+
private async handlePruneL2Blocks(latestBlock: L2BlockId, newCheckpoint: CheckpointId): Promise<void> {
|
|
773
|
+
const deleteAllTxs = this.config.txPoolDeleteTxsAfterReorg && (await this.isEpochPrune(newCheckpoint));
|
|
774
|
+
await this.txPool.handlePrunedBlocks(latestBlock, { deleteAllTxs });
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* Returns true if the prune crossed a checkpoint boundary.
|
|
779
|
+
* If the old and new checkpoint numbers are the same, the prune is within a single checkpoint.
|
|
780
|
+
* If they differ, the prune spans across checkpoints (epoch prune).
|
|
781
|
+
*/
|
|
782
|
+
private async isEpochPrune(newCheckpoint: CheckpointId): Promise<boolean> {
|
|
783
|
+
const tips = await this.l2Tips.getL2Tips();
|
|
784
|
+
const oldCheckpointNumber = tips.checkpointed.checkpoint.number;
|
|
785
|
+
if (oldCheckpointNumber <= CheckpointNumber.ZERO) {
|
|
786
|
+
return false;
|
|
787
|
+
}
|
|
788
|
+
const isEpochPrune = oldCheckpointNumber !== newCheckpoint.number;
|
|
789
|
+
this.log.info(
|
|
790
|
+
`Detected epoch prune: ${isEpochPrune}. Old checkpoint: ${oldCheckpointNumber}, new checkpoint: ${newCheckpoint.number}`,
|
|
791
|
+
);
|
|
792
|
+
return isEpochPrune;
|
|
766
793
|
}
|
|
767
794
|
|
|
768
795
|
/** Checks if the slot has changed and calls prepareForSlot if so. */
|
|
@@ -16,14 +16,12 @@ import type { PeerId } from '@libp2p/interface';
|
|
|
16
16
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
17
17
|
|
|
18
18
|
import type { P2PConfig } from '../../../config.js';
|
|
19
|
+
import { BatchTxRequesterCollector, SendBatchRequestCollector } from '../../../services/index.js';
|
|
19
20
|
import type { IBatchRequestTxValidator } from '../../../services/reqresp/batch-tx-requester/tx_validator.js';
|
|
20
21
|
import { RateLimitStatus } from '../../../services/reqresp/rate-limiter/rate_limiter.js';
|
|
22
|
+
import { MissingTxsTracker } from '../../../services/tx_collection/missing_txs_tracker.js';
|
|
21
23
|
import {
|
|
22
|
-
|
|
23
|
-
SendBatchRequestCollector,
|
|
24
|
-
} from '../../../services/tx_collection/proposal_tx_collector.js';
|
|
25
|
-
import { AlwaysTrueCircuitVerifier } from '../../../test-helpers/reqresp-nodes.js';
|
|
26
|
-
import {
|
|
24
|
+
AlwaysTrueCircuitVerifier,
|
|
27
25
|
BENCHMARK_CONSTANTS,
|
|
28
26
|
InMemoryAttestationPool,
|
|
29
27
|
InMemoryTxPool,
|
|
@@ -31,7 +29,7 @@ import {
|
|
|
31
29
|
calculateInternalTimeout,
|
|
32
30
|
createMockEpochCache,
|
|
33
31
|
createMockWorldStateSynchronizer,
|
|
34
|
-
} from '../../../test-helpers/
|
|
32
|
+
} from '../../../test-helpers/index.js';
|
|
35
33
|
import { createP2PClient } from '../../index.js';
|
|
36
34
|
import type { P2PClient } from '../../p2p_client.js';
|
|
37
35
|
import {
|
|
@@ -214,7 +212,13 @@ async function runCollector(cmd: Extract<WorkerCommand, { type: 'RUN_COLLECTOR'
|
|
|
214
212
|
if (collectorType === 'batch-requester') {
|
|
215
213
|
const collector = new BatchTxRequesterCollector(p2pService, logger, new DateProvider(), noopTxValidator);
|
|
216
214
|
const fetched = await executeTimeout(
|
|
217
|
-
(_signal: AbortSignal) =>
|
|
215
|
+
(_signal: AbortSignal) =>
|
|
216
|
+
collector.collectTxs(
|
|
217
|
+
MissingTxsTracker.fromArray(parsedTxHashes),
|
|
218
|
+
parsedProposal,
|
|
219
|
+
pinnedPeer,
|
|
220
|
+
internalTimeoutMs,
|
|
221
|
+
),
|
|
218
222
|
timeoutMs,
|
|
219
223
|
() => new Error(`Collector timed out after ${timeoutMs}ms`),
|
|
220
224
|
);
|
|
@@ -226,7 +230,13 @@ async function runCollector(cmd: Extract<WorkerCommand, { type: 'RUN_COLLECTOR'
|
|
|
226
230
|
BENCHMARK_CONSTANTS.FIXED_MAX_RETRY_ATTEMPTS,
|
|
227
231
|
);
|
|
228
232
|
const fetched = await executeTimeout(
|
|
229
|
-
(_signal: AbortSignal) =>
|
|
233
|
+
(_signal: AbortSignal) =>
|
|
234
|
+
collector.collectTxs(
|
|
235
|
+
MissingTxsTracker.fromArray(parsedTxHashes),
|
|
236
|
+
parsedProposal,
|
|
237
|
+
pinnedPeer,
|
|
238
|
+
internalTimeoutMs,
|
|
239
|
+
),
|
|
230
240
|
timeoutMs,
|
|
231
241
|
() => new Error(`Collector timed out after ${timeoutMs}ms`),
|
|
232
242
|
);
|
package/src/config.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface P2PConfig
|
|
|
38
38
|
ChainConfig,
|
|
39
39
|
TxCollectionConfig,
|
|
40
40
|
TxFileStoreConfig,
|
|
41
|
-
Pick<SequencerConfig, 'blockDurationMs'> {
|
|
41
|
+
Pick<SequencerConfig, 'blockDurationMs' | 'expectedBlockProposalsPerSlot'> {
|
|
42
42
|
/** A flag dictating whether the P2P subsystem should be enabled. */
|
|
43
43
|
p2pEnabled: boolean;
|
|
44
44
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TxPoolRejectionError } from '../mem_pools/tx_pool_v2/eviction/interfaces.js';
|
|
2
|
+
|
|
3
|
+
/** Error thrown when a transaction is not added to the mempool. */
|
|
4
|
+
export class TxPoolError extends Error {
|
|
5
|
+
public readonly data: TxPoolRejectionError;
|
|
6
|
+
|
|
7
|
+
constructor(public readonly reason: TxPoolRejectionError) {
|
|
8
|
+
super(reason.message);
|
|
9
|
+
this.name = 'TxPoolError';
|
|
10
|
+
this.data = reason;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -34,9 +34,10 @@ export const mockCheckpointAttestation = (
|
|
|
34
34
|
slot: number = 0,
|
|
35
35
|
archive: Fr = Fr.random(),
|
|
36
36
|
header?: CheckpointHeader,
|
|
37
|
+
feeAssetPriceModifier: bigint = 0n,
|
|
37
38
|
): CheckpointAttestation => {
|
|
38
39
|
header = header ?? CheckpointHeader.random({ slotNumber: SlotNumber(slot) });
|
|
39
|
-
const payload = new ConsensusPayload(header, archive);
|
|
40
|
+
const payload = new ConsensusPayload(header, archive, feeAssetPriceModifier);
|
|
40
41
|
|
|
41
42
|
const attestationHash = getHashedSignaturePayloadEthSignedMessage(
|
|
42
43
|
payload,
|
|
@@ -213,7 +213,7 @@ The [`EvictionManager`](eviction/eviction_manager.ts) coordinates eviction by:
|
|
|
213
213
|
Evicts transactions that become invalid after a block is mined:
|
|
214
214
|
|
|
215
215
|
- Duplicate nullifiers: Txs with nullifiers already included in the mined block
|
|
216
|
-
- Expired transactions: Txs with `
|
|
216
|
+
- Expired transactions: Txs with `expirationTimestamp` ≤ mined block timestamp
|
|
217
217
|
|
|
218
218
|
#### 2. `InvalidTxsAfterReorgRule`
|
|
219
219
|
|
|
@@ -68,10 +68,10 @@ export class InvalidTxsAfterMiningRule implements EvictionRule {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Evict pending txs with an expiration timestamp less than or equal to the mined block timestamp
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
71
|
+
const expirationTimestamp = tx.data.expirationTimestamp;
|
|
72
|
+
if (expirationTimestamp <= timestamp) {
|
|
73
73
|
this.log.verbose(
|
|
74
|
-
`Evicting tx ${txHash} from pool due to the tx being expired (
|
|
74
|
+
`Evicting tx ${txHash} from pool due to the tx being expired (expirationTimestamp: ${expirationTimestamp}, mined block timestamp: ${timestamp})`,
|
|
75
75
|
);
|
|
76
76
|
txsToEvict.push(txHash);
|
|
77
77
|
continue;
|
|
@@ -79,7 +79,7 @@ Lightweight metadata stored alongside each transaction:
|
|
|
79
79
|
- `claimAmount`: Fee payer's claim from bridging
|
|
80
80
|
- `feeLimit`: Maximum fee the tx can pay
|
|
81
81
|
- `nullifiers`: For conflict detection
|
|
82
|
-
- `
|
|
82
|
+
- `expirationTimestamp`: Expiration timestamp
|
|
83
83
|
- `minedL2BlockId`: Set when mined (undefined otherwise)
|
|
84
84
|
|
|
85
85
|
State is derived by TxPoolIndices:
|
|
@@ -301,6 +301,17 @@ export class DeletedPool {
|
|
|
301
301
|
return this.#state.size;
|
|
302
302
|
}
|
|
303
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
|
+
|
|
304
315
|
/**
|
|
305
316
|
* Gets all transaction hashes from pruned blocks.
|
|
306
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
|
|
|
@@ -67,8 +67,8 @@ export class FeePayerBalanceEvictionRule implements EvictionRule {
|
|
|
67
67
|
).flat();
|
|
68
68
|
|
|
69
69
|
if (txsToEvict.length > 0) {
|
|
70
|
-
await pool.deleteTxs(txsToEvict);
|
|
71
|
-
this.log.
|
|
70
|
+
await pool.deleteTxs(txsToEvict, this.name);
|
|
71
|
+
this.log.debug(`Evicted ${txsToEvict.length} txs due to insufficient fee payer balance`, {
|
|
72
72
|
txHashes: txsToEvict,
|
|
73
73
|
});
|
|
74
74
|
}
|