-
Notifications
You must be signed in to change notification settings - Fork 492
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
network: remove GossipNode.BroadcastArray #6281
base: master
Are you sure you want to change the base?
Conversation
network/wsPeer.go
Outdated
|
||
if highPrio { | ||
outchan = wp.sendBufferHighPrio | ||
} else { | ||
outchan = wp.sendBufferBulk | ||
} | ||
select { | ||
case outchan <- sendMessages{msgs: msgs}: | ||
case outchan <- sendMessage{data: data, enqueued: msgEnqueueTime, peerEnqueued: time.Now(), hash: digest, ctx: ctx}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, there are no users of the hash
field on sendMessage
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6281 +/- ##
==========================================
- Coverage 51.63% 50.82% -0.81%
==========================================
Files 647 647
Lines 86907 86874 -33
==========================================
- Hits 44876 44156 -720
- Misses 39161 39790 +629
- Partials 2870 2928 +58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
In #1966 the methods BroadcastArray and RelayArray were added to the GossipNode interface. (The idea was to break up long messages like proposals into a sequence of smaller messages, to allow canceling a proposal while it was still being sent, as soon as a better one was observed.) However they were never used, and have no callers. They require every (tag, message) pair, to be wrapped in two single-element []protocol.Tag and [][]byte slices. This PR attempts to see if it is straightforward (and more performant) to go back to single-message sending, without the slice wrappers.
Review recommended with whitespace hidden.
Test Plan
Updated TestWebsocketNetworkCancel and TestPreparePeerData for missing BroadcastArray. Existing unit & e2e test should ensure that networking is still working with single messages.