Skip to content

Commit

Permalink
Revert "bugfix: Only perform stale block classification in Zones"
Browse files Browse the repository at this point in the history
This reverts commit c3ff1a1.
  • Loading branch information
kiltsonfire authored and gameofpointers committed Oct 26, 2023
1 parent c3ff1a1 commit d546148
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 4 additions & 2 deletions eth/fetcher/block_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,10 @@ func (f *BlockFetcher) ImportBlocks(peer string, block *types.Block, relay bool)
broadCastEntropy := block.ParentEntropy()

// If someone is mining not within MaxAllowableEntropyDist*currentIntrinsicS
if nodeCtx == common.ZONE_CTX && relay && f.currentS().Cmp(new(big.Int).Add(broadCastEntropy, MaxAllowableEntropyDist)) > 0 {
f.dropPeer(peer)
if relay && f.currentS().Cmp(new(big.Int).Add(broadCastEntropy, MaxAllowableEntropyDist)) > 0 {
if nodeCtx != common.PRIME_CTX {
f.dropPeer(peer)
}
return
}

Expand Down
18 changes: 9 additions & 9 deletions eth/handler_eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ func (h *ethHandler) handleBlockBroadcast(peer *eth.Peer, block *types.Block, en
// If block if its in manifest cache, relay is set to true, set relay to false and handle
// !atFray checked because when "synced" we want to be able to check entropy against later window
log.Debug("Handle Block", "requestBlock", requestBlock, "atFray", atFray, "relay", relay, "beyondSync", beyondSyncPoint)
if common.NodeLocation.Context() == common.ZONE_CTX {
if relay && !atFray {
if !beyondSyncPoint {
if !requestBlock {
// drop peer
log.Info("Peer broadcasting block not in requestQueue or beyond sync target, dropping peer", "Hash", block.Hash())
if relay && !atFray {
if !beyondSyncPoint {
if !requestBlock {
// drop peer
if common.NodeLocation.Context() != common.PRIME_CTX {
log.Info("Peer broadcasting block not in requestQueue or beyond sync target, dropping peer")
h.downloader.DropPeer(peer)
return nil
} else {
relay = false
}
return nil
} else {
relay = false
}
}
}
Expand Down

0 comments on commit d546148

Please sign in to comment.