diff --git a/network/network.go b/network/network.go index a280731..090f4e2 100644 --- a/network/network.go +++ b/network/network.go @@ -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)) } diff --git a/snow/engine/avalanche/transitive.go b/snow/engine/avalanche/transitive.go index 71fbbe0..1914b28 100644 --- a/snow/engine/avalanche/transitive.go +++ b/snow/engine/avalanche/transitive.go @@ -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 } diff --git a/snow/engine/snowman/transitive.go b/snow/engine/snowman/transitive.go index 2897262..0a89dc4 100644 --- a/snow/engine/snowman/transitive.go +++ b/snow/engine/snowman/transitive.go @@ -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 }