Improve logging and cleanup in miner around block sealing (#10745)
* Stop breaking out of loop if a non-canonical hash is found * include expected hash in log msg * More logging * Scope * Syntax * Log in blank RollingFinality Escalate bad proposer to warning * Check validator set size: warn if 1 or even number * More readable code * Use SimpleList::new * Extensive logging on unexpected non-canonical hash * Wording * wip * Update ethcore/blockchain/src/blockchain.rs Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Improved logging, address grumbles * Update ethcore/src/engines/validator_set/simple_list.rs Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com> * Report benign misbehaviour iff currently a validator * Report malicious behaviour iff we're a validator * Escalate to warning and fix wording * Test reporting behaviour Don't require node to be part of the validator set to report malicious behaviour * Include missing parent hash in MissingParent error * Update ethcore/src/engines/validator_set/simple_list.rs Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com> * docs * remove unneeded into() Move check for parent_step == step for clarity&efficiency Remove dead code for Seal::Proposal * typo * Wording * naming * WIP * cleanup * cosmetics * cosmetics and one less lvar * spelling * Better loggin when a block is already in chain * More logging * On second thought non-validators are allowed to report * cleanup * remove dead code * Keep track of the hash of the last imported block * Let it lock * Serialize access to block sealing * Take a lock while sealing a block * Cleanup * whitespace
This commit is contained in:
@@ -548,12 +548,18 @@ impl BlockDownloader {
|
||||
let result = if let Some(receipts) = receipts {
|
||||
io.chain().queue_ancient_block(block, receipts)
|
||||
} else {
|
||||
trace_sync!(self, "Importing block #{}/{}", number, h);
|
||||
io.chain().import_block(block)
|
||||
};
|
||||
|
||||
match result {
|
||||
Err(EthcoreError::Import(ImportError::AlreadyInChain)) => {
|
||||
trace_sync!(self, "Block already in chain {:?}", h);
|
||||
let is_canonical = if io.chain().block_hash(BlockId::Number(number)).is_some() {
|
||||
"canoncial"
|
||||
} else {
|
||||
"not canonical"
|
||||
};
|
||||
trace_sync!(self, "Block #{} is already in chain {:?} – {}", number, h, is_canonical);
|
||||
self.block_imported(&h, number, &parent);
|
||||
},
|
||||
Err(EthcoreError::Import(ImportError::AlreadyQueued)) => {
|
||||
|
||||
Reference in New Issue
Block a user