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

network: remove GossipNode.BroadcastArray #6281

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cce
Copy link
Contributor

@cce cce commented Mar 17, 2025

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.


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}:
Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it.

@cce cce marked this pull request as ready for review March 17, 2025 22:13
@cce cce requested a review from algorandskiy March 17, 2025 22:13
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 95.65217% with 2 lines in your changes missing coverage. Please review.

Project coverage is 50.82%. Comparing base (272ec02) to head (9db0a1c).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
network/wsNetwork.go 90.00% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cce cce requested review from jannotti and gmalouf March 17, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants