Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ cargo doc --open
- **Async/Await**: Modern async Rust throughout
- **FFI Support**: C and Swift bindings for cross-platform usage
- **Comprehensive Testing**: Unit, integration, and fuzz testing
- **MSRV**: Rust 1.80 minimum supported version
- **MSRV**: Rust 1.89 minimum supported version

## Code Style Guidelines

Expand Down
5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ version = "0.39.6"
[patch.crates-io.dashcore_hashes]
path = "hashes"

[patch.crates-io]
blsful = { git = "https://github.com/dashpay/agora-blsful", rev = "5f017aa1a0452ebc73e47f219f50c906522df4ea" }



2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ architectural mismatches.

## Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on **Rust 1.80**.
This library should always compile with any combination of features on **Rust 1.89**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Inconsistent MSRV in README: 1.89 here, but earlier section still says 1.29 and the badge shows 1.29+.
Fix the conflicting “Minimum Supported Rust Version (MSRV)” earlier in the README and update/remove the rustc 1.29+ badge to avoid misleading users.

Apply this change within the edited section to keep intent clear:

-This library should always compile with any combination of features on **Rust 1.89**.
+This library should always compile with any combination of features on **Rust 1.89**.

Additionally, adjust the earlier MSRV section and badge (outside this hunk). Suggested updates:

  • Replace the historical 1.29 MSRV section with a short note pointing to the new MSRV and remove the old dependency pinning commands that are no longer relevant.
  • Update the rustc version badge from 1.29+ to 1.89+ or remove it if it cannot be kept current.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In README.md around line 137, the MSRV statement conflicts with earlier content
that still references Rust 1.29 and a rustc badge showing 1.29+; update the
earlier MSRV section and badge to match the new MSRV (Rust 1.89) and remove any
obsolete dependency pinning commands. Replace the historical 1.29 MSRV paragraph
with a short note directing readers to the current MSRV (1.89) and delete the
old cargo/rustup pin commands that no longer apply, and update the rustc badge
to 1.89+ (or remove the badge if it cannot be reliably maintained) so the README
is consistent.


## Installing Rust

Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.80"
msrv = "1.89"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

MSRV bump in clippy config looks good; verify workspace and CI alignment.
The clippy MSRV setting matches the PR’s stated bump to 1.89. Please ensure all crates’ rust-version fields and CI toolchains are updated accordingly.

Run this script to verify MSRV consistency across the repo and surface stragglers (old 1.29/1.80 mentions, CI pins, etc.):


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check Cargo.toml rust-version fields =="
rg -nP '^\s*rust-version\s*=\s*".*"' -g 'Cargo.toml' -S -C2 || true
rg -nP '^\s*rust-version\s*=\s*".*"' -S -C2 --glob '!**/target/**' --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' --type toml || true
echo

echo "== Expect rust-version = \"1.89\" everywhere =="
rg -nP '^\s*rust-version\s*=\s*"1\.(29|80)"' --type toml -C2 || echo "OK: no rust-version set to 1.29/1.80 found"
echo

echo "== Check clippy.toml MSRV =="
rg -n '^\s*msrv\s*=\s*".*"' clippy.toml -C1 || true
echo

echo "== Find stale MSRV mentions in docs (1.29 or 1.80) =="
rg -nP '\b1\.(29|80)\b' README.md CLAUDE.md dash-spv/CLAUDE.md -C2 || echo "OK: no stale MSRV mentions in primary docs"
echo

echo "== Check CI workflow pins (toolchain, rust-version) =="
fd -HI --type f '.ya?ml' .github | xargs -r rg -nP '(toolchain|rust-version|rust:)'

Length of output: 3917


MSRV updates verified; docs and CI need alignment

  • Rust-version fields: dash-spv/Cargo.toml is updated to 1.89; no other crates declare a rust-version field.
  • Docs: README.md still references “Rust 1.29” (badge at line 15 and MSRV section at lines 105–109). Update to “1.89”.
  • CI workflows: .github/workflows/rust.yml (matrix entry rust: 1.85.0) and fuzz.yml (toolchain: 1.85) should be bumped to 1.89 or include an explicit 1.89 job.
🤖 Prompt for AI Agents
In clippy.toml around lines 1-1, update project documentation and CI to match
the new MSRV: change the README.md Rust badge text at line 15 and the MSRV
section content at lines 105–109 from “1.29” to “1.89”, update
.github/workflows/rust.yml matrix entry `rust: 1.85.0` to `1.89` (or add a 1.89
job), and update .github/workflows/fuzz.yml `toolchain: 1.85` to `1.89`;
optionally add `rust-version = "1.89"` to other crates' Cargo.toml files if they
should advertise the MSRV, then run CI to verify the changes.

