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

tari-project / tari / 41611521299
79%

Build:
DEFAULT BRANCH: development
Ran 03 Nov 2026 11:32AM UTC
Jobs 1
Files 799
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

03 Nov 2026 09:30AM UTC coverage: 77.644% (+0.2%) from 77.484%
41611521299

push

github

web-flow
fix(chain-storage): stop the consistency check reporting healthy databases as corrupt (#8245)

## Summary

The `check-db` blockchain consistency check reported healthy databases
as corrupt, and with autocorrect on it then rewound them. On a pruned
node that rewind went past the pruning horizon and wiped the chain to
height 0.

Two causes:
- The full check decided whether a block body exists with
`pruned_height_at_given_chain_tip(height)`, which is always below
`height`. So it validated pruned bodies (spent outputs and inputs
already deleted) and failed.
- Heights were clamped to the header tip, not the block tip. While
headers are synced ahead of blocks, the check tried to fetch blocks that
don't exist yet.

## Changes

**Which heights get a body check**
- Block bodies are fetched and validated only when `pruned_height <
height <= best_block_height`. Every other height (pruned, or header-only
above the block tip) gets the header linkage check.
- A genesis-only database passes.

**Autocorrect only rewinds confirmed corruption**
- Each height is checked against one consistent view (a single read
lock).
- Before an autocorrect rewind, the failing height is re-checked under
the rewind's write lock. A body-validation verdict only stands if the
same block (height and hash) is still stored and fails validation again.
- Progress for a height is recorded only if its header hash didn't
change during the check.
- A height that has to be re-checked is retried at most 3 times, and a
stop request is honoured before each retry.
- Storage access failures (`AccessError`, `LmdbError`, `IoError`, ...)
end the check without a rewind. Missing or undecodable data counts as
corruption.
- The rewind targets one below the height actually checked.

**Errors**
- LMDB value decode failures are now
`ChainStorageError::ConversionError` instead of `AccessError`. The
legacy bad-block reason lookup still treats an undecodable row as
"exists, no reason recorded".
- `From<ChainStorageE... (continued)

463 of 637 new or added lines in 7 files covered. (72.68%)

519 existing lines in 25 files now uncovered.

142757 of 183860 relevant lines covered (77.64%)

972176.82 hits per line

Uncovered Changes

Lines Coverage ∆ File
143
61.53
0.09% base_layer/core/src/chain_storage/blockchain_database.rs
26
65.01
1.61% base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
3
83.97
2.31% base_layer/core/src/chain_storage/lmdb_db/lmdb.rs
1
73.63
-0.2% base_layer/core/src/base_node/sync/block_sync/synchronizer.rs
1
55.13
3.81% base_layer/core/src/validation/error.rs

Coverage Regressions

Lines Coverage ∆ File
198
61.53
0.09% base_layer/core/src/chain_storage/blockchain_database.rs
90
92.55
2.08% base_layer/core/src/mempool/mempool_storage.rs
87
97.88
0.15% base_layer/core/src/mempool/unconfirmed_pool/unconfirmed_pool.rs
40
89.74
0.56% base_layer/transaction_components/src/validation/aggregate_body/aggregate_body_internal_validator.rs
25
95.96
3.44% base_layer/core/src/mempool/mempool.rs
13
43.37
-15.66% base_layer/core/src/chain_storage/block_add_result.rs
11
94.42
0.27% base_layer/core/src/mempool/priority/prioritized_transaction.rs
6
73.01
0.29% base_layer/wallet/src/output_manager_service/storage/sqlite_db/mod.rs
6
92.31
-0.39% comms/core/src/multiplexing/yamux.rs
6
93.44
-0.2% comms/dht/src/outbound/broadcast.rs
5
65.01
1.61% base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
4
87.55
-0.4% base_layer/core/src/proof_of_work/cuckaroo_pow.rs
4
89.25
-4.3% base_layer/core/src/test_helpers/block_spec.rs
4
77.55
0.18% base_layer/wallet/src/transaction_service/storage/sqlite_db.rs
3
0.0
0.0% base_layer/transaction_components/src/validation/error.rs
3
96.58
-0.73% comms/dht/src/dedup/dedup_cache.rs
2
94.81
0.13% base_layer/core/src/base_node/sync/horizon_state_sync/synchronizer.rs
2
95.67
-0.43% base_layer/core/src/proof_of_work/randomx_factory.rs
2
83.7
-0.19% base_layer/wallet/src/storage/sqlite_db/wallet.rs
2
88.85
-0.35% comms/core/src/connection_manager/dialer.rs
2
77.19
0.0% comms/core/src/connectivity/manager.rs
1
83.97
2.31% base_layer/core/src/chain_storage/lmdb_db/lmdb.rs
1
94.57
0.22% base_layer/core/src/mempool/service/inbound_handlers.rs
1
97.04
0.21% base_layer/transaction_components/src/transaction_components/covenants/covenant.rs
1
49.06
-0.94% comms/core/src/connectivity/selection.rs
Jobs
ID Job ID Ran Files Coverage
1 41611521299.1 03 Nov 2026 11:31AM UTC 799
77.64
GitHub Action Run
Source Files on build 41611521299
  • Tree
  • List 799
  • Changed 45
  • Source Changed 17
  • Coverage Changed 44
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41611521299
  • 76ba068c on github
  • Prev Build on development (#41092230564)
  • Next Build on development (#41829828991)
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