Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-algorand 3.12.2-stable Release PR #4837

Merged
merged 78 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
e8e1b41
API: bump max size of teal source and dryrun (#4633)
barnjamin Oct 24, 2022
5b028c2
Merge remote-tracking branch 'origin/rel/stable' into relstable3.11.2…
Algo-devops-service Oct 24, 2022
1a83da0
Bump Version, Remove buildnumber.dat and genesistimestamp.dat files.
Algo-devops-service Oct 24, 2022
0c2bc3a
Merge pull request #4688 from Algo-devops-service/relstable3.11.2-rem…
algojohnlee Oct 24, 2022
fbd5b17
ledger: Make AccountDelta fields visible for serialization. (#4620)
winder Oct 24, 2022
5e0ea76
perf test: Transaction group handle/verify (#4652)
algonautshant Oct 24, 2022
fb332de
Netgoal: Update netgoal generate flags and variables (#4656)
algobarb Oct 25, 2022
6a2942d
lint: enable go vet printf format arg checks for logging (#4679)
cce Oct 25, 2022
ad08f74
logging: demote LeaseInLedgerError from warn to info level (#4685)
cce Oct 26, 2022
a3e90ad
test: metrics gathering improvements (#4639)
brianolson Oct 26, 2022
4e36847
Tests: Fix handling of empty local state in TestResourcesDataApp (#4699)
michaeldiamant Oct 26, 2022
ab87a8a
AVM: match, pushints, and pushbytess opcodes (#4645)
algoidurovic Oct 26, 2022
40974ee
network: align duplicateFilterCount to prevent panic on 32-bit platfo…
cce Oct 28, 2022
e2c2bc4
Bug-fix: return v2 spec from swagger endpoint (#4697)
AlgoStephenAkiki Oct 28, 2022
0cb9a2e
AVM: Add support for Boxes (#4149)
michaeldiamant Oct 31, 2022
7602d4f
performance: don't create child cow in TestTransactionGroup (#4706)
cce Oct 31, 2022
fb1f498
db: print dbutil.go error in stderr (#4712)
michaeldiamant Oct 31, 2022
ba9c593
performance: agreement state serialization using msgp (#4644)
iansuvak Oct 31, 2022
e6f396b
prefetcher: enable prefetcher for assets and apps (#4352)
algorandskiy Oct 31, 2022
97c232d
test: fix after boxes and prefetcher remerge (#4716)
algorandskiy Nov 1, 2022
959fb5a
blank import needs commenting out for indexer's lint (#4720)
tzaffi Nov 1, 2022
bac4117
AVM: fix early eval exits for Debugger (#4719)
jannotti Nov 1, 2022
daca5d3
DevOps: Update docker container in build (#4723)
onetechnical Nov 1, 2022
15efc02
catchpoint: actualize limit constants and fix txtail table init (#4703)
algorandskiy Nov 1, 2022
a8f1b4a
tools: allow specification of RewardPoolBalance in genesis (#4643)
barnjamin Nov 1, 2022
06f9109
Consensus: v36 upgrade (#4722)
jannotti Nov 1, 2022
f37bb6e
dispenser: add input validation (#4713)
algolucky Nov 1, 2022
2c0dd9e
Update the Version, BuildNumber, genesistimestamp.data
Algo-devops-service Nov 1, 2022
31a1099
Merge pull request #4730 from Algo-devops-service/relbeta3.12.0
algojohnlee Nov 1, 2022
e387553
mergeback: feature/alphanet (#4726)
algolucky Nov 2, 2022
fa77937
add unconvert to warning linter (#4710)
cce Nov 2, 2022
561bc4a
db: add AtomicContext (#4724)
algorandskiy Nov 2, 2022
995ae47
update vAlpha5 to point to v36 (#4729)
cce Nov 2, 2022
3701d29
tests: make ledger tests ~20 sec faster (#4739)
algorandskiy Nov 3, 2022
4ac719a
catchpointdump: supports tar.gz files (#4743)
almog-t Nov 3, 2022
25e0087
perf: don't preallocate rarely used maps in MakeStateDelta (#4715)
iansuvak Nov 3, 2022
855304e
tools: remove doberman and dependency (#4750)
winder Nov 3, 2022
06d146b
algod: Migrate internal uses of v1 algod API to v2 (#4684)
algochoi Nov 3, 2022
7fcfe26
test: add test defending against regression in testnet genesis gener…
michaeldiamant Nov 3, 2022
ae443cd
tests: Fix account tests for calling pending txn endpoint and box tes…
algochoi Nov 3, 2022
0af97b3
goal: Add URL to goal asset info. (#4731)
winder Nov 4, 2022
207f964
performance: turn cache misses during assembly into cache hits during…
icorderi Nov 4, 2022
7f94674
Testing: Lint for unparallelized tests without explicit reason (#4746)
jdtzmn Nov 4, 2022
863e6ca
daemon: add pool error message (#4755)
algorandskiy Nov 4, 2022
0eae1c0
Tests: Fix types in assertions and change to using libgoal client whe…
algochoi Nov 4, 2022
76ff3a8
goal: Change asset commands to use AccountAssetInformation (#4758)
algochoi Nov 7, 2022
5c97463
API: Update oapi-codegen version to v1.12.0 of our fork (#4707)
Eric-Warehime Nov 7, 2022
e6172bc
Tests: Move box test artifacts to a temp directory (#4771)
algochoi Nov 8, 2022
94e3eba
algod: Delete v1 usage from client and remove `V2` prefix from APIs (…
algochoi Nov 9, 2022
327e987
netgoal: start with 20GB RootStorage (#4779)
algolucky Nov 10, 2022
1a13168
Update SECURITY.md (#4782)
algonoah Nov 10, 2022
445b45b
Fix resolver test endpoint (#4784)
Eric-Warehime Nov 14, 2022
23890a8
algod: Consolidate models (#4714)
Eric-Warehime Nov 14, 2022
9f90fd1
Notify when GHA workflow fails on master (#4791)
michaeldiamant Nov 16, 2022
bffd703
Notify about CircleCI build failures for master and rel branches only…
michaeldiamant Nov 16, 2022
6b85209
Tests: Fix txid-string comparison (#4792)
algochoi Nov 16, 2022
31e8c03
Merge remote-tracking branch 'origin/rel/stable' into relstable3.11.3…
Algo-devops-service Nov 17, 2022
e618fbf
Merge pull request #4811 from Algo-devops-service/relstable3.11.3-rem…
algojohnlee Nov 17, 2022
526cb89
telemetry: add TCP RTT info collection (#4745)
cce Nov 17, 2022
d22fa42
txHandler: add more metric (#4786)
algorandskiy Nov 17, 2022
06e61a9
metrics: split out /Transaction/AssembleBlock metrics (#4795)
iansuvak Nov 17, 2022
3ece6bd
test: large generated accountdb cluster test (#4772)
brianolson Nov 17, 2022
68a72e3
cow: always process KvMods to add OldData to mods when building State…
cce Nov 18, 2022
6acbd18
txHandler: service does not restart after node catching up (#4809)
algonautshant Nov 18, 2022
fe580fd
Catchpoints: Add the kv hashes into the trie (#4812)
jannotti Nov 18, 2022
9791d64
txSyncer: service does not start after node catching up (#4768)
algonautshant Nov 18, 2022
9202a43
CI: Fix GHA failure notification trigger condition (#4810)
michaeldiamant Nov 18, 2022
5b45539
Catchpoints: Enrich catchpoint generation and status with KV metadat…
michaeldiamant Nov 18, 2022
d80de1a
Squelch macOS accept incoming network connections notifications (#4814)
michaeldiamant Nov 18, 2022
8c7fb86
add TransactionGroupTxSyncHandled (#4815)
cce Nov 18, 2022
60cdd7d
tools: update catchpointdump 'database' and 'database check' commands…
cce Nov 18, 2022
b66a955
accountdb: add migration 8 for resetting accounthashes on betanet (#4…
cce Nov 21, 2022
62568c5
Merge branch 'master' into relbeta3.12.1
Algo-devops-service Nov 21, 2022
efdfc1f
Update the Version, BuildNumber, genesistimestamp.data
Algo-devops-service Nov 21, 2022
bacdf8d
Merge pull request #4823 from Algo-devops-service/relbeta3.12.1
algojohnlee Nov 22, 2022
0ca1eb7
Bump buildnumber.dat
onetechnical Nov 22, 2022
6f01d48
test: disable TestWebsocketNetworkTelemetryTCP on CI (#4827)
algorandskiy Nov 22, 2022
3583908
Merge pull request #4828 from onetechnical/relbeta3.12.2
algojohnlee Nov 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
telemetry: add TCP RTT info collection (#4745)
  • Loading branch information
cce authored Nov 17, 2022
commit 526cb89d060e78de2b3d22af21fbb67c1635bc54
4 changes: 4 additions & 0 deletions logging/telemetryspec/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package telemetryspec

import (
"time"

"github.com/algorand/go-algorand/util"
)

// Telemetry Events
Expand Down Expand Up @@ -302,6 +304,8 @@ type PeerConnectionDetails struct {
MessageDelay int64 `json:",omitempty"`
// DuplicateFilterCount is the number of times this peer has sent us a message hash to filter that it had already sent before.
DuplicateFilterCount uint64
// TCPInfo provides connection measurements from TCP.
TCP util.TCPInfo `json:",omitempty"`
}

// CatchpointGenerationEvent event
Expand Down
4 changes: 4 additions & 0 deletions network/limitlistener/rejectingLimitListener.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ func (l *rejectingLimitListenerConn) Close() error {
l.releaseOnce.Do(l.release)
return err
}

func (l *rejectingLimitListenerConn) UnderlyingConn() net.Conn {
return l.Conn
}
4 changes: 4 additions & 0 deletions network/requestTracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ type requestTrackedConnection struct {
tracker *RequestTracker
}

func (c *requestTrackedConnection) UnderlyingConn() net.Conn {
return c.Conn
}

// Close removes the connection from the tracker's connections map and call the underlaying Close function.
func (c *requestTrackedConnection) Close() error {
c.tracker.hostRequestsMu.Lock()
Expand Down
24 changes: 22 additions & 2 deletions network/wsNetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -1805,14 +1805,23 @@ func (wn *WebsocketNetwork) OnNetworkAdvance() {
// to the telemetry server. Internally, it's using a timer to ensure that it would only
// send the information once every hour ( configurable via PeerConnectionsUpdateInterval )
func (wn *WebsocketNetwork) sendPeerConnectionsTelemetryStatus() {
if !wn.log.GetTelemetryEnabled() {
return
}
now := time.Now()
if wn.lastPeerConnectionsSent.Add(time.Duration(wn.config.PeerConnectionsUpdateInterval)*time.Second).After(now) || wn.config.PeerConnectionsUpdateInterval <= 0 {
// it's not yet time to send the update.
return
}
wn.lastPeerConnectionsSent = now

var peers []*wsPeer
peers, _ = wn.peerSnapshot(peers)
connectionDetails := wn.getPeerConnectionTelemetryDetails(now, peers)
wn.log.EventWithDetails(telemetryspec.Network, telemetryspec.PeerConnectionsEvent, connectionDetails)
}

func (wn *WebsocketNetwork) getPeerConnectionTelemetryDetails(now time.Time, peers []*wsPeer) telemetryspec.PeersConnectionDetails {
var connectionDetails telemetryspec.PeersConnectionDetails
for _, peer := range peers {
connDetail := telemetryspec.PeerConnectionDetails{
Expand All @@ -1821,6 +1830,18 @@ func (wn *WebsocketNetwork) sendPeerConnectionsTelemetryStatus() {
InstanceName: peer.InstanceName,
DuplicateFilterCount: peer.duplicateFilterCount,
}
// unwrap websocket.Conn, requestTrackedConnection, rejectingLimitListenerConn
var uconn net.Conn = peer.conn.UnderlyingConn()
for i := 0; i < 10; i++ {
wconn, ok := uconn.(wrappedConn)
if !ok {
break
}
uconn = wconn.UnderlyingConn()
}
if tcpInfo, err := util.GetConnTCPInfo(uconn); err == nil && tcpInfo != nil {
connDetail.TCP = *tcpInfo
}
if peer.outgoing {
connDetail.Address = justHost(peer.conn.RemoteAddr().String())
connDetail.Endpoint = peer.GetAddress()
Expand All @@ -1831,8 +1852,7 @@ func (wn *WebsocketNetwork) sendPeerConnectionsTelemetryStatus() {
connectionDetails.IncomingPeers = append(connectionDetails.IncomingPeers, connDetail)
}
}

wn.log.EventWithDetails(telemetryspec.Network, telemetryspec.PeerConnectionsEvent, connectionDetails)
return connectionDetails
}

// prioWeightRefreshTime controls how often we refresh the weights
Expand Down
218 changes: 108 additions & 110 deletions network/wsNetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"bytes"
"context"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"math/rand"
Expand Down Expand Up @@ -268,24 +269,30 @@ func netStop(t testing.TB, wn *WebsocketNetwork, name string) {
t.Logf("%s done", name)
}

// Set up two nodes, test that a.Broadcast is received by B
func TestWebsocketNetworkBasic(t *testing.T) {
partitiontest.PartitionTest(t)
func setupWebsocketNetworkAB(t *testing.T, countTarget int) (*WebsocketNetwork, *WebsocketNetwork, *messageCounterHandler, func()) {
success := false

netA := makeTestWebsocketNode(t)
netA.config.GossipFanout = 1
netA.Start()
defer netStop(t, netA, "A")
defer func() {
if !success {
netStop(t, netA, "A")
}
}()
netB := makeTestWebsocketNode(t)
netB.config.GossipFanout = 1
addrA, postListen := netA.Address()
require.True(t, postListen)
t.Log(addrA)
netB.phonebook.ReplacePeerList([]string{addrA}, "default", PhoneBookEntryRelayRole)
netB.Start()
defer netStop(t, netB, "B")
counter := newMessageCounter(t, 2)
counterDone := counter.done
defer func() {
if !success {
netStop(t, netB, "B")
}
}()
counter := newMessageCounter(t, countTarget)
netB.RegisterHandlers([]TaggedMessageHandler{{Tag: protocol.TxnTag, MessageHandler: counter}})

readyTimeout := time.NewTimer(2 * time.Second)
Expand All @@ -294,6 +301,21 @@ func TestWebsocketNetworkBasic(t *testing.T) {
waitReady(t, netB, readyTimeout.C)
t.Log("b ready")

success = true
closeFunc := func() {
netStop(t, netB, "B")
netStop(t, netB, "A")
}
return netA, netB, counter, closeFunc
}

// Set up two nodes, test that a.Broadcast is received by B
func TestWebsocketNetworkBasic(t *testing.T) {
partitiontest.PartitionTest(t)

netA, _, counter, closeFunc := setupWebsocketNetworkAB(t, 2)
defer closeFunc()
counterDone := counter.done
netA.Broadcast(context.Background(), protocol.TxnTag, []byte("foo"), false, nil)
netA.Broadcast(context.Background(), protocol.TxnTag, []byte("bar"), false, nil)

Expand Down Expand Up @@ -384,27 +406,9 @@ func TestWebsocketProposalPayloadCompression(t *testing.T) {
func TestWebsocketNetworkUnicast(t *testing.T) {
partitiontest.PartitionTest(t)

netA := makeTestWebsocketNode(t)
netA.config.GossipFanout = 1
netA.Start()
defer netStop(t, netA, "A")
netB := makeTestWebsocketNode(t)
netB.config.GossipFanout = 1
addrA, postListen := netA.Address()
require.True(t, postListen)
t.Log(addrA)
netB.phonebook.ReplacePeerList([]string{addrA}, "default", PhoneBookEntryRelayRole)
netB.Start()
defer netStop(t, netB, "B")
counter := newMessageCounter(t, 2)
netA, _, counter, closeFunc := setupWebsocketNetworkAB(t, 2)
defer closeFunc()
counterDone := counter.done
netB.RegisterHandlers([]TaggedMessageHandler{{Tag: protocol.TxnTag, MessageHandler: counter}})

readyTimeout := time.NewTimer(2 * time.Second)
waitReady(t, netA, readyTimeout.C)
t.Log("a ready")
waitReady(t, netB, readyTimeout.C)
t.Log("b ready")

require.Equal(t, 1, len(netA.peers))
require.Equal(t, 1, len(netA.GetPeers(PeersConnectedIn)))
Expand All @@ -425,26 +429,8 @@ func TestWebsocketNetworkUnicast(t *testing.T) {
func TestWebsocketPeerData(t *testing.T) {
partitiontest.PartitionTest(t)

netA := makeTestWebsocketNode(t)
netA.config.GossipFanout = 1
netA.Start()
defer netStop(t, netA, "A")
netB := makeTestWebsocketNode(t)
netB.config.GossipFanout = 1
addrA, postListen := netA.Address()
require.True(t, postListen)
t.Log(addrA)
netB.phonebook.ReplacePeerList([]string{addrA}, "default", PhoneBookEntryRelayRole)
netB.Start()
defer netStop(t, netB, "B")
counter := newMessageCounter(t, 2)
netB.RegisterHandlers([]TaggedMessageHandler{{Tag: protocol.TxnTag, MessageHandler: counter}})

readyTimeout := time.NewTimer(2 * time.Second)
waitReady(t, netA, readyTimeout.C)
t.Log("a ready")
waitReady(t, netB, readyTimeout.C)
t.Log("b ready")
netA, _, _, closeFunc := setupWebsocketNetworkAB(t, 2)
defer closeFunc()

require.Equal(t, 1, len(netA.peers))
require.Equal(t, 1, len(netA.GetPeers(PeersConnectedIn)))
Expand All @@ -463,27 +449,9 @@ func TestWebsocketPeerData(t *testing.T) {
func TestWebsocketNetworkArray(t *testing.T) {
partitiontest.PartitionTest(t)

netA := makeTestWebsocketNode(t)
netA.config.GossipFanout = 1
netA.Start()
defer netStop(t, netA, "A")
netB := makeTestWebsocketNode(t)
netB.config.GossipFanout = 1
addrA, postListen := netA.Address()
require.True(t, postListen)
t.Log(addrA)
netB.phonebook.ReplacePeerList([]string{addrA}, "default", PhoneBookEntryRelayRole)
netB.Start()
defer netStop(t, netB, "B")
counter := newMessageCounter(t, 3)
netA, _, counter, closeFunc := setupWebsocketNetworkAB(t, 3)
defer closeFunc()
counterDone := counter.done
netB.RegisterHandlers([]TaggedMessageHandler{{Tag: protocol.TxnTag, MessageHandler: counter}})

readyTimeout := time.NewTimer(2 * time.Second)
waitReady(t, netA, readyTimeout.C)
t.Log("a ready")
waitReady(t, netB, readyTimeout.C)
t.Log("b ready")

tags := []protocol.Tag{protocol.TxnTag, protocol.TxnTag, protocol.TxnTag}
data := [][]byte{[]byte("foo"), []byte("bar"), []byte("algo")}
Expand All @@ -500,27 +468,9 @@ func TestWebsocketNetworkArray(t *testing.T) {
func TestWebsocketNetworkCancel(t *testing.T) {
partitiontest.PartitionTest(t)

netA := makeTestWebsocketNode(t)
netA.config.GossipFanout = 1
netA.Start()
defer netStop(t, netA, "A")
netB := makeTestWebsocketNode(t)
netB.config.GossipFanout = 1
addrA, postListen := netA.Address()
require.True(t, postListen)
t.Log(addrA)
netB.phonebook.ReplacePeerList([]string{addrA}, "default", PhoneBookEntryRelayRole)
netB.Start()
defer netStop(t, netB, "B")
counter := newMessageCounter(t, 100)
netA, _, counter, closeFunc := setupWebsocketNetworkAB(t, 100)
defer closeFunc()
counterDone := counter.done
netB.RegisterHandlers([]TaggedMessageHandler{{Tag: protocol.TxnTag, MessageHandler: counter}})

readyTimeout := time.NewTimer(2 * time.Second)
waitReady(t, netA, readyTimeout.C)
t.Log("a ready")
waitReady(t, netB, readyTimeout.C)
t.Log("b ready")

tags := make([]protocol.Tag, 100)
data := make([][]byte, 100)
Expand Down Expand Up @@ -721,29 +671,15 @@ func TestAddrToGossipAddr(t *testing.T) {

type nopConn struct{}

func (nc *nopConn) RemoteAddr() net.Addr {
return nil
}
func (nc *nopConn) NextReader() (int, io.Reader, error) {
return 0, nil, nil
}
func (nc *nopConn) WriteMessage(int, []byte) error {
return nil
}
func (nc *nopConn) WriteControl(int, []byte, time.Time) error {
return nil
}
func (nc *nopConn) SetReadLimit(limit int64) {
}
func (nc *nopConn) CloseWithoutFlush() error {
return nil
}
func (nc *nopConn) SetPingHandler(h func(appData string) error) {

}
func (nc *nopConn) SetPongHandler(h func(appData string) error) {

}
func (nc *nopConn) RemoteAddr() net.Addr { return nil }
func (nc *nopConn) NextReader() (int, io.Reader, error) { return 0, nil, nil }
func (nc *nopConn) WriteMessage(int, []byte) error { return nil }
func (nc *nopConn) WriteControl(int, []byte, time.Time) error { return nil }
func (nc *nopConn) SetReadLimit(limit int64) {}
func (nc *nopConn) CloseWithoutFlush() error { return nil }
func (nc *nopConn) SetPingHandler(h func(appData string) error) {}
func (nc *nopConn) SetPongHandler(h func(appData string) error) {}
func (nc *nopConn) UnderlyingConn() net.Conn { return nil }

var nopConnSingleton = nopConn{}

Expand Down Expand Up @@ -2739,3 +2675,65 @@ func TestPreparePeerData(t *testing.T) {
}
}
}

func TestWebsocketNetworkTelemetryTCP(t *testing.T) {
partitiontest.PartitionTest(t)

// start two networks and send 2 messages from A to B
closed := false
netA, netB, counter, closeFunc := setupWebsocketNetworkAB(t, 2)
defer func() {
if !closed {
closeFunc()
}
}()
counterDone := counter.done
netA.Broadcast(context.Background(), protocol.TxnTag, []byte("foo"), false, nil)
netA.Broadcast(context.Background(), protocol.TxnTag, []byte("bar"), false, nil)

select {
case <-counterDone:
case <-time.After(2 * time.Second):
t.Errorf("timeout, count=%d, wanted 2", counter.count)
}

// get RTT from both ends and assert nonzero
var peersA, peersB []*wsPeer
peersA, _ = netA.peerSnapshot(peersA)
detailsA := netA.getPeerConnectionTelemetryDetails(time.Now(), peersA)
peersB, _ = netB.peerSnapshot(peersB)
detailsB := netB.getPeerConnectionTelemetryDetails(time.Now(), peersB)
require.Len(t, detailsA.IncomingPeers, 1)
assert.NotZero(t, detailsA.IncomingPeers[0].TCP.RTT)
require.Len(t, detailsB.OutgoingPeers, 1)
assert.NotZero(t, detailsB.OutgoingPeers[0].TCP.RTT)

pcdA, err := json.Marshal(detailsA)
assert.NoError(t, err)
pcdB, err := json.Marshal(detailsB)
assert.NoError(t, err)
t.Log("detailsA", string(pcdA))
t.Log("detailsB", string(pcdB))

// close connections
closeFunc()
closed = true
// open more FDs by starting 2 more networks
_, _, _, closeFunc2 := setupWebsocketNetworkAB(t, 2)
defer closeFunc2()
// use stale peers snapshot from closed networks to get telemetry
// *net.OpError "use of closed network connection" err results in 0 rtt values
detailsA = netA.getPeerConnectionTelemetryDetails(time.Now(), peersA)
detailsB = netB.getPeerConnectionTelemetryDetails(time.Now(), peersB)
require.Len(t, detailsA.IncomingPeers, 1)
assert.Zero(t, detailsA.IncomingPeers[0].TCP.RTT)
require.Len(t, detailsB.OutgoingPeers, 1)
assert.Zero(t, detailsB.OutgoingPeers[0].TCP.RTT)

pcdA, err = json.Marshal(detailsA)
assert.NoError(t, err)
pcdB, err = json.Marshal(detailsB)
assert.NoError(t, err)
t.Log("closed detailsA", string(pcdA))
t.Log("closed detailsB", string(pcdB))
}
5 changes: 5 additions & 0 deletions network/wsPeer.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ type wsPeerWebsocketConn interface {
CloseWithoutFlush() error
SetPingHandler(h func(appData string) error)
SetPongHandler(h func(appData string) error)
wrappedConn
}

type wrappedConn interface {
UnderlyingConn() net.Conn
}

type sendMessage struct {
Expand Down
Loading