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

tari-project / tari
79%

Build:
DEFAULT BRANCH: development
Repo Added 11 Mar 2022 03:53AM UTC
Files 803
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

LAST BUILD ON BRANCH development
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • ci-coverage-mbignorefolders
  • ci-feature-selfhosted-runners
  • development

16 Nov 2026 07:14AM UTC coverage: 79.018% (+0.1%) from 78.875%
43822446542

push

github

web-flow
fix(mmr): validate PrunedHashSet on deserialize and return errors instead of panicking (#8363)

## Description

`PrunedHashSet` is the kernel MMR backend stored in LMDB as
`BlockAccumulatedData.kernels`. Its `Deserialize` derive accepted any
field values. A corrupted or tampered row decoded without error and then
crashed the node:
- the `expect` in `MerkleMountainRange::hash_to_root` panicked;
- the `unwrap` in `MerkleMountainRange::push` panicked;
- an unsorted `peak_indices` silently broke the `binary_search` in
`get`.

The set is only ever built from a verified MMR and is never received
from a peer. The threat is local corruption, and the effect was a crash
loop rather than a database error.

## Fix

- `PrunedHashSet` now deserializes through a private `RawPrunedHashSet`
shadow struct with the same fields in the same order, using
`#[serde(try_from = ...)]`. Serialization is unchanged, so existing
records keep loading.
- New `pub fn validate()` checks:
  1. `base_offset` is a valid MMR size (0 included);
  2. `peak_indices == find_peaks(base_offset)` exactly;
  3. `peak_hashes.len() == peak_indices.len()`;
4. `base_offset + hashes.len()` does not overflow and is a valid MMR
size.
- `TryFrom<&MerkleMountainRange>` asserts `validate()` in debug builds,
so the constructor and the decoder cannot drift apart.
- Failures use the existing
`MerkleMountainRangeError::BackendError("PrunedHashSet: <field> ...")`,
so the error enum gets no new variant. Through `lmdb_get` they surface
as `ChainStorageError::ConversionError`, which does not ban peers.
- `hash_to_root` and `push` return `HashNotFound(i)` instead of
panicking when the backend is missing a node. With invariants 1-3 this
cannot happen for a validated `PrunedHashSet`; it covers other
`ArrayLike` backends. No `unwrap` or `expect` remains in
`merkle_mountain_range.rs` outside tests.
- Rustdoc lists the invariants and documents `HashNotFound` on `push`
and `get_merkle_root`.

Invariant 4 is stricter than... (continued)

166 of 177 new or added lines in 2 files covered. (93.79%)

824 existing lines in 26 files now uncovered.

154139 of 195067 relevant lines covered (79.02%)

474343.14 hits per line

Relevant lines Covered
Build:
Build:
195067 RELEVANT LINES 154139 COVERED LINES
474343.14 HITS PER LINE
Source Files on development
  • Tree
  • List 803
  • Changed 51
  • Source Changed 15
  • Coverage Changed 51
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
43822446542 development fix(mmr): validate PrunedHashSet on deserialize and return errors instead of panicking (#8363) ## Description `PrunedHashSet` is the kernel MMR backend stored in LMDB as `BlockAccumulatedData.kernels`. Its `Deserialize` derive accepted any field... push 16 Nov 2026 09:00AM UTC web-flow github
79.02
43440192169 development fix(node): distinguish DoubleSpend from AlreadyMined in HTTP submit_transaction (#8298) ## Description 1. **`applications/minotari_node/src/http/handler/json_rpc/submit_transaction.rs`**: - Distinguish `TxSubmissionRejectionReason::DoubleSpend` ... push 13 Nov 2026 04:06PM UTC web-flow github
78.87
43408212912 development fix(ci): fix CI for Rust 1.100 (clippy lints, Cargo build-dir layout) (#8360) Description --- Rust/Cargo 1.100 broke CI in two ways: 1. **Clippy 1.100** reports `needless_range_loop` in `base_layer/core/src/chain_storage/tests/lmdb_unit_tests.rs... push 13 Nov 2026 12:23PM UTC web-flow github
78.66
43234200214 development fix(base-node): limit P2P sync_utxos_by_block to one stream per peer (#8352) ## Description `BaseNodeWalletRpcService::sync_utxos_by_block` (P2P wallet RPC method 11) streams the outputs of every block between two main-chain headers. Unlike the ... push 12 Nov 2026 03:53PM UTC web-flow github
79.22
43190246672 development 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 again... push 12 Nov 2026 11:07AM UTC web-flow github
79.08
43055204846 development fix(p2p): sanitize the DNS seed record before it reaches the log (#8316) Description --- `DnsSeedResolver::resolve` logs a TXT record that does not parse as a seed peer: ```rust .inspect_err(|err| { warn!( target: LOG_TARGET, ... push 11 Nov 2026 06:08PM UTC web-flow github
78.94
43035772587 development fix(mempool): deduplicate only transactions with the same kernel set (#8343) ## Summary The mempool treated a transaction as already stored when each of its kernel signatures appeared somewhere in a pool's signature index, even when those signat... push 11 Nov 2026 04:04PM UTC web-flow github
78.9
42998042882 development fix(common_types): map locked confirmed statuses in LegacyImportStatus and harden PayRef/SeedWords (#8301) ## Description In `base_layer/common_types`: 1. Map locked/confirmed transaction statuses consistently in `LegacyImportStatus` conversions... push 11 Nov 2026 11:47AM UTC web-flow github
78.76
42958766653 development perf(mempool): remove pool transactions in batches so shared index entries are pruned once (#8338) ## Summary The unconfirmed pool lets many transactions share an index entry: they can spend the same output, produce the same output commitment, o... push 11 Nov 2026 06:16AM UTC web-flow github
78.8
42831924886 development fix(console_wallet): fix completed_txs removal, PartialRead skip order, and non-ledger build (#8283) ## Description This PR fixes several bugs in `minotari_console_wallet`: 1. **Remove missing transaction from `completed_txs` instead of `pending... push 10 Nov 2026 04:03PM UTC web-flow github
78.59
See All Builds (815)
  • Repo on GitHub
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