-
Notifications
You must be signed in to change notification settings - Fork 22
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
Write Enrollments data to the block. #504
Conversation
|
Codecov Report
@@ Coverage Diff @@
## v0.x.x #504 +/- ##
==========================================
- Coverage 89.78% 88.89% -0.89%
==========================================
Files 62 61 -1
Lines 4463 4556 +93
==========================================
+ Hits 4007 4050 +43
- Misses 456 506 +50
Continue to review full report at Codecov.
|
I'm not sure if the way the commits were split makes sense. All of these seem like they atomically belong together as a single commit. @Geod24 do you agree? |
If this looks like it, I'll make these committs single-commit |
f16eaf7
to
1164b38
Compare
source/agora/node/Ledger.d
Outdated
@@ -68,17 +73,21 @@ public class Ledger | |||
pool = the transaction pool | |||
utxo_set = the set of unspent outputs | |||
storage = the block storage | |||
enroll_man = the enrollmentManager | |||
node_config = the node config |
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 catch. 👍
@@ -236,6 +249,11 @@ public class Ledger | |||
if (!this.storage.saveBlock(block)) | |||
assert(0); | |||
|
|||
foreach (enrollment; block.header.enrollments) | |||
if (!this.enroll_man.updateEnrolledHeight(enrollment.utxo_key, |
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.
This is a great example of what @Geod24 talked about. If updateEnrolledHeight
fails, we shut down the node immediately with assert(0);
.
But then the question is, why is updateEnrolledHeight
returning a boolean status code? It should either throw an Error or just assert(0) itself, and the function should be made nothrow
and not return any status code.
I will file a separate issue for this, so you don't have to change anything here @TrustHenry.
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 was thinking the same thing.
7b75d86
to
6384328
Compare
Ready for review. |
6384328
to
8c854a7
Compare
e3fb1d0
to
9f17b2e
Compare
@Geod24 @AndrejMitrovic ping. |
9f17b2e
to
f326bc8
Compare
I rebased it. |
d07272d
to
a67d75b
Compare
You can also probably isolate |
Needs a rebase too ;) |
fd2d4e3
to
bf0d1eb
Compare
This needs a rebase. And perhaps |
9cd3d74
to
ff3c2b8
Compare
Looks like you removed the consensus commit ? |
Ready to review. |
|
7a6c9ef
to
15fa382
Compare
Could you do it now ? That commit was ready, and it's much better to make consensus before writing to the block :) |
I made PR #620 |
I am doing solving this conflict. |
Ping me when you have rebased, let's get this merged! |
Add the elements into the block. The enrollments update enrolledHeight Enrollment data should be written to the block For unnittest
15fa382
to
577687c
Compare
@Geod24 ping |
Writing Enrollment data to a block determines the height of the block that can participate in the validation as a validator.
Validators needed for the consensus process can be determined and the number of validators between nodes can be set.
Reach consensus on transaction and enrollment setThe enrollments to be included in a block must first
be voted on by the consensus protocol.
Relates to #493
Enrollment data should be written to the block.
Relates to #565Make Enrollment Part of Consensus