-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[dag] node and certified node verification checks #8971
Conversation
3f34e94
to
3b1b268
Compare
3b1b268
to
b3fe5e0
Compare
let current_round = self.metadata().round(); | ||
|
||
if current_round == 0 { |
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.
ah I think we need to decide on whether it starts at 0 or 1
feadb53
to
762ba93
Compare
b9f6339
to
b301c8b
Compare
762ba93
to
8f40b25
Compare
b301c8b
to
7d13095
Compare
@@ -197,8 +239,15 @@ impl Node { | |||
|
|||
impl TDAGMessage for Node { | |||
fn verify(&self, verifier: &ValidatorVerifier) -> anyhow::Result<()> { | |||
ensure!(self.digest() == self.calculate_digest(), "invalid digest"); |
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.
Does it make sense to move this check after we validate it?
To prevent DDoS. If I already signed a node for you in this round I do not need to verify and compute expensive digest.
@@ -281,6 +332,8 @@ impl Deref for CertifiedNode { | |||
|
|||
impl TDAGMessage for CertifiedNode { | |||
fn verify(&self, verifier: &ValidatorVerifier) -> anyhow::Result<()> { | |||
ensure!(self.digest() == self.calculate_digest(), "invalid digest"); | |||
|
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.
Same comment. If we already have this certified node, why compute digests?
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.
We need digest to lookup the certifiednode.
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 Zekun is changing it. Lookup by metadata.
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.
Please add a future TODO regarding my comments.
7d13095
to
d2a5fde
Compare
92f84dd
to
544bea6
Compare
544bea6
to
d02611f
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.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
This PR adds self-contained verification checks and validation checks to
Node
andCertifiedNode
handlers.Test Plan
Unit tests