js-libp2p-gossipsub icon indicating copy to clipboard operation
js-libp2p-gossipsub copied to clipboard

Consider synced flow when validating gossip messages

Open twoeths opened this issue 3 years ago • 2 comments
trafficstars

Motivation Right now lodestar has "StrictNoSign" signature policy, and a synced msgIdFn, running synced version of "handleReceivedMessage" and "validateReceivedMessage" (hard-coded in node_modules) gives us some improvement in a contabo machine

  • Less dropped jobs - before 40 % in average, after >20% in average Screen Shot 2022-04-05 at 16 13 31

  • p7 is down to -337 vs consistently 0 Screen Shot 2022-04-05 at 16 15 04

  • Thanks for that "min" peer score is almost 0 Screen Shot 2022-04-05 at 16 16 17

  • We need to write a benchmark to see if it's worth to implement a "syncedHandleReceivedMessage" flag

twoeths avatar Apr 05 '22 09:04 twoeths

First we should quantify the cost of promises. This could lead to a lot of duplicate code and make the maintenance much more annoying. So we should have a big incentive to pursue it.

For context, validation is async because libp2p's sha256 is async. It's because they use the in-browser native crypto for browsers, which has an async API.

dapplion avatar May 10 '22 11:05 dapplion

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 14:08 stale[bot]