2 changes: 1 addition & 1 deletion dash-spv/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Use domain-specific error types:

## MSRV and Dependencies

- **Minimum Rust Version**: 1.80
- **Minimum Rust Version**: 1.89
- **Core dependencies**: `dashcore`, `tokio`, `async-trait`, `thiserror`
- **Built on**: `dashcore` library with Dash-specific features enabled
- **Async runtime**: Tokio with full feature set
Expand Down
5 changes: 3 additions & 2 deletions dash-spv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ authors = ["Dash Core Team"]
description = "Dash SPV (Simplified Payment Verification) client library"
license = "MIT"
repository = "https://github.com/dashpay/rust-dashcore"
rust-version = "1.80"
rust-version = "1.89"

[dependencies]
# Core Dash libraries
dashcore = { path = "../dash", features = ["std", "serde", "core-block-hash-use-x11", "message_verification", "bls", "quorum_validation"] }
dashcore_hashes = { path = "../hashes" }
key-wallet = { path = "../key-wallet" }
key-wallet-manager = { path = "../key-wallet-manager" }

# BLS signatures
blsful = "2.5"
blsful = { git = "https://github.com/dashpay/agora-blsful", rev = "be108b2cf6ac64eedbe04f91c63731533c8956bc" }

# CLI
clap = { version = "4.0", features = ["derive"] }
Expand Down
6 changes: 5 additions & 1 deletion dash-spv/examples/filter_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use dash_spv::network::MultiPeerNetworkManager;
use dash_spv::storage::MemoryStorageManager;
use dash_spv::{init_logging, ClientConfig, DashSpvClient};
use dashcore::{Address, Network};
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::spv_wallet_manager::SPVWalletManager;
use key_wallet_manager::wallet_manager::WalletManager;
use std::str::FromStr;
use std::sync::Arc;
use tokio::sync::RwLock;
Expand All @@ -31,7 +33,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let storage_manager = MemoryStorageManager::new().await?;

// Create wallet manager
let wallet = Arc::new(RwLock::new(SPVWalletManager::new()));
let wallet = Arc::new(RwLock::new(SPVWalletManager::with_base(WalletManager::<
ManagedWalletInfo,
>::new())));

// Create the client
let mut client = DashSpvClient::new(config, network_manager, storage_manager, wallet).await?;
Expand Down
6 changes: 5 additions & 1 deletion dash-spv/examples/reorg_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ mod disabled_example {
use dash_spv::types::ChainState;
use dashcore::{blockdata::constants::genesis_block, Header as BlockHeader, Network};
use dashcore_hashes::Hash;
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::spv_wallet_manager::SPVWalletManager;
use key_wallet_manager::wallet_manager::WalletManager;
use std::sync::Arc;
use tokio::sync::RwLock;

Expand All @@ -38,7 +40,9 @@ mod disabled_example {
let network = Network::Dash;
let genesis = genesis_block(network).header;
let mut chain_state = ChainState::new_for_network(network);
let wallet_manager = Arc::new(RwLock::new(SPVWalletManager::new()));
let wallet_manager = Arc::new(RwLock::new(SPVWalletManager::with_base(WalletManager::<
ManagedWalletInfo,
>::new())));
let mut storage = MemoryStorageManager::new().await?;

println!("📦 Building main chain: genesis -> block1 -> block2");
Expand Down
6 changes: 5 additions & 1 deletion dash-spv/examples/simple_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
use dash_spv::network::MultiPeerNetworkManager;
use dash_spv::storage::MemoryStorageManager;
use dash_spv::{init_logging, ClientConfig, DashSpvClient};
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::spv_wallet_manager::SPVWalletManager;
use key_wallet_manager::wallet_manager::WalletManager;
use std::sync::Arc;
use tokio::sync::RwLock;

Expand All @@ -24,7 +26,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let storage_manager = MemoryStorageManager::new().await?;

// Create wallet manager
let wallet = Arc::new(RwLock::new(SPVWalletManager::new()));
let wallet = Arc::new(RwLock::new(SPVWalletManager::with_base(WalletManager::<
ManagedWalletInfo,
>::new())));

// Create the client
let mut client = DashSpvClient::new(config, network_manager, storage_manager, wallet).await?;
Expand Down
10 changes: 5 additions & 5 deletions dash-spv/src/bloom/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ mod tests {
use crate::bloom::{
builder::BloomFilterBuilder,
manager::{BloomFilterConfig, BloomFilterManager},
stats::{BloomFilterStats, BloomStatsTracker, DetailedBloomStats},
stats::BloomStatsTracker,
utils,
};
use crate::error::SpvError;

use dashcore::{
address::{Address, Payload},
blockdata::script::{Script, ScriptBuf},
bloom::{BloomFilter, BloomFlags},
blockdata::script::ScriptBuf,
bloom::BloomFlags,
hash_types::PubkeyHash,
OutPoint, Txid,
};
use std::str::FromStr;

use std::sync::Arc;

// Test data helpers
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/chain/checkpoint_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ mod tests {
create_test_checkpoint(300000, 1700000000), // Nov 2023
];

let mut manager = CheckpointManager::new(checkpoints);
let manager = CheckpointManager::new(checkpoints);

// Test wallet created in 2019
let wallet_time_2019 = 1550000000u32;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/chain/fork_detector_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod tests {
use crate::types::ChainState;
use dashcore::blockdata::constants::genesis_block;
use dashcore::{BlockHash, Header as BlockHeader, Network};
use dashcore_hashes::{Hash, HashEngine};
use dashcore_hashes::Hash;
use std::sync::{Arc, Mutex};
use std::thread;

Expand Down
4 changes: 2 additions & 2 deletions dash-spv/src/chain/reorg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use super::{ChainTip, Fork};
use crate::storage::ChainStorage;
use crate::types::ChainState;
use dashcore::{BlockHash, Header as BlockHeader, Transaction, Txid};
use dashcore_hashes::Hash;
use std::sync::Arc;
use tracing;

Expand Down Expand Up @@ -539,9 +538,10 @@ impl ReorgManager {
mod tests {
use super::*;
use crate::chain::ChainWork;
use crate::storage::{MemoryStorage, MemoryStorageManager};
use crate::storage::MemoryStorage;
use dashcore::blockdata::constants::genesis_block;
use dashcore::Network;
use dashcore_hashes::Hash;

fn create_test_header(prev: &BlockHeader, nonce: u32) -> BlockHeader {
let mut header = prev.clone();
Expand Down
23 changes: 10 additions & 13 deletions dash-spv/src/client/block_processor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
#[cfg(test)]
mod tests {
use crate::client::block_processor::{BlockProcessingTask, BlockProcessor};
use crate::error::SpvError;

use crate::storage::memory::MemoryStorageManager;
use crate::storage::StorageManager;
use crate::types::{SpvEvent, SpvStats, WatchItem};
use dashcore::{
blockdata::constants::genesis_block, consensus::encode::serialize, hash_types::FilterHash,
Address, Block, Network, Transaction,
};
use crate::types::{SpvEvent, SpvStats};
use dashcore::{blockdata::constants::genesis_block, Block, Network, Transaction};
use std::collections::HashSet;
use std::str::FromStr;

use std::sync::Arc;
use tokio::sync::{mpsc, oneshot, Mutex, RwLock};

Expand Down Expand Up @@ -105,7 +102,7 @@ mod tests {

#[tokio::test]
async fn test_process_block() {
let (mut processor, task_tx, mut event_rx, wallet, storage) = setup_processor().await;
let (processor, task_tx, mut event_rx, wallet, storage) = setup_processor().await;

// Create a test block
let block = create_test_block(Network::Dash);
Expand Down Expand Up @@ -164,7 +161,7 @@ mod tests {

#[tokio::test]
async fn test_process_compact_filter() {
let (mut processor, task_tx, mut event_rx, _wallet, _storage) = setup_processor().await;
let (processor, task_tx, mut event_rx, _wallet, _storage) = setup_processor().await;

// Create a test block
let block = create_test_block(Network::Dash);
Expand Down Expand Up @@ -270,7 +267,7 @@ mod tests {
let storage = Arc::new(Mutex::new(MemoryStorageManager::new().await.unwrap()));
let watch_items = Arc::new(RwLock::new(HashSet::new()));

let mut processor = BlockProcessor::new(
let processor = BlockProcessor::new(
task_rx,
wallet,
storage,
Expand Down Expand Up @@ -319,7 +316,7 @@ mod tests {

#[tokio::test]
async fn test_process_mempool_transaction() {
let (mut processor, task_tx, mut event_rx, wallet, _storage) = setup_processor().await;
let (processor, task_tx, event_rx, wallet, _storage) = setup_processor().await;

// Create a test transaction
let block = create_test_block(Network::Dash);
Expand Down Expand Up @@ -358,7 +355,7 @@ mod tests {

#[tokio::test]
async fn test_shutdown() {
let (mut processor, task_tx, _event_rx, _wallet, _storage) = setup_processor().await;
let (processor, task_tx, _event_rx, _wallet, _storage) = setup_processor().await;

// Start processor
let processor_handle = tokio::spawn(async move { processor.run().await });
Expand All @@ -375,7 +372,7 @@ mod tests {

#[tokio::test]
async fn test_block_not_found_in_storage() {
let (mut processor, task_tx, mut event_rx, _wallet, _storage) = setup_processor().await;
let (processor, task_tx, mut event_rx, _wallet, _storage) = setup_processor().await;

let block = create_test_block(Network::Dash);
let block_hash = block.block_hash();
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/config_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod tests {
use dashcore::{Address, Network};
use std::net::SocketAddr;
use std::path::PathBuf;
use std::str::FromStr;

use std::time::Duration;

#[test]
Expand Down
4 changes: 2 additions & 2 deletions dash-spv/src/client/watch_manager_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#[cfg(test)]
mod tests {
use crate::client::watch_manager::{WatchItemUpdateSender, WatchManager};
use crate::client::watch_manager::WatchManager;
use crate::error::SpvError;
use crate::storage::memory::MemoryStorageManager;
use crate::storage::StorageManager;
use crate::types::WatchItem;
use dashcore::{Address, Network, OutPoint, Script, ScriptBuf, Txid};
use dashcore::{Address, Network, OutPoint, Txid};
use std::collections::HashSet;
use std::str::FromStr;
use std::sync::Arc;
Expand Down
4 changes: 3 additions & 1 deletion dash-spv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
//! use dash_spv::storage::MemoryStorageManager;
//! use dashcore::Network;
//! use key_wallet_manager::spv_wallet_manager::SPVWalletManager;
//! use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
//! use key_wallet_manager::wallet_manager::WalletManager;
//! use std::sync::Arc;
//! use tokio::sync::RwLock;
//!
Expand All @@ -30,7 +32,7 @@
//! // Create the required components
//! let network = MultiPeerNetworkManager::new(&config).await?;
//! let storage = MemoryStorageManager::new().await?;
//! let wallet = Arc::new(RwLock::new(SPVWalletManager::new()));
//! let wallet = Arc::new(RwLock::new(SPVWalletManager::with_base(WalletManager::<ManagedWalletInfo>::new())));
//!
//! // Create and start the client
//! let mut client = DashSpvClient::new(config.clone(), network, storage, wallet).await?;
Expand Down
7 changes: 6 additions & 1 deletion dash-spv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use tokio::signal;

use dash_spv::terminal::TerminalGuard;
use dash_spv::{ClientConfig, DashSpvClient, Network};
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::wallet_manager::WalletManager;

#[tokio::main]
async fn main() {
Expand Down Expand Up @@ -221,7 +223,10 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
tracing::info!("Using data directory: {}", data_dir.display());

// Create the SPV wallet manager
let spv_wallet = key_wallet_manager::spv_wallet_manager::SPVWalletManager::new();
let spv_wallet =
key_wallet_manager::spv_wallet_manager::SPVWalletManager::with_base(WalletManager::<
ManagedWalletInfo,
>::new());
let wallet = Arc::new(tokio::sync::RwLock::new(spv_wallet));

// Create network manager
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/mempool_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl MempoolFilter {
#[cfg(test)]
mod tests {
use super::*;
use dashcore::{hashes::Hash, Network, OutPoint, Script, ScriptBuf, TxIn, TxOut, Witness};
use dashcore::{Network, OutPoint, ScriptBuf, TxIn, TxOut, Witness};
use std::str::FromStr;

// Helper to create a test address
Expand Down
1 change: 0 additions & 1 deletion dash-spv/src/network/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ impl Default for ConnectionPool {
#[cfg(test)]
mod tests {
use super::*;
use dashcore::Network;

#[tokio::test]
async fn test_connection_pool_basic() {
Expand Down
1 change: 0 additions & 1 deletion dash-spv/src/network/reputation_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
mod tests {
use super::super::*;
use std::net::SocketAddr;
use std::time::Duration;

#[tokio::test]
async fn test_basic_reputation_operations() {
Expand Down
3 changes: 1 addition & 2 deletions dash-spv/src/network/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ mod qrinfo_tests {
use dashcore::network::message::NetworkMessage;
use dashcore::network::message_qrinfo::{MNSkipListMode, QRInfo, QuorumSnapshot};
use dashcore::network::message_sml::MnListDiff;
use dashcore::sml::llmq_type::LLMQType;
use dashcore::transaction::special_transaction::quorum_commitment::QuorumEntry;

use dashcore::BlockHash;

fn create_test_qr_info() -> QRInfo {
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/headers2_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ mod tests {

#[test]
fn test_statistics() {
let mut manager = Headers2StateManager::new();
let manager = Headers2StateManager::new();
let stats = manager.get_stats();

assert_eq!(stats.total_headers, 0);
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/sequential/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ mod tests {
let mut recovery_manager = RecoveryManager::new();

// Create a test phase
let mut phase = SyncPhase::DownloadingHeaders {
let phase = SyncPhase::DownloadingHeaders {
start_time: std::time::Instant::now(),
start_height: 50,
current_height: 100,
Expand Down
Loading
Loading