-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[qs] another refactor #7045
[qs] another refactor #7045
Conversation
78d32e6
to
b954345
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
fa2206e
to
a08666c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -116,7 +123,9 @@ impl ProofCoordinator { | |||
validator_verifier: &ValidatorVerifier, | |||
) -> Result<Option<ProofOfStore>, SignedDigestError> { | |||
if !self.digest_to_proof.contains_key(&signed_digest.digest()) { | |||
if signed_digest.info().batch_author == self.peer_id { | |||
if signed_digest.info().batch_author == self.peer_id |
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.
I think we missed a possible attack. I can make you store incremental signatures for all digests in the system because I can lie about the batch_author in the signed digest. I think the fix is to check signed_digest.info().batch_author against what we store. Probably require an API change to batch_reader.exists.
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.
but in order to check we should be storing it, no? so I guess that's why the original algorithm initialized the proofs from self (assuming self is and should be faster) and then appended matching digest/signatures - and I guess that also explains the check of the own signature, but in this case it should have been an assert.
I think that's a bit nicer than trying to check the author - as long as I'm not mistaken and checking the author almost implies that checking own signature would also be okay.
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.
@igor-aptos since you found the self signature checks - what do you think?
self.digest_to_proof.remove(&signed_digest_info.digest); | ||
batch_ids.push(signed_digest_info.batch_id); | ||
} | ||
if self |
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.
Why do you still call self.expire() in batch_generato.rs?
This commit unifies fragment and proof processing such that we don't differentiate whether the message is for local or remote.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
.batch_reader | ||
.exists(&signed_digest.digest()) | ||
.ok_or(SignedDigestError::WrongAuthor)?; | ||
if batch_author != signed_digest.info().batch_author { |
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.
Can we merge with the if in line 114? => if batch_author != self.peer_id {}
This commit unifies fragment and proof processing such that we don't differentiate whether the message is for local or remote.