pub struct SyncState {Show 16 fields
pub ibd: bool,
pub assume_valid_target_reached: bool,
pub assume_valid_target: Byte32,
pub min_chain_work_reached: bool,
pub min_chain_work: Uint128,
pub best_known_block_number: BlockNumber,
pub best_known_block_timestamp: Timestamp,
pub orphan_blocks_count: Uint64,
pub inflight_blocks_count: Uint64,
pub unverified_tip_number: BlockNumber,
pub unverified_tip_hash: H256,
pub tip_number: BlockNumber,
pub tip_hash: H256,
pub fast_time: Uint64,
pub normal_time: Uint64,
pub low_time: Uint64,
}
Expand description
The overall chain synchronization state of this local node.
Fields§
§ibd: bool
Whether the local node is in IBD, Initial Block Download.
When a node starts and its chain tip timestamp is far behind the wall clock, it will enter the IBD until it catches up the synchronization.
During IBD, the local node only synchronizes the chain with one selected remote node and stops responding to most P2P requests.
assume_valid_target_reached: bool
Is ckb reached the assume_valid_target? If no assume_valid_target, this will be true.
assume_valid_target: Byte32
The assume_valid_target specified by ckb, if no assume_valid_target, this will be all zero.
min_chain_work_reached: bool
Is ckb reached the min_chain_work?
min_chain_work: Uint128
This field acts as a security measure to ensure that a node only synchronizes with other nodes that have a significant amount of computational work invested in them, thereby preventing certain types of attacks and ensuring network integrity. Only the mainnet uses a hardcoded value for this field.
best_known_block_number: BlockNumber
This is the best known block number observed by the local node from the P2P network.
The best here means that the block leads a chain which has the best known accumulated difficulty.
This can be used to estimate the synchronization progress. If this RPC returns B, and the
RPC get_tip_block_number
returns T, the node has already synchronized T/B blocks.
best_known_block_timestamp: Timestamp
This is timestamp of the same block described in best_known_block_number
.
orphan_blocks_count: Uint64
Count of orphan blocks the local node has downloaded.
The local node downloads multiple blocks simultaneously but blocks must be connected consecutively. If a descendant is downloaded before its ancestors, it becomes an orphan block.
If this number is too high, it indicates that block download has stuck at some block.
inflight_blocks_count: Uint64
Count of downloading blocks.
unverified_tip_number: BlockNumber
The block number of current unverified tip block
unverified_tip_hash: H256
The block hash of current unverified tip block
tip_number: BlockNumber
The block number of current tip block
tip_hash: H256
The block hash of current tip block
fast_time: Uint64
The download scheduler’s time analysis data, the fast is the 1/3 of the cut-off point, unit ms
normal_time: Uint64
The download scheduler’s time analysis data, the normal is the 4/5 of the cut-off point, unit ms
low_time: Uint64
The download scheduler’s time analysis data, the low is the 9/10 of the cut-off point, unit ms
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SyncState
impl<'de> Deserialize<'de> for SyncState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SyncState
impl JsonSchema for SyncState
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreimpl Eq for SyncState
impl StructuralPartialEq for SyncState
Auto Trait Implementations§
impl Freeze for SyncState
impl RefUnwindSafe for SyncState
impl Send for SyncState
impl Sync for SyncState
impl Unpin for SyncState
impl UnwindSafe for SyncState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)