Skip to content

Commit

Permalink
Merge branch 'standardize-peer-logs' into track-peer-subnets
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored May 13, 2024
2 parents 40bb983 + 6f0b6f7 commit 56aa31e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 39 deletions.
41 changes: 15 additions & 26 deletions network/peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,6 @@ func (p *peer) shouldDisconnect() bool {
return false
}

if p.ip.BLSSignature == nil {
p.Log.Debug(disconnectingLog,
zap.String("reason", "missing BLS signature"),
zap.Stringer("nodeID", p.id),
)
return true
}

validSignature := bls.VerifyProofOfPossession(
vdr.PublicKey,
p.ip.BLSSignature,
Expand Down Expand Up @@ -1098,24 +1090,21 @@ func (p *peer) handleHandshake(msg *p2p.Handshake) {
return
}

// TODO: After v1.11.x is activated, require the key to be provided.
if len(msg.IpBlsSig) > 0 {
signature, err := bls.SignatureFromBytes(msg.IpBlsSig)
if err != nil {
p.Log.Debug(malformedMessageLog,
zap.Stringer("nodeID", p.id),
zap.Stringer("messageOp", message.HandshakeOp),
zap.String("field", "blsSignature"),
zap.Error(err),
)
p.StartClose()
return
}

p.ip.BLSSignature = signature
p.ip.BLSSignatureBytes = msg.IpBlsSig
signature, err := bls.SignatureFromBytes(msg.IpBlsSig)
if err != nil {
p.Log.Debug(malformedMessageLog,
zap.Stringer("nodeID", p.id),
zap.Stringer("messageOp", message.HandshakeOp),
zap.String("field", "blsSignature"),
zap.Error(err),
)
p.StartClose()
return
}

p.ip.BLSSignature = signature
p.ip.BLSSignatureBytes = msg.IpBlsSig

// If the peer is running an incompatible version or has an invalid BLS
// signature, disconnect from them prior to marking the handshake as
// completed.
Expand Down Expand Up @@ -1254,8 +1243,8 @@ func (p *peer) handlePeerList(msg *p2p.PeerList) {
zap.String("field", "port"),
zap.Uint32("port", claimedIPPort.IpPort),
)
// TODO: After v1.11.x is activated, close the peer here.
continue
p.StartClose()
return
}

discoveredIPs[i] = ips.NewClaimedIPPort(
Expand Down
22 changes: 11 additions & 11 deletions proto/pb/sdk/sdk.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions proto/sdk/sdk.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ package sdk;
option go_package = "github.com/ava-labs/avalanchego/proto/pb/sdk";

message PullGossipRequest {
// TODO: Remove reservation after v1.11.x activates.
reserved 1;
bytes salt = 2;
bytes filter = 3;
}
Expand Down

0 comments on commit 56aa31e

Please sign in to comment.