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

tari-project / tari / 32836793780
77%

Build:
DEFAULT BRANCH: development
Ran 25 Aug 2026 11:16AM UTC
Jobs 1
Files 705
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

25 Aug 2026 10:21AM UTC coverage: 63.488% (+0.005%) from 63.483%
32836793780

push

github

web-flow
fix(mmr): return an error instead of panicking on malformed merkle pr… (#7968)

…oofs

`MerkleProof::verify()` panicked on malformed input rather than
returning an error. `check_root()` only validated the length of the peak
list and then unwrapped the peak hash iterator inside its fold. Any
proof whose sibling path is truncated terminates the walk at a position
that is not a canonical peak, so the fold consumed more items than the
iterator held and unwrapped `None`. A hand-crafted proof with an empty
path and no peaks panicked in the same way. Since these proofs are
fetched from a remote node, a malicious peer could crash the verifying
process.

The fold is now a loop that propagates `IncorrectPeakMap` when the proof
does not carry a hash for every peak, and it also rejects proofs that
carry more peak hashes than were consumed. The boundary check in
`verify_consume()` is tightened to `parent_pos >= self.mmr_size`, since
the largest valid node index is `mmr_size - 1`.

`family()` had the same problem one level down. The type of the literal
in `let peak = 1 << height` was only constrained by the `i128::from()`
below it, which many integer types satisfy, so it defaulted to `i32`. At
height 31 that silently produced `i32::MIN`, corrupting both the peak
mask and the parent arithmetic, and at height 32 and above it panicked
with "attempt to shift left with overflow" - in release builds too,
since the workspace enables overflow checks there. A proof with a long
enough path and a large enough `mmr_size` walks a verification straight
into it, and both of those, along with the leaf index, are supplied by
the remote node in the burn claim flow. The literal is now typed as
`u64`; the smallest node index at height `h` is `2^(h+1) - 2`, so
`height` cannot exceed 63 for a `usize` position and the shift cannot
overflow. The shifts in `family_branch()` and `is_left_sibling()`
correctly infer `usize` from their surrounding arithmetic, but are now
annotated to say so.

... (continued)

72 of 73 new or added lines in 4 files covered. (98.63%)

31 existing lines in 10 files now uncovered.

76032 of 119759 relevant lines covered (63.49%)

223825.62 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.32
0.86% base_layer/mmr/src/merkle_proof.rs

Coverage Regressions

Lines Coverage ∆ File
10
85.68
-2.08% base_layer/p2p/src/services/liveness/service.rs
6
67.12
-8.22% base_layer/core/src/base_node/state_machine_service/states/sync_decide.rs
3
79.11
-0.7% base_layer/transaction_components/src/validation/aggregate_body/aggregate_body_internal_validator.rs
2
65.76
-0.61% base_layer/core/src/base_node/sync/block_sync/synchronizer.rs
2
84.65
-0.93% base_layer/p2p/src/services/liveness/state.rs
2
84.46
-0.37% comms/core/src/connection_manager/peer_connection.rs
2
61.1
0.35% comms/core/src/connectivity/manager.rs
2
83.17
-0.32% comms/core/src/protocol/rpc/client/mod.rs
1
66.67
-0.28% base_layer/core/src/mempool/sync_protocol/mod.rs
1
67.76
-0.47% comms/core/src/protocol/messaging/protocol.rs
Jobs
ID Job ID Ran Files Coverage
1 32836793780.1 25 Aug 2026 11:16AM UTC 705
63.49
GitHub Action Run
Source Files on build 32836793780
  • Tree
  • List 705
  • Changed 21
  • Source Changed 4
  • Coverage Changed 21
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32836793780
  • c7a3631d on github
  • Prev Build on development (#32820869039)
  • Next Build on development (#32854003490)
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