-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat: add validation to request / response interactions + adjust scoring appropiately #8641
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
return false; | ||
} | ||
|
||
if (!requestedTxHash.equals(responseTx.getTxHash())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be performing this check first? Should be a faster filter than verifying the proof right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, updating
@@ -209,5 +229,47 @@ describe('ReqResp', () => { | |||
|
|||
await stopNodes(nodes); | |||
}); | |||
|
|||
it('Should penalize peer if transaction validation fails', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test
Overview
Adds a request response validator to the request response module that will make sure the data
returned from the reqresp request is the data that has been requested.
In the Transaction case, this means verifying the proof to ensure that the first nullifier is actually correct.
We do not use the tx propagation validator as it performs more checks than required. If we are requesting a transaction, it is either during a sync, or for an performing attestation, where we do not care about being served old data. Just data that is what we asked for
fixes: #8483
fixes: #8485