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: handle empty wsPeer supplied to transaction handler #6193

Closed

Conversation

algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Dec 7, 2024

Summary

There is a race between pubsub new peer discovery and wsPeer registration:

{"time":"2024-12-04T16:42:43.237595Z","log":"[signal SIGSEGV: segmentation violation code=0x1 addr=0xa0 pc=0x1a46d72]"}
{"time":"2024-12-04T16:42:43.237610Z","log":"goroutine 1012678170 [running]:"}
{"time":"2024-12-04T16:42:43.237617Z","log":"github.com/algorand/go-algorand/network.(*wsPeer).RoutingAddr(0xc02a57b588?)"}
{"time":"2024-12-04T16:42:43.237623Z","log":"\tgithub.com/algorand/go-algorand/network/wsPeer.go:387 +0x12"}
{"time":"2024-12-04T16:42:43.237628Z","log":"github.com/algorand/go-algorand/data.(*TxHandler).incomingTxGroupAppRateLimit(0xc0000fec60, {0xc0b02a6008, 0x1, 0x2}, {0x2c51360, 0x0})"}
{"time":"2024-12-04T16:42:43.237634Z","log":"\tgithub.com/algorand/go-algorand/data/txHandler.go:722 +0xcd"}

Suggested fix is to use gsPeer temporary type good enough for tx handler, and delay its resolution to wsPeer.

Test Plan

Added a test confirming a closer set by ERL to a temporary peer is propagated to a wsPeer.

@algorandskiy algorandskiy requested review from cce and gmalouf December 7, 2024 02:19
@algorandskiy algorandskiy self-assigned this Dec 7, 2024
Copy link

codecov bot commented Dec 7, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 51.88%. Comparing base (b7b3e5e) to head (a1aec56).

Files with missing lines Patch % Lines
network/p2pNetwork.go 70.58% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6193      +/-   ##
==========================================
- Coverage   51.88%   51.88%   -0.01%     
==========================================
  Files         639      639              
  Lines       85489    85521      +32     
==========================================
+ Hits        44359    44372      +13     
- Misses      38320    38332      +12     
- Partials     2810     2817       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@algorandskiy
Copy link
Contributor Author

Looking for opinions on a current delayed lookup via OnClose, or adding a p2p event listener and a permanent background goroutine for remapping pending connected peers to wsPeers (peers supporting our custom proto).

@algorandskiy algorandskiy marked this pull request as ready for review December 9, 2024 18:30
@algorandskiy
Copy link
Contributor Author

Replaced with #6195 after @cce pointed out we do not have ERL for p2p/pubsub case so no extra OnClose handling needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant