Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b8ffa26
feat(key-wallet-manager): add insert_wallet, get_wallet_and_info_mut,…
shumkov Apr 9, 2026
8384ae8
feat(key-wallet): changeset module + prep work for BDK-style persistence
shumkov Apr 10, 2026
66e6462
feat(key-wallet): BDK-style mutate-and-return changesets on ManagedCo…
shumkov Apr 10, 2026
e018f77
feat(key-wallet): apply_changeset for idempotent persistence restore
shumkov Apr 10, 2026
1d6b616
fix(key-wallet): Phase 7 review pass on apply_changeset
shumkov Apr 10, 2026
c07207a
refactor(key-wallet): BDK-style per-account changeset shape
shumkov Apr 10, 2026
6111c8f
fix(key-wallet): Phase 7.5 review pass
shumkov Apr 10, 2026
45a9b12
refactor(key-wallet): drop add_to_state flag from address generation
shumkov Apr 10, 2026
b6479e9
refactor(key-wallet): apply_changeset consumes changeset by value
shumkov Apr 10, 2026
b4d83a3
test(key-wallet): trim redundant clone-comment in apply tests
shumkov Apr 10, 2026
f9ee271
feat(key-wallet): AccountType::to_db_key + AddressPoolType::db_discri…
shumkov Apr 11, 2026
8ade73e
feat(key-wallet-manager): add insert_wallet, get_wallet_and_info_mut,…
shumkov Apr 9, 2026
36e5daa
feat(key-wallet): changeset module + prep work for BDK-style persistence
shumkov Apr 10, 2026
780fa08
feat(key-wallet): BDK-style mutate-and-return changesets on ManagedCo…
shumkov Apr 10, 2026
2613b2f
feat(key-wallet): apply_changeset for idempotent persistence restore
shumkov Apr 10, 2026
ca764c4
fix(key-wallet): Phase 7 review pass on apply_changeset
shumkov Apr 10, 2026
aa0817a
refactor(key-wallet): BDK-style per-account changeset shape
shumkov Apr 10, 2026
8ebd609
fix(key-wallet): Phase 7.5 review pass
shumkov Apr 10, 2026
5928ceb
refactor(key-wallet): drop add_to_state flag from address generation
shumkov Apr 10, 2026
1537001
refactor(key-wallet): apply_changeset consumes changeset by value
shumkov Apr 10, 2026
f59bc0d
test(key-wallet): trim redundant clone-comment in apply tests
shumkov Apr 10, 2026
9886518
fix(dashcore): Address<NetworkChecked> serde deserialize no longer ha…
shumkov Apr 11, 2026
799edea
merge(feat/platform-wallet-run): v0.42-dev upstream fixes
shumkov Apr 11, 2026
66219f4
fix(key-wallet): correct AssetLockTx structure per DIP-00X
shumkov Apr 11, 2026
d76ba63
fix(dash-spv): remove overly-strict is_synced gate from broadcast
shumkov Apr 11, 2026
65c1fb0
merge(feat/platform-wallet-run): AssetLockTx structure + dash-spv bro…
shumkov Apr 11, 2026
40f14c3
style(key-wallet): apply cargo fmt across managed wallet modules
QuantumExplorer Apr 13, 2026
b169e00
Merge remote-tracking branch 'origin/v0.42-dev' into feat/platform-wa…
QuantumExplorer Apr 14, 2026
9373506
feat(dash-spv): add fixed testnet peer IPs (68.67.122.1-29)
QuantumExplorer Apr 14, 2026
40c58a6
Squashed commit of the following:
xdustinface Apr 13, 2026
39479d8
feat(key-wallet-manager): add WalletPersistence trait and persist blo…
shumkov Apr 16, 2026
952d209
fix: update all call sites for WalletPersistence API changes
shumkov Apr 16, 2026
394b0ba
refactor: remove flush from WalletPersistence trait
shumkov Apr 16, 2026
60a8ade
Merge branch 'feat/platform-wallet2' of github.com:dashpay/rust-dashc…
QuantumExplorer Apr 16, 2026
022887f
Merge origin/v0.42-dev into feat/platform-wallet2
QuantumExplorer Apr 17, 2026
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
6 changes: 1 addition & 5 deletions dash-spv/src/client/transactions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Transaction-related client APIs (e.g., broadcasting)

use crate::error::{NetworkError, Result, SpvError, SyncError};
use crate::error::{NetworkError, Result, SpvError};
use crate::network::NetworkManager;
use crate::storage::StorageManager;
use dashcore::network::message::NetworkMessage;
Expand All @@ -16,10 +16,6 @@ impl<W: WalletInterface, N: NetworkManager, S: StorageManager, H: EventHandler>
/// The transaction is also injected into the local message pipeline so that
/// the mempool manager processes it immediately.
pub async fn broadcast_transaction(&self, tx: &dashcore::Transaction) -> Result<()> {
if !self.sync_progress().await.is_synced() {
return Err(SpvError::Sync(SyncError::NotSynced));
}

let network_guard = self.network.lock().await;

if network_guard.peer_count() == 0 {
Expand Down
11 changes: 11 additions & 0 deletions dash-spv/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ pub enum SyncError {
/// Operation requires the client to be fully synced
#[error("Client is not synced")]
NotSynced,

/// Wallet error during block processing (e.g. persistence failure)
#[error("Wallet error: {0}")]
Wallet(String),
}

impl SyncError {
Expand All @@ -252,6 +256,7 @@ impl SyncError {
SyncError::Storage(_) => "storage",
SyncError::Headers2DecompressionFailed(_) => "headers2",
SyncError::MasternodeSyncFailed(_) => "masternode",
SyncError::Wallet(_) => "wallet",
// Deprecated variant - should not be used
#[allow(deprecated)]
SyncError::SyncFailed(_) => "unknown",
Expand Down Expand Up @@ -329,6 +334,12 @@ impl From<ValidationError> for SyncError {
}
}

impl From<key_wallet_manager::WalletError> for SyncError {
fn from(err: key_wallet_manager::WalletError) -> Self {
SyncError::Wallet(err.to_string())
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
33 changes: 33 additions & 0 deletions dash-spv/src/network/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,39 @@ pub const MAINNET_DNS_SEEDS: &[&str] = &[
// DNS seeds for Dash testnet
pub const TESTNET_DNS_SEEDS: &[&str] = &["testnet-seed.dashdot.io"];

// Fixed peer IPs for Dash testnet (hp-masternodes)
pub const TESTNET_FIXED_PEERS: &[&str] = &[
"68.67.122.1",
"68.67.122.2",
"68.67.122.3",
"68.67.122.4",
"68.67.122.5",
"68.67.122.6",
"68.67.122.7",
"68.67.122.8",
"68.67.122.9",
"68.67.122.10",
"68.67.122.11",
"68.67.122.12",
"68.67.122.13",
"68.67.122.14",
"68.67.122.15",
"68.67.122.16",
"68.67.122.17",
"68.67.122.18",
"68.67.122.19",
"68.67.122.20",
"68.67.122.21",
"68.67.122.22",
"68.67.122.23",
"68.67.122.24",
"68.67.122.25",
"68.67.122.26",
"68.67.122.27",
"68.67.122.28",
"68.67.122.29",
];

// Peer exchange
pub const MAX_ADDR_TO_SEND: usize = 1000;
pub const MAX_ADDR_TO_STORE: usize = 2000;
Expand Down
12 changes: 11 additions & 1 deletion dash-spv/src/network/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@ impl DnsDiscovery {
}
}

// For testnet, add fixed peers as fallback if DNS returned few/no results
if matches!(network, Network::Testnet) {
use super::constants::TESTNET_FIXED_PEERS;
for ip_str in TESTNET_FIXED_PEERS {
if let Ok(ip) = ip_str.parse::<IpAddr>() {
addresses.push(SocketAddr::new(ip, port));
}
}
}

// Deduplicate addresses
addresses.sort();
addresses.dedup();

tracing::info!("Discovered {} unique peer addresses from DNS seeds", addresses.len());
tracing::info!("Discovered {} unique peer addresses for {:?}", addresses.len(), network);
addresses
}

Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/blocks/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<H: BlockHeaderStorage, B: BlockStorage, W: WalletInterface> BlocksManager<H

// Process block through wallet
let mut wallet = self.wallet.write().await;
let result = wallet.process_block(&block, height).await;
let result = wallet.process_block(&block, height).await?;
drop(wallet);

let total_relevant = result.relevant_tx_count();
Expand Down
6 changes: 3 additions & 3 deletions dash-spv/src/test_utils/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ pub struct TestEventHandler {

impl TestEventHandler {
pub fn new() -> Self {
let (sync_tx, _) = broadcast::channel(256);
let (network_tx, _) = broadcast::channel(256);
let (sync_tx, _) = broadcast::channel(10000);
let (network_tx, _) = broadcast::channel(10000);
let (progress_tx, _) = watch::channel(SyncProgress::default());
let (wallet_tx, _) = broadcast::channel(256);
let (wallet_tx, _) = broadcast::channel(10000);
Self {
sync_tx,
network_tx,
Expand Down
Loading
Loading