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

tari-project / tari / 42211089709
79%

Build:
DEFAULT BRANCH: development
Ran 06 Nov 2026 01:29PM UTC
Jobs 1
Files 802
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

06 Nov 2026 11:33AM UTC coverage: 78.2% (+0.1%) from 78.096%
42211089709

push

github

web-flow
fix(chain-storage): only reset a pruned node for a chain stronger than everything it holds (#8263)

## Description

Follow-up to #8260, which made a rewind past the pruning horizon one
atomic reset to the genesis state. This PR tightens when that reset is
allowed and how it is reported, so a pruned node only throws its chain
away for a chain that is really stronger than everything it holds, and
so header sync and gossip handle the reset cleanly.

## What changed

- **Header sync reports a reset.** When switching to a peer's chain
resets the node, header sync ends the round with `ChainResetToGenesis`.
It bans no one, it does not count towards the repeated-chain-change
limit, and it publishes the same `ChainReorg { added: [genesis], removed
}` event the gossip path uses, so the advertised chain metadata and the
mempool tip refresh at once. A reset is detected from the rewind itself,
so this also covers a split at the genesis block.
- **A reset needs a chain stronger than everything we hold.** The new
chain must be strictly stronger than the stronger of our header tip and
the strongest header tip we held and later lost to an ordinary rewind.
That lost tip is stored under a new metadata key, `LostHeaderTip`; a
fresh database does not have it, and the reset clears it. A short fork
from below the pruned height can therefore no longer reset a node whose
block sync stopped after horizon sync, including after an earlier rewind
has dropped its headers. A refused reset bans no one: gossip drops the
fork, and header sync returns `WeakerThanLocalHeaders`. The check runs
under the rewind's write lock and shares one predicate with the
header-sync fast path.
- **Claim checks come first.** A switch that would reset the node only
happens once the peer's claimed difficulty and height have been checked,
so a peer that over-claims is banned rather than resetting us. While
such a switch waits for the end of the stream, only the latest validated
header is kept in memory. If... (continued)

965 of 1029 new or added lines in 9 files covered. (93.78%)

154 existing lines in 21 files now uncovered.

146681 of 187571 relevant lines covered (78.2%)

1138407.17 hits per line

Uncovered Changes

Lines Coverage ∆ File
35
87.63
14.62% base_layer/core/src/base_node/sync/header_sync/synchronizer.rs
14
83.51
-6.72% base_layer/core/src/base_node/state_machine_service/states/header_sync.rs
9
67.22
0.31% base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
5
66.15
-0.24% base_layer/core/src/chain_storage/blockchain_database.rs
1
70.11
0.13% base_layer/core/src/chain_storage/db_transaction.rs

Coverage Regressions

Lines Coverage ∆ File
94
66.15
-0.24% base_layer/core/src/chain_storage/blockchain_database.rs
8
67.22
0.31% base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
6
89.02
-0.87% comms/core/src/connection_manager/dialer.rs
6
92.31
-0.39% comms/core/src/multiplexing/yamux.rs
5
82.92
-0.31% base_layer/core/src/base_node/comms_interface/inbound_handlers.rs
5
77.68
0.55% comms/core/src/connectivity/manager.rs
5
93.65
0.2% comms/dht/src/outbound/broadcast.rs
3
73.15
-0.07% base_layer/wallet/src/output_manager_service/storage/sqlite_db/mod.rs
3
83.19
-0.87% comms/core/src/connection_manager/manager.rs
3
90.41
-4.11% comms/core/src/pipeline/inbound.rs
2
87.03
-0.22% base_layer/core/src/base_node/service/service.rs
2
87.65
-0.2% base_layer/core/src/proof_of_work/cuckaroo_pow.rs
2
77.49
-0.06% base_layer/wallet/src/transaction_service/storage/sqlite_db.rs
2
86.42
-1.23% comms/core/src/protocol/messaging/inbound.rs
2
96.8
-0.91% comms/core/src/utils/mpsc.rs
1
87.04
1.58% base_layer/core/src/base_node/state_machine_service/states/block_sync.rs
1
55.13
-1.28% base_layer/core/src/validation/error.rs
1
90.43
-1.06% comms/core/src/protocol/protocols.rs
1
91.09
-0.11% comms/dht/src/actor.rs
1
36.36
-9.09% comms/dht/src/outbound/error.rs
1
33.96
-1.89% comms/dht/src/outbound/message.rs
Jobs
ID Job ID Ran Files Coverage
1 42211089709.1 06 Nov 2026 01:29PM UTC 802
78.2
GitHub Action Run
Source Files on build 42211089709
  • Tree
  • List 802
  • Changed 42
  • Source Changed 13
  • Coverage Changed 40
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #42211089709
  • e9c4dad9 on github
  • Prev Build on development (#42192547353)
  • Next Build on development (#42227896382)
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