-
Notifications
You must be signed in to change notification settings - Fork 21.4k
eth/protocols/eth: reject messages with duplicated txs #32728
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
base: master
Are you sure you want to change the base?
Conversation
We can have it in the next release. I think the issue is legit |
Would be nice to have a test for this in |
2ffe389
to
dae4a86
Compare
I'm wondering what should be the goal here: while we could deduplicate easily, we could also make this a protocol violation. I do not see any reasons for a peer to send duplicates in the same message except for programming error, so I would prefer to do the duplicate check and disconnect with an error code. |
More specifically, we have this in the spec:
Based on this we can disconnect nodes that send duplicates in the same message. |
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
I've updated this to return error and thus disconnect on duplicate in the same message. Let me know if you agree. We are still not disconnecting if the duplicate is in separate packets. While the spec says nodes must not do it, let's discuss first whether there could be some side effects. |
The spec https://github.com/ethereum/devp2p/blob/master/caps/eth.md#pooledtransactions-0x0a says: The response must be aligned with the request. What if the request contains the duplicated tx hashes? Unfortunately it's not specified in the spec whether it violates the protocol or not. So i will assume it's https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getpooledtransactions-0x09 |
But it is us doing the request, and we are not sending requests repeating the same hash multiple times. |
Although the spec does not specify how to handle the situation of duplicate hashes. However, this would not be compatible with the previous situation. Would there be any issues? |
Issues could only happen if there would be nodes sending duplicates in the same message.
On our side,
|
I was also running this on mainnet for a while, haven't seen any any issues (as expected). |
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
implement #32724
Add deduplication to avoid the same txs multiple times in a single message