-
Notifications
You must be signed in to change notification settings - Fork 459
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
Separate election from ticket generation (Part of #2225) #3287
Conversation
1f57cf7
to
b1a6c4b
Compare
f2f87db
to
b785f97
Compare
1a9317b
to
4c3257b
Compare
@anorth @frrist I've put in effort to make this PR's commit history helpful for review. It is best reviewed one commit at a time.
|
4c3257b
to
123eb5d
Compare
log.Debugf("Mining on tipset: %s, with %d null blocks.", base.String(), nullBlkCount) | ||
if ctx.Err() != nil { | ||
log.Warningf("Worker.Mine returning with ctx error %s", ctx.Err().Error()) | ||
return false | ||
} | ||
|
||
challenge, err := consensus.CreateChallengeSeed(base, uint64(nullBlkCount)) | ||
// Read uncached worker address | ||
workerAddr, err := w.api.MinerGetWorkerAddress(ctx, w.minerAddr) |
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 one of those calls that should be clearly parameterised by the tipset keying the state in which the address is looked up, #3022. Can you make that change in a prefactor?
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.
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.
Merging #3401 is proving tricky. Deferring to an immediate follow on in favor of getting this in for 0.5 staging.
My feedback is mostly minor: great work. The opaque hex strings are perhaps my biggest problem. The factoring here definitely needs some work so that we can write much more thorough tests, but well done on improving the situation. |
123eb5d
to
347ec25
Compare
Codecov Report
@@ Coverage Diff @@
## master #3287 +/- ##
=======================================
+ Coverage 47% 47% +<1%
=======================================
Files 229 230 +1
Lines 14254 14305 +51
=======================================
+ Hits 6751 6850 +99
+ Misses 6513 6444 -69
- Partials 990 1011 +21 |
b5a692c
to
1f02fd7
Compare
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 looks great @ZenGround0!
1f02fd7
to
b138e2d
Compare
- Include worker address query in power table view - Integrate elections into block validation - Integrate elections into block mining - Integrate updated components into node
b138e2d
to
ac3bf05
Compare
Why do we need this PR
Right now ticket generation and election proof generation are one and the same. To get closer to the planned consensus construction we need to separate those things out. This PR does so while at the same time tying the ticket and election proof operations to objects to organize functionality together.
Non-goals