• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tari-project / tari / 36560855364
71%

Build:
DEFAULT BRANCH: development
Ran 29 Sep 2026 12:00PM UTC
Jobs 1
Files 791
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Sep 2026 11:17AM UTC coverage: 63.849% (-0.03%) from 63.875%
36560855364

push

github

web-flow
fix(mempool): match sync inventory in linear time (#8057)

## Description

The mempool-sync responder (`start_responder_inner`) matched the peer's
`TransactionInventory` against its own mempool by running
`inventory.items.iter().position(..)` for every pooled transaction,
followed by a `Vec::contains` per item when building the missing-index
list. The cost was `|mempool| x |inventory|` per exchange, with the
inventory bounded only by the 3 MiB frame (~92k items).

This PR:

- builds a `HashMap<&[u8], usize>` from the inventory once (first index
wins, so a duplicated item is still reported missing at its later
positions, exactly as before) and records matches in a `HashSet<usize>`.
The keys come from the peer, so the map keeps std's randomly keyed
SipHash;
- rejects any inventory item that is not a 32-byte excess signature
scalar, before the mempool is snapshotted, with a new
`MempoolProtocolError::InvalidInventoryItem`.

Not in scope: an item-count cap and a responder concurrency limit. With
linear matching, a full-frame inventory costs a few ms.

## Motivation and Context

Keeps the responder's work linear in its inputs regardless of how full
the mempool is.

## How Has This Been Tested?

- New tests in `mempool/sync_protocol/test.rs`:
-
`responder_streams_unmatched_transactions_and_requests_missing_indexes`:
checks that matched transactions are not streamed, that the missing
indexes are correct, and that duplicate-item semantics are preserved.
- `responder_rejects_an_inventory_item_that_is_not_an_excess_signature`
- `cargo test -p tari_core --lib mempool::sync_protocol::`: 16 passed.
- `cargo ci-clippy -p tari_core` is clean.
- Release-mode measurement, 2,000-transaction mempool, one 92,521-item
inventory: first reply went from ~212 ms to ~30 ms (1-item baseline
~20-27 ms).

## Breaking Changes

- [x] None

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.... (continued)

105 of 105 new or added lines in 2 files covered. (100.0%)

267 existing lines in 20 files now uncovered.

92608 of 145042 relevant lines covered (63.85%)

726790.5 hits per line

Coverage Regressions

Lines Coverage ∆ File
104
51.89
-2.3% base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
57
88.86
-8.14% base_layer/core/src/validation/block_body/test.rs
16
71.79
-1.27% comms/core/src/connectivity/manager.rs
14
90.59
-0.6% base_layer/transaction_components/src/transaction_builder/builder.rs
13
54.66
2.0% base_layer/core/src/chain_storage/blockchain_database.rs
13
72.82
-1.58% base_layer/core/src/test_helpers/blockchain.rs
10
82.6
-2.0% comms/core/src/connection_manager/dialer.rs
9
87.46
1.53% base_layer/core/src/base_node/sync/header_sync/validator.rs
6
60.78
-1.47% base_layer/core/src/validation/helpers.rs
4
92.69
-1.83% base_layer/transaction_components/src/validation/helpers.rs
4
82.34
-0.6% comms/core/src/noise/socket.rs
3
43.94
24.24% base_layer/core/src/chain_storage/block_add_result.rs
3
67.44
0.0% base_layer/node_components/src/blocks/historical_block.rs
3
87.98
-0.38% comms/dht/src/actor.rs
2
80.96
-0.48% base_layer/core/src/validation/aggregate_body/aggregate_body_chain_validator.rs
2
86.84
-0.37% comms/core/src/connection_manager/peer_connection.rs
1
71.72
1.91% base_layer/core/src/mempool/sync_protocol/mod.rs
1
82.22
-2.22% base_layer/core/src/proof_of_work/sha3x_pow.rs
1
38.62
-0.04% base_layer/wallet/src/transaction_service/storage/sqlite_db.rs
1
72.15
-0.42% comms/core/src/connection_manager/listener.rs
Jobs
ID Job ID Ran Files Coverage
1 36560855364.1 29 Sep 2026 12:00PM UTC 791
63.85
GitHub Action Run
Source Files on build 36560855364
  • Tree
  • List 791
  • Changed 29
  • Source Changed 2
  • Coverage Changed 29
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36560855364
  • 9c799826 on github
  • Prev Build on development (#36550566220)
  • Next Build on development (#36580513241)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc