Update to latest libp2p
This commit is contained in:
parent
c1d609902a
commit
7ad9805f02
@ -8,7 +8,7 @@ edition = "2018"
|
|||||||
beacon_chain = { path = "../beacon_chain" }
|
beacon_chain = { path = "../beacon_chain" }
|
||||||
clap = "2.32.0"
|
clap = "2.32.0"
|
||||||
# SigP repository until PR is merged
|
# SigP repository until PR is merged
|
||||||
libp2p = { git = "https://github.com/SigP/rust-libp2p", rev = "b3c32d9a821ae6cc89079499cc6e8a6bab0bffc3" }
|
libp2p = { git = "https://github.com/SigP/rust-libp2p", rev = "fb852bcc2b9b3935555cc93930e913cbec2b0688" }
|
||||||
types = { path = "../../eth2/types" }
|
types = { path = "../../eth2/types" }
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
|
@ -522,9 +522,30 @@ impl<T: BeaconChainTypes> SimpleSync<T> {
|
|||||||
BlockProcessingOutcome::ParentUnknown { .. } => {
|
BlockProcessingOutcome::ParentUnknown { .. } => {
|
||||||
self.import_queue
|
self.import_queue
|
||||||
.enqueue_full_blocks(vec![block], peer_id.clone());
|
.enqueue_full_blocks(vec![block], peer_id.clone());
|
||||||
|
trace!(
|
||||||
|
self.log,
|
||||||
|
"NewGossipBlock";
|
||||||
|
"peer" => format!("{:?}", peer_id),
|
||||||
|
);
|
||||||
|
|
||||||
SHOULD_FORWARD_GOSSIP_BLOCK
|
// Ignore any block from a finalized slot.
|
||||||
}
|
if self.slot_is_finalized(block.slot) {
|
||||||
|
warn!(
|
||||||
|
self.log, "NewGossipBlock";
|
||||||
|
"msg" => "new block slot is finalized.",
|
||||||
|
"block_slot" => block.slot,
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let block_root = Hash256::from_slice(&block.hash_tree_root());
|
||||||
|
|
||||||
|
// Ignore any block that the chain already knows about.
|
||||||
|
if self.chain_has_seen_block(&block_root) {
|
||||||
|
println!("this happened");
|
||||||
|
// TODO: Age confirm that we shouldn't forward a block if we already know of it.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
BlockProcessingOutcome::FutureSlot {
|
BlockProcessingOutcome::FutureSlot {
|
||||||
present_slot,
|
present_slot,
|
||||||
block_slot,
|
block_slot,
|
||||||
|
Loading…
Reference in New Issue
Block a user