-
Notifications
You must be signed in to change notification settings - Fork 189
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
The timecache should be checked/updated after validation #155
Comments
Proposed action: move the timecache check/update after validation. |
In addition to the censorship attack vector, an adversarial actor can cause peers to consume memory in the timecache by sending a torrent of invalid messages. |
SGTM. We could also check in both places to avoid re-validating duplicate valid messages. |
We could also have a separate (shorter) validation cache where we cache a hash of the message/author. |
We can do with a check of the valid message cache, but without update. |
Note that the hash cache won't work any better, as the author cannot be proven to be authentic prior to validation. |
Currently, the timecache is checked/updated for seen messages prior to message validation.
This was done with the intention of avoiding duplicate message validation.
Unfortunately it introduces a censorship attack vector:
If an adversarial actor can predict a peer's sequence number (by observing a prior message), then it can attempt to send an invalid message with the predicted id.
The message will fail validation, due to signature firstly; but it will also poison the timecache, resulting in dropping a sebsquent message from the peer with the predicted id.
cc @whyrusleeping @Stebalien
The text was updated successfully, but these errors were encountered: