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: make GossipNode more independent from wsNetwork implementation #5634

Merged
merged 5 commits into from
Aug 4, 2023

Conversation

cce
Copy link
Contributor

@cce cce commented Aug 3, 2023

Summary

This removes some unused interface methods on GossipNode, and extracts some functionality from WebsocketNetwork into two new types (msgHandler, msgBroadcaster) to make them more available for re-use.

Test Plan

Existing tests should pass.

@cce cce added the Enhancement label Aug 3, 2023
network/netidentity.go Outdated Show resolved Hide resolved
@jsgranados jsgranados added the p2p Work related to the p2p project label Aug 3, 2023
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #5634 (0d03251) into master (8b19c62) will increase coverage by 0.02%.
Report is 1 commits behind head on master.
The diff coverage is 79.04%.

@@            Coverage Diff             @@
##           master    #5634      +/-   ##
==========================================
+ Coverage   54.95%   54.97%   +0.02%     
==========================================
  Files         463      463              
  Lines       64476    64494      +18     
==========================================
+ Hits        35432    35458      +26     
+ Misses      26661    26656       -5     
+ Partials     2383     2380       -3     
Files Changed Coverage Δ
network/wsPeer.go 73.42% <53.84%> (+2.58%) ⬆️
network/wsNetwork.go 73.03% <92.59%> (+0.16%) ⬆️
network/msgCompressor.go 85.71% <100.00%> (ø)
network/multiplexer.go 95.34% <100.00%> (-0.11%) ⬇️
network/netidentity.go 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

changes makes sense for me although some implementation notes are below.

network/multiplexer.go Show resolved Hide resolved
network/netidentity.go Outdated Show resolved Hide resolved
network/wsNetwork.go Outdated Show resolved Hide resolved
network/wsNetwork.go Show resolved Hide resolved
iansuvak
iansuvak previously approved these changes Aug 4, 2023
Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

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

LGTM in general, I am pro moving interfaces out of implementation specific wsNetwork.go file but doesn't need to happen here.

network/wsPeer.go Show resolved Hide resolved
algorandskiy
algorandskiy previously approved these changes Aug 4, 2023
iansuvak
iansuvak previously approved these changes Aug 4, 2023
@cce cce dismissed stale reviews from iansuvak and algorandskiy via 0d03251 August 4, 2023 17:00
@algorandskiy algorandskiy merged commit 72765c1 into algorand:master Aug 4, 2023
10 checks passed
@cce cce deleted the wsNetwork-refactor branch August 4, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement p2p Work related to the p2p project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants