Skip to content

SPV: Mainnet sync uses embedded MnListDiff that is below latest checkpoint 2,300,000 #215

@pauldelucia

Description

@pauldelucia

This may not be an actual issue but just noting it here to come back to when I have time.

Logs:

2025-11-27T05:41:27.973295Z  INFO dash_spv::sync::masternodes: 📦 Using embedded MNListDiff for dash - starting from height 2227096
2025-11-27T05:41:30.290693Z ERROR dash_spv::sync::masternodes: ❌ MnListDiff insertion failed: Failed to get height for base block hash 000000000000000899fdcd85241296146c365b238a655517da8dcd08a8a79b98: Height not found for block hash: 000000000000000899fdcd85241296146c365b238a655517da8dcd08a8a79b98

Code:

// dash-spv/src/sync/masternodes.rs

impl<S: StorageManager + Send + Sync + 'static, N: NetworkManager + Send + Sync + 'static>
    MasternodeSyncManager<S, N>
{
    /// Create a new masternode sync manager.
    pub fn new(config: &ClientConfig) -> Self {
        let (engine, mnlist_diffs) = if config.enable_masternodes {
            // Try to load embedded MNListDiff data for faster initial sync
            if let Some(embedded) = super::embedded_data::get_embedded_diff(config.network) {
                tracing::info!(
                    "📦 Using embedded MNListDiff for {} - starting from height {}",
                    config.network,
                    embedded.target_height
                );
// dash-spv/src/sync/embedded_data.rs

/// Get the embedded MNListDiff for a specific network, if available.
pub fn get_embedded_diff(network: Network) -> Option<EmbeddedDiff> {
    match network {
        Network::Dash => {
            let bytes = MAINNET_MNLIST_DIFF_0_2227096;
            match deserialize::<MnListDiff>(bytes) {
                Ok(diff) => Some(EmbeddedDiff {
                    diff,
                    base_height: 0,
                    target_height: 2227096,
                }),
                Err(e) => {
                    tracing::warn!("Failed to deserialize embedded mainnet MNListDiff: {}", e);
                    None
                }
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions