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

tari-project / tari / 43190246672
79%

Build:
DEFAULT BRANCH: development
Ran 12 Nov 2026 11:07AM UTC
Jobs 1
Files 803
Run time 1min
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

12 Nov 2026 09:18AM UTC coverage: 79.077% (+0.1%) from 78.936%
43190246672

push

github

web-flow
fix(block-sync): check block sync completion against the requested header tip (#8350)

## Description

Block sync asks a peer for blocks only up to our local header tip
(`end_hash = tip_hash`), but once the stream ended it checked completion
against the peer's claimed accumulated difficulty. That caused two
problems:

- An honest peer whose advertised chain is ahead of our header tip
served every block we asked for and was still short-banned with
`PeerDidNotSupplyAllClaimedBlocks`.
- A peer whose claim is below our header tip could end the stream
cleanly partway through, and the round reported success (`is_synced =
true`) with blocks still missing up to the tip.

## Fix

- `synchronize_blocks` reads the tip once with
`fetch_last_chain_header()` and keeps its total accumulated difficulty.
- After the stream ends, the attempt fails if our best block's
accumulated difficulty is below the requested tip's. The peer's claim is
no longer used in the check.
- `PeerDidNotSupplyAllClaimedBlocks` is renamed to
`PeerDidNotSupplyAllRequestedBlocks`. Its message now reports the
requested tip against our state after the sync, and it keeps
`BanPeriod::Short`. A current server never ends the stream cleanly below
the requested end while we are connected.

## Tests

New tests in `block_sync/test.rs`:
- A peer claiming more than our header tip that serves every requested
block completes the sync and is not banned.
- A peer that stops before our header tip does not complete the sync and
is banned once.
- A stronger-claim peer that stops below the tip gets a short ban, and
the next peer completes the sync.

## Known limitations / follow-ups

- The request still runs to our header tip, and peer order is unchanged.
Capping the request at the peer's claimed tip is a separate follow-up.
- A transport drop mid-stream reaches block sync as a clean end of
stream (the comms RPC client worker returns without pushing an error to
the stream), so the peer gets this short ban. A report... (continued)

89 of 92 new or added lines in 3 files covered. (96.74%)

1143 existing lines in 37 files now uncovered.

152814 of 193246 relevant lines covered (79.08%)

1128118.64 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
98.71
-0.42% base_layer/core/src/base_node/sync/block_sync/test.rs
1
32.0
2.0% base_layer/core/src/base_node/sync/block_sync/error.rs

Coverage Regressions

Lines Coverage ∆ File
571
55.89
5.76% base_layer/wallet/src/output_manager_service/service.rs
126
94.13
0.23% base_layer/transaction_components/src/transaction_builder/builder.rs
87
67.68
0.01% base_layer/core/src/chain_storage/blockchain_database.rs
83
88.5
0.09% base_layer/core/src/base_node/sync/header_sync/synchronizer.rs
55
87.96
0.0% comms/dht/src/inbound/dht_handler/task.rs
34
78.75
-4.82% base_layer/core/src/base_node/rpc/query_service.rs
32
89.53
0.08% base_layer/transaction_components/src/offline_signing/one_sided_signer.rs
18
79.55
0.24% comms/dht/src/inbound/message.rs
17
96.15
0.39% comms/dht/src/inbound/decryption.rs
13
77.47
-0.69% comms/core/src/connectivity/manager.rs
13
62.89
-3.68% comms/dht/src/network_discovery/state_machine.rs
11
97.57
0.21% comms/dht/src/dedup/mod.rs
7
87.63
-1.22% comms/core/src/connection_manager/dialer.rs
7
92.12
-2.9% comms/core/src/protocol/rpc/status.rs
6
95.14
-0.14% comms/dht/src/outbound/broadcast.rs
5
85.31
-0.27% base_layer/core/src/base_node/comms_interface/inbound_handlers.rs
5
99.76
0.0% base_layer/transaction_components/src/offline_signing/mod.rs
5
88.71
-0.78% comms/core/src/connection_manager/peer_connection.rs
4
99.08
-0.0% base_layer/core/src/base_node/sync/header_sync/test.rs
4
94.99
-0.09% base_layer/core/src/base_node/sync/horizon_state_sync/synchronizer.rs
4
90.95
-0.44% comms/dht/src/actor.rs
3
66.51
-1.42% base_layer/core/src/base_node/sync/rpc/service.rs
3
36.63
-2.97% base_layer/core/src/chain_storage/error.rs
3
0.0
0.0% base_layer/transaction_components/src/transaction_builder/error.rs
3
73.44
0.36% base_layer/wallet/src/output_manager_service/storage/sqlite_db/mod.rs
3
91.26
-0.46% comms/core/src/connection_manager/listener.rs
3
90.41
-4.11% comms/core/src/pipeline/inbound.rs
3
85.8
-1.85% comms/core/src/protocol/messaging/inbound.rs
3
96.59
-0.73% comms/dht/src/dedup/dedup_cache.rs
2
87.24
0.0% base_layer/core/src/base_node/service/service.rs
2
77.49
0.03% base_layer/wallet/src/transaction_service/storage/sqlite_db.rs
2
87.05
-0.29% comms/core/src/protocol/rpc/client/mod.rs
2
99.28
0.2% comms/dht/src/dht.rs
1
83.97
-0.17% base_layer/core/src/chain_storage/lmdb_db/lmdb.rs
1
75.72
-0.22% base_layer/core/src/mempool/sync_protocol/mod.rs
1
98.24
-0.15% base_layer/core/src/proof_of_work/monero_rx/merkle_tree.rs
1
93.23
-0.38% comms/core/src/connectivity/proactive_dialer.rs
Jobs
ID Job ID Ran Files Coverage
1 43190246672.1 12 Nov 2026 11:07AM UTC 803
79.08
GitHub Action Run
Source Files on build 43190246672
  • Tree
  • List 803
  • Changed 52
  • Source Changed 16
  • Coverage Changed 52
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #43190246672
  • 35fa6ba7 on github
  • Prev Build on development (#43055204846)
  • Next Build on development (#43234200214)
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