New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
En 6833/antiflood observers #2007
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stuff found when displaying logs lines
@@ -156,6 +165,10 @@ func (mdi *MultiDataInterceptor) ProcessReceivedMessage(message p2p.MessageP2P, | |||
) | |||
} | |||
|
|||
if !allWhiteListed && errOriginator != nil { | |||
log.Debug("got message from peer on topic only for validators", "originator", message.Peer(), "topic", mdi.topic, "err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to:
log.Debug("got message from peer on topic only for validators",
"originator", p2p.PeerIdToShortString(message.Peer()),
"topic", mdi.topic,
"err", err)
as message.Peer() might contain unprintable characters
I think we should add a String() function on core.PeerID struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
isWhiteListed := sdi.whiteListRequested.IsWhiteListed(interceptedData) | ||
if !isWhiteListed && errOriginator != nil { | ||
log.Debug("got message from peer on topic only for validators", "originator", message.Peer(), "topic", sdi.topic, "err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, please use p2p.PeerIdToShortString function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
import "github.com/ElrondNetwork/elrond-go/core" | ||
|
||
type PeerValidatorMapper struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a mocked comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return process.ErrOnlyValidatorsCanUseThisTopic | ||
} | ||
|
||
// SetTopicsForAll set the topics which are enabled for all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# Conflicts: # process/throttle/antiflood/p2pAntiflood.go
3377cfe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
identation failed in p2pAntiflood.go
045cc00
} | ||
|
||
sort.Slice(epochList, func(i, j int) bool { | ||
return epochList[i] < epochList[j] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 that should overwrite the values from previous epochs, if the node is performing well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the idea
@@ -132,11 +134,7 @@ func (psm *PeerShardMapper) getPeerInfoWithNodesCoordinator(pid core.PeerID) (*c | |||
}, false | |||
} | |||
|
|||
psm.mutEpoch.RLock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove the mutex, epoch and the associated handlers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left there if later it would be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
later means never :)))
…de the checking of nonce or epoch start in the case of shard/meta headers.
Fix whitelisting of nonce/epoch requests
a058e7d
# Conflicts: # process/errors.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.
do not accept messages - do not propagate messages whose originator is not a validator.
Accepted topics are only transactions_selfID and heartbeat