Update libp2p (#2101)

This is a little bit of a tip-of-the-iceberg PR. It houses a lot of code changes in the libp2p dependency. 

This needs a bit of thorough testing before merging. 

The primary code changes are:
- General libp2p dependency update
- Gossipsub refactor to shift compression into gossipsub providing performance improvements and improved API for handling compression



Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
Age Manning
2020-12-23 07:53:36 +00:00
parent b5e81eb6b2
commit 2931b05582
22 changed files with 396 additions and 509 deletions

View File

@@ -713,7 +713,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
// The sent block is not the correct block, remove the head block and downvote
// the peer
let _ = parent_request.downloaded_blocks.pop();
let peer = parent_request.last_submitted_peer.clone();
let peer = parent_request.last_submitted_peer;
warn!(self.log, "Peer sent invalid parent.";
"peer_id" => %peer,
@@ -759,7 +759,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
}
Ok(_) | Err(BlockError::BlockIsAlreadyKnown { .. }) => {
let process_id = ProcessId::ParentLookup(
parent_request.last_submitted_peer.clone(),
parent_request.last_submitted_peer,
chain_block_hash,
);
let blocks = parent_request.downloaded_blocks;
@@ -852,7 +852,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
// We continue to search for the chain of blocks from the same peer. Other peers are not
// guaranteed to have this chain of blocks.
let peer_id = parent_request.last_submitted_peer.clone();
let peer_id = parent_request.last_submitted_peer;
if let Ok(request_id) = self.network.blocks_by_root_request(peer_id, request) {
// if the request was successful add the queue back into self