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
Fix #1297: Make Enrollments valid for nomination on only a single block height #1421
Conversation
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.
A few comments.
@linked0 could you also take a look at this and tell us what you think? |
89f0ee9
to
681fd85
Compare
Thanks for the review @AndrejMitrovic , all of your comments should be addressed now. |
It would be good to add a network test in |
I'm reviewing it now. Sorry for the late review. Anyway, it looks really awesome. I will leave some comments or suggestions soon. |
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.
Good work and very important code change.
But the code about the avail_height
was removed unintentionally. Some test code that changed does not go with the original purpose. Please check the comments.
Yeah, I wanted to get some feedback before writing a network test. |
681fd85
to
8d5652c
Compare
Added the network test. |
8d5652c
to
831b5cc
Compare
This field would indicate if a enrollment is active or not. It lets expired enrollment entries to linger so that once that Validator would re-enroll we can validate its commitment.
Enrollments will be validated against the past Enrollments to eliminate the replay attack described in Issue bosagora#1297. For this we need a way to efficiently query past enrollments.
As explained in Issue bosagora#1297, current Enrollments can be reused by a third party any time. With Enrollments including the PreImage that of the current height, they will be only valid for a single block.
831b5cc
to
3523747
Compare
Thanks for the review, @linked0 . I have rebased to |
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.
Great work.
Some suggestions.
With the enrollments being valid for only a single height, enrollemnts in the pool should be revalidated before nomination.
3523747
to
f9fc5cf
Compare
I've applied the changes you suggested @linked0. I'll take a look at the CircleCI failure. Integration tests on my local machine has no problems, its weird. |
Codecov Report
@@ Coverage Diff @@
## v0.x.x #1421 +/- ##
==========================================
+ Coverage 81.14% 81.30% +0.15%
==========================================
Files 120 120
Lines 10551 10678 +127
==========================================
+ Hits 8562 8682 +120
- Misses 1989 1996 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
9bb854b
to
f9fc5cf
Compare
All green |
Thank you @omerfirmak, nice job! Thanks @linked0 for the review! |
With this,
PreImage
s are consumed not by new enrollments but by new blocks. Commitments in new enrollments should be thePreImage
that would be revealed on the height that Enrollment would be available.More background info at #1297