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

Add a libp2p rate limiting behavior #1677

Open
Voxelot opened this issue Feb 17, 2024 · 1 comment
Open

Add a libp2p rate limiting behavior #1677

Voxelot opened this issue Feb 17, 2024 · 1 comment

Comments

@Voxelot
Copy link
Member

Voxelot commented Feb 17, 2024

related: #1663

Since we can't be overly strict on our reputation checks for mempool gossip, we should implement a p2p rate limiter which applies equally to all gossipped transactions.

Voxelot added a commit that referenced this issue Feb 20, 2024
It is fairly common for gossipped transactions to fail due to transient
reasons such as UTXO's being spent before the transaction is included. A
transaction that was valid when broadcast could become invalid if its
inputs were spent in a newly confirmed block. Penalizing nodes for this
could unfairly punish nodes that are simply "behind" in their view of
the blockchain state.

In bitcoin, only incorrectly formatted transactions (i.e. invalid
signatures or corrupt data according to consensus rules) are considered
immediately punishable, and all transient (ie. state dependent) failures
are ignored but unpunished.
https://github.com/bitcoin/bitcoin/blob/6ff0aa089c01ff3e610ecb47814ed739d685a14c/src/net_processing.cpp#L1849

However, bitcoin does implement rate limiting on peers to prevent spam
of either valid or invalid transactions to work around this. That is not
currently implemented in this PR (but noted in this issue: #1677)

https://github.com/bitcoin/bitcoin/blob/6ff0aa089c01ff3e610ecb47814ed739d685a14c/src/net_processing.cpp#L3842C23-L3842C37
@MitchTurner
Copy link
Member

I think we need a little clarification here.

I understand that gossiped transactions will sometimes fail for non-malicious reasons. This means that we shouldn't punish the nodes that broadcast those transactions. This seems to be an alternative to punishing those nodes while still keeping the network somewhat secure.

I'm just having a hard time understanding the sentence:

we should implement a p2p rate limiter which applies equally to all gossipped transactions

What does "equally" mean here, for example.

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

No branches or pull requests

2 participants