gossipsub: remove fast_message_id_fn
#4138
Labels
difficulty:moderate
getting-started
Issues that can be tackled if you don't know the internals of libp2p very well
help wanted
Description
Today
libp2p-gossipsub
provides thefast_message_id_fn
mechanism:rust-libp2p/protocols/gossipsub/src/config.rs
Lines 653 to 667 in 1eedcb5
Past motivation for the mechanism is the following . Ethereum compresses GossipSub messages. To avoid decompression just to find out that a message is a duplicate, introduce an additional message id method that can be applied pre-decompression.
Though the motivator itself, i.e. to avoid de-compression is no longer relevant. To quote @AgeManning:
One might think that removing the
fast_message_id_fn
mechanism makeslibp2p-gossipsub
prone to DOS attacks where the attacker tries to exhaust the CPU through forcing lots of decompression. Though even with the mechanism, an attacker can send slightly altered messages, thus forcing the local machine to do the decompression work.Next to the above no longer relevant optimization, the mechanism adds significant amount of complexity.
rust-libp2p/protocols/gossipsub/src/behaviour.rs
Lines 326 to 327 in 1eedcb5
handle_received_message
.rust-libp2p/protocols/gossipsub/src/behaviour.rs
Lines 1743 to 1874 in 1eedcb5
Motivation
Simplify
libp2p-gossipsub
.@AgeManning extracted from our past discussion. Please comment in case I am missing something.
Current Implementation
Are you planning to do it yourself in a pull request?
No, but I am happy to mentor someone.
The text was updated successfully, but these errors were encountered: