Advanced error handling for syncing (#819)

* Initial block processing thread design

* Correct compilation issues

* Increase logging and request from all given peers

* Patch peer request bug

* Adds fork choice to block processing

* Adds logging for bug isolation

* Patch syncing for chains with skip-slots

* Bump block processing error logs

* Improve logging for attestation processing

* Randomize peer selection during sync

* Resuming chains restarts from local finalized slot

* Downgrades Arc batches to Rc batches

* Add clippy fixes

* Add advanced error handling for invalid/malicious batches

* Downgrade Rc<Batch> to Option<Batch> to pass processed batches to chains

* Squash edge case rpc and syncing bugs

* Process empty batches which could end chains

* Removes last_processed_id concept to account for ending skip-slot batches

* Add logging for chain purges

* Adds retries to re-request batch logging

* Remove bug finding log

* Add reviewers suggestions

* Revert to master modifications

* Line wrapping

* Revert to master
This commit is contained in:
Age Manning
2020-01-23 19:25:13 +11:00
committed by GitHub
parent 23a35c3767
commit 81b028b805
5 changed files with 195 additions and 93 deletions

View File

@@ -248,8 +248,9 @@ impl<T: BeaconChainTypes> RangeSync<T> {
})
.is_none();
if id_not_found {
// The request didn't exist in any `SyncingChain`. Could have been an old request. Log
// and ignore
// The request didn't exist in any `SyncingChain`. Could have been an old request or
// the chain was purged due to being out of date whilst a request was pending. Log
// and ignore.
debug!(self.log, "Range response without matching request"; "peer" => format!("{:?}", peer_id), "request_id" => request_id);
}
}
@@ -307,7 +308,9 @@ impl<T: BeaconChainTypes> RangeSync<T> {
}
Some((_, ProcessingResult::KeepChain)) => {}
None => {
warn!(self.log, "No chains match the block processing id"; "id" => processing_id);
// This can happen if a chain gets purged due to being out of date whilst a
// batch process is in progress.
debug!(self.log, "No chains match the block processing id"; "id" => processing_id);
}
}
}