Ancient target set. InvalidStateRoot bug (#69) (#149)

This commit is contained in:
rakita
2020-12-10 17:57:26 +01:00
committed by GitHub
parent ea3efd926e
commit 837e8b8725
5 changed files with 78 additions and 33 deletions

View File

@@ -92,7 +92,6 @@ impl CacheSizes {
pub struct SyncInfo {
last_imported_block_number: BlockNumber,
last_imported_old_block_number: Option<BlockNumber>,
num_peers: usize,
max_peers: u32,
snapshot_sync: bool,
@@ -160,7 +159,6 @@ impl InformantData for FullNodeInformantData {
last_imported_block_number: status
.last_imported_block_number
.unwrap_or(chain_info.best_block_number),
last_imported_old_block_number: status.last_imported_old_block_number,
num_peers: status.num_peers,
max_peers: status
.current_max_peers(*num_peers_range.start(), *num_peers_range.end()),
@@ -265,7 +263,7 @@ impl<T: InformantData> Informant<T> {
false => t,
};
info!(target: "import", "{} {} {} {}",
info!(target: "import", "{}{} {} {} {}",
match importing {
true => match snapshot_sync {
false => format!("Syncing {} {} {} {}+{} Qed",
@@ -301,18 +299,22 @@ impl<T: InformantData> Informant<T> {
},
false => String::new(),
},
match chain_info.ancient_block_number {
Some(ancient_number) => format!(" (Ancient:#{})", ancient_number),
None => String::new(),
},
match sync_info.as_ref() {
Some(ref sync_info) => format!("{}{}/{} peers",
match importing {
true => format!("{}",
if self.target.executes_transactions() {
paint(Green.bold(), format!("{:>8} ", format!("#{}", sync_info.last_imported_block_number)))
paint(Green.bold(), format!("{:>8} ", format!("LI:#{}", sync_info.last_imported_block_number)))
} else {
String::new()
}
),
false => match sync_info.last_imported_old_block_number {
Some(number) => format!("{} ", paint(Yellow.bold(), format!("{:>8}", format!("#{}", number)))),
false => match chain_info.ancient_block_number {
Some(number) => format!("{} ", paint(Yellow.bold(), format!("{:>8}", format!("AB:#{}", number)))),
None => String::new(),
}
},