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

tari-project / tari / 18279939245
62%

Build:
DEFAULT BRANCH: development
Ran 06 Oct 2025 01:02PM UTC
Jobs 1
Files 700
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

06 Oct 2025 11:53AM UTC coverage: 58.602% (-1.0%) from 59.56%
18279939245

push

github

web-flow
feat: track ConsensusConstants to detect network changes and notify user (#7533)

## Problem

The minotari_node currently has no mechanism to detect when
ConsensusConstants have changed between restarts. This creates a risk
where a node operator might unknowingly run an incompatible version
after consensus rule changes have already taken effect, potentially
leading to network fork issues or sync problems.

## Solution

This PR implements a lightweight ConsensusConstants tracking system
that:

1. **Stores consensus constants** on each startup in
`{data_dir}/consensus_constants.json`
2. **Compares constants** between restarts to detect changes
3. **Validates timing** - only raises errors when new constants are
already active at current blockchain height
4. **Provides clear feedback** to users about potential network
compatibility issues

## Implementation Details

### New Components

- **ConsensusConstantsTracker**: A new module that handles persistence
and comparison of consensus constants
- **Integration point**: Added to node startup flow in `builder.rs`
after database initialization but before node start
- **Minimal storage**: Only tracks essential fields needed for
compatibility detection

### User Experience

The implementation provides different behaviors based on the situation:

- **First startup**: Silent operation, creates tracking file
- **No changes**: Silent operation, continues normally  
- **Constants changed, not yet active**: Info log message, continues
normally
- **Constants changed, already active**: **Critical error with clear
message and exit**

Example error message:
```
CRITICAL: Consensus constants have changed and the new constants are already active!
Current height: 15000
Active consensus constants changed from effective height 0 to 15000  
This indicates a potential network fork or version mismatch.
Please verify you are running the correct version of the node for this network.
```

### Files Changed

- `base_layer/core/src/ch... (continued)

67 of 70 new or added lines in 7 files covered. (95.71%)

1118 existing lines in 28 files now uncovered.

66535 of 113537 relevant lines covered (58.6%)

550271.13 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
91.51
-0.89% base_layer/transaction_components/src/consensus/consensus_constants.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
67.39
-0.27% base_layer/core/src/mempool/sync_protocol/mod.rs
1
47.66
-0.04% base_layer/wallet/src/transaction_service/storage/sqlite_db.rs
3
26.09
-13.04% base_layer/common_types/src/epoch.rs
3
38.57
-4.29% base_layer/core/src/validation/mocks.rs
3
31.71
-7.32% base_layer/node_components/src/blocks/block_header_accumulated_data.rs
3
46.51
-6.98% base_layer/node_components/src/blocks/historical_block.rs
3
59.47
-0.42% comms/dht/src/connectivity/mod.rs
3
20.0
-5.0% infrastructure/test_utils/src/streams/mod.rs
4
0.0
-23.53% base_layer/core/src/base_node/proto/rpc.rs
4
88.64
-4.55% base_layer/core/src/test_helpers/block_spec.rs
5
85.19
-4.63% base_layer/core/src/common/rolling_vec.rs
5
71.05
-6.58% base_layer/core/src/consensus/chain_strength_comparer.rs
6
73.53
-8.82% base_layer/common_types/src/types/fixed_hash.rs
8
0.0
-15.38% base_layer/core/src/validation/error.rs
9
91.51
-0.89% base_layer/transaction_components/src/consensus/consensus_constants.rs
11
50.0
-50.0% base_layer/core/src/chain_storage/smt_hasher.rs
12
48.73
-4.36% base_layer/core/src/chain_storage/db_transaction.rs
12
85.1
-1.39% base_layer/core/src/chain_storage/lmdb_db/validator_node_store.rs
17
36.47
-10.0% base_layer/transaction_components/src/transaction_components/output_features.rs
20
0.0
-26.32% base_layer/transaction_components/src/transaction_components/side_chain/sidechain_feature.rs
20
67.62
-19.05% base_layer/transaction_components/src/transaction_components/side_chain/validator_node_registration.rs
21
61.43
-5.16% base_layer/core/src/chain_storage/lmdb_db/lmdb.rs
21
62.91
-1.65% base_layer/core/src/test_helpers/blockchain.rs
22
8.7
-31.88% base_layer/core/src/chain_storage/block_add_result.rs
29
63.75
-36.25% base_layer/core/src/base_node/sync/rpc/tests.rs
55
12.27
-14.36% base_layer/core/src/base_node/sync/rpc/service.rs
341
41.46
-11.59% base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
476
39.11
-16.56% base_layer/core/src/chain_storage/blockchain_database.rs
Jobs
ID Job ID Ran Files Coverage
1 18279939245.1 06 Oct 2025 01:02PM UTC 700
58.6
GitHub Action Run
Source Files on build 18279939245
  • Tree
  • List 700
  • Changed 40
  • Source Changed 9
  • Coverage Changed 36
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18279939245
  • 0062621d on github
  • Prev Build on development (#18276963928)
  • Next Build on development (#18282868789)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc