Skip to content

Commit

Permalink
Remove pre-Durango networking checks (#3018)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored May 13, 2024
1 parent 4ac6138 commit e61e949
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 38 deletions.
39 changes: 14 additions & 25 deletions network/peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,14 +708,6 @@ func (p *peer) shouldDisconnect() bool {
return false
}

if p.ip.BLSSignature == nil {
p.Log.Debug("disconnecting from peer",
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 @@ -1075,23 +1067,20 @@ 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("peer has malformed signature",
zap.Stringer("nodeID", p.id),
zap.String("signatureType", "bls"),
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("peer has malformed signature",
zap.Stringer("nodeID", p.id),
zap.String("signatureType", "bls"),
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 @@ -1228,8 +1217,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 e61e949

Please sign in to comment.