p2p: refactor gossipsub to validation and handling#5976
p2p: refactor gossipsub to validation and handling#5976algorandskiy merged 10 commits intoalgorand:feature/p2pfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/p2p #5976 +/- ##
===============================================
- Coverage 55.97% 55.24% -0.74%
===============================================
Files 495 495
Lines 68896 69009 +113
===============================================
- Hits 38562 38121 -441
- Misses 27708 28273 +565
+ Partials 2626 2615 -11 ☔ View full report in Codecov by Sentry. |
This reverts commit 439e89ecbdcecd1cb6f92f32d17933694c723328.
244694f to
2b4e304
Compare
| type Multiplexer struct { | ||
| msgHandlers atomic.Value // stores map[Tag]MessageHandler, an immutable map. | ||
| msgHandlers atomic.Value // stores map[Tag]MessageHandler, an immutable map. | ||
| msgProcessors atomic.Value // stores map[Tag]MessageProcessor, an immutable map. |
There was a problem hiding this comment.
It's probably worth updating network/multiplexer_test.go as well
|
tools cross-check fails but this is OK since the entire p2p branch needs updates from |
cce
left a comment
There was a problem hiding this comment.
LGTM! I added a few suggestions for a little additional documentation but I like it, I can't imagine chopping up processor/validator would have any impact on performance for the wsNetwork?
| // check for duplicate messages | ||
| // this helps against relaying duplicates | ||
| if msgKey, isDup = handler.msgCache.CheckAndPut(rawmsg.Data); isDup { | ||
| if msgKey, isDup = handler.msgCache.CheckAndPut(data); isDup { |
There was a problem hiding this comment.
gossipsub has its own duplicate checker too, depending on the message hash function implementation? I wonder how often you will hit this when gossipsub is in front of it
Summary
MessageProcessorsimilar toMessageHandlerbut working in two stages: validate and handleprocessIncomingTxntxhandler method into two validate + handleTest Plan