mirror of https://github.com/poanetwork/gecko.git
Merge pull request #65 from ava-labs/lower-gossip-logs
lower log level for gossiped put messages
This commit is contained in:
commit
6c8c70b1ca
|
@ -43,6 +43,10 @@ const (
|
|||
defaultGetVersionTimeout = 2 * time.Second
|
||||
defaultAllowPrivateIPs = true
|
||||
defaultGossipSize = 50
|
||||
|
||||
// Request ID used when sending a Put message to gossip an accepted container
|
||||
// (ie not sent in response to a Get)
|
||||
GossipMsgRequestID = math.MaxUint32
|
||||
)
|
||||
|
||||
// Network defines the functionality of the networking library.
|
||||
|
@ -705,7 +709,7 @@ func (n *network) Track(ip utils.IPDesc) {
|
|||
|
||||
// assumes the stateLock is not held.
|
||||
func (n *network) gossipContainer(chainID, containerID ids.ID, container []byte) error {
|
||||
msg, err := n.b.Put(chainID, math.MaxUint32, containerID, container)
|
||||
msg, err := n.b.Put(chainID, GossipMsgRequestID, containerID, container)
|
||||
if err != nil {
|
||||
return fmt.Errorf("attempted to pack too large of a Put message.\nContainer length: %d", len(container))
|
||||
}
|
||||
|
|
|
@ -169,7 +169,11 @@ func (t *Transitive) Put(vdr ids.ShortID, requestID uint32, vtxID ids.ID, vtxByt
|
|||
t.Config.Context.Log.Verbo("Put(%s, %d, %s) called", vdr, requestID, vtxID)
|
||||
|
||||
if !t.bootstrapped { // Bootstrapping unfinished --> didn't call Get --> this message is invalid
|
||||
t.Config.Context.Log.Debug("dropping Put(%s, %d, %s) due to bootstrapping", vdr, requestID, vtxID)
|
||||
if requestID == network.GossipMsgRequestID {
|
||||
t.Config.Context.Log.Verbo("dropping gossip Put(%s, %d, %s) due to bootstrapping", vdr, requestID, vtxID)
|
||||
} else {
|
||||
t.Config.Context.Log.Debug("dropping Put(%s, %d, %s) due to bootstrapping", vdr, requestID, vtxID)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,11 @@ func (t *Transitive) GetAncestors(vdr ids.ShortID, requestID uint32, blkID ids.I
|
|||
func (t *Transitive) Put(vdr ids.ShortID, requestID uint32, blkID ids.ID, blkBytes []byte) error {
|
||||
// bootstrapping isn't done --> we didn't send any gets --> this put is invalid
|
||||
if !t.bootstrapped {
|
||||
t.Config.Context.Log.Debug("dropping Put(%s, %d, %s) due to bootstrapping", vdr, requestID, blkID)
|
||||
if requestID == network.GossipMsgRequestID {
|
||||
t.Config.Context.Log.Verbo("dropping gossip Put(%s, %d, %s) due to bootstrapping", vdr, requestID, blkID)
|
||||
} else {
|
||||
t.Config.Context.Log.Debug("dropping Put(%s, %d, %s) due to bootstrapping", vdr, requestID, blkID)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue