Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added stages to the sync info rpc type #1079

Merged
merged 7 commits into from
Jul 19, 2024
Merged
Changes from 1 commit
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
13 changes: 11 additions & 2 deletions crates/rpc-types-eth/src/syncing.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use alloy_primitives::{B512, U256, U64};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::collections::{BTreeMap, HashMap};
use std::collections::BTreeMap;

/// Syncing info
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
Expand All @@ -18,7 +18,16 @@ pub struct SyncInfo {
pub warp_chunks_processed: Option<U256>,
/// The details of the sync stages as an hashmap
/// where the key is the name of the stage and the value is the block number.
pub stages: Option<HashMap<String, U256>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stages: Option<Vec<Stage>>,
}

/// The detail of the sync stages.
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Stage {
name: String,
block: U64,
loocapro marked this conversation as resolved.
Show resolved Hide resolved
}

/// Peers info
Expand Down