summaryrefslogtreecommitdiff
path: root/network/wsNetwork.go
diff options
context:
space:
mode:
Diffstat (limited to 'network/wsNetwork.go')
-rw-r--r--network/wsNetwork.go34
1 files changed, 6 insertions, 28 deletions
diff --git a/network/wsNetwork.go b/network/wsNetwork.go
index 1a86eadf0..9f4a1b281 100644
--- a/network/wsNetwork.go
+++ b/network/wsNetwork.go
@@ -52,11 +52,7 @@ import (
)
const incomingThreads = 20
-
-// messageFilterSize is the threshold beyond we send a request to the other peer to avoid sending us a message with that particular hash.
-// typically, this is beneficial for proposal messages, which tends to be large and uniform across the network. Non-uniform messages, such
-// as the transaction sync messages should not included in this filter.
-const messageFilterSize = 200000
+const messageFilterSize = 5000 // messages greater than that size may be blocked by incoming/outgoing filter
// httpServerReadHeaderTimeout is the amount of time allowed to read
// request headers. The connection's read deadline is reset
@@ -222,9 +218,6 @@ type IncomingMessage struct {
Err error
Net GossipNode
- // Sequence is the sequence number of the message for the specific tag and peer
- Sequence uint64
-
// Received is time.Time.UnixNano()
Received int64
@@ -1136,21 +1129,7 @@ func (wn *WebsocketNetwork) ServeHTTP(response http.ResponseWriter, request *htt
// We are careful to encode this prior to starting the server to avoid needing 'messagesOfInterestMu' here.
if wn.messagesOfInterestEnc != nil {
- msg := wn.messagesOfInterestEnc
- // for older peers, we want to include also the "TX" message, for backward compatibility.
- // this statement could be safely removed once we've fully migrated.
- if peer.version == "2.1" {
- wn.messagesOfInterestMu.Lock()
- txSendMsgTags := make(map[protocol.Tag]bool)
- for tag := range wn.messagesOfInterest {
- txSendMsgTags[tag] = true
- }
- wn.messagesOfInterestMu.Unlock()
- txSendMsgTags[protocol.TxnTag] = true
- msg = MarshallMessageOfInterestMap(txSendMsgTags)
- }
- err = peer.Unicast(wn.ctx, msg, protocol.MsgOfInterestTag, nil)
-
+ err = peer.Unicast(wn.ctx, wn.messagesOfInterestEnc, protocol.MsgOfInterestTag)
if err != nil {
wn.log.Infof("ws send msgOfInterest: %v", err)
}
@@ -1432,7 +1411,7 @@ func (wn *WebsocketNetwork) innerBroadcast(request broadcastRequest, prio bool,
if peer == request.except {
continue
}
- ok := peer.writeNonBlockMsgs(request.ctx, data, prio, digests, request.enqueueTime, nil)
+ ok := peer.writeNonBlockMsgs(request.ctx, data, prio, digests, request.enqueueTime)
if ok {
sentMessageCount++
continue
@@ -1807,15 +1786,14 @@ const ProtocolVersionHeader = "X-Algorand-Version"
const ProtocolAcceptVersionHeader = "X-Algorand-Accept-Version"
// SupportedProtocolVersions contains the list of supported protocol versions by this node ( in order of preference ).
-var SupportedProtocolVersions = []string{"3.0", "2.1"}
+var SupportedProtocolVersions = []string{"2.1"}
// ProtocolVersion is the current version attached to the ProtocolVersionHeader header
/* Version history:
* 1 Catchup service over websocket connections with unicast messages between peers
* 2.1 Introduced topic key/data pairs and enabled services over the gossip connections
- * 3.0 Introduced new transaction gossiping protocol
*/
-const ProtocolVersion = "3.0"
+const ProtocolVersion = "2.1"
// TelemetryIDHeader HTTP header for telemetry-id for logging
const TelemetryIDHeader = "X-Algorand-TelId"
@@ -2081,7 +2059,7 @@ func (wn *WebsocketNetwork) tryConnect(addr, gossipAddr string) {
resp := wn.prioScheme.MakePrioResponse(challenge)
if resp != nil {
mbytes := append([]byte(protocol.NetPrioResponseTag), resp...)
- sent := peer.writeNonBlock(context.Background(), mbytes, true, crypto.Digest{}, time.Now(), nil)
+ sent := peer.writeNonBlock(context.Background(), mbytes, true, crypto.Digest{}, time.Now())
if !sent {
wn.log.With("remote", addr).With("local", localAddr).Warnf("could not send priority response to %v", addr)
}