-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat(mine): Add an internal Zcash miner to Zebra #8136
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
teor2345
added
P-Optional ✨
C-feature
Category: New features
A-concurrency
Area: Async code, needs extra work to make it work properly.
no-review-reminders
Turn off review reminders
labels
Jan 8, 2024
github-actions
bot
added
the
C-trivial
Category: A trivial change that is not worth mentioning in the CHANGELOG
label
Jan 8, 2024
This should be feature-complete. There aren't any new tests, but the existing tests have good coverage, and I tested it manually. I am just writing the docs now. |
Now the docs should be complete as well. |
arya2
reviewed
Jan 10, 2024
arya2
reviewed
Jan 10, 2024
teor2345
added
A-dependencies
Area: Dependency file updates
A-rpc
Area: Remote Procedure Call interfaces
and removed
C-trivial
Category: A trivial change that is not worth mentioning in the CHANGELOG
no-review-reminders
Turn off review reminders
labels
Jan 11, 2024
arya2
approved these changes
Jan 11, 2024
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 excellent, thank you.
This was referenced Jan 16, 2024
9 tasks
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-concurrency
Area: Async code, needs extra work to make it work properly.
A-dependencies
Area: Dependency file updates
A-rpc
Area: Remote Procedure Call interfaces
C-feature
Category: New features
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
It would be easier to test Zebra if we could mine blocks without external mining software.
This PR depends on changes to
equihash
:zcash/librustzcash#1088
zcash/librustzcash#1083
This is an experimental "free sprint" project.
PR Author Checklist
Check before marking the PR as ready for review:
zebrad/src/lib.rs
zebrad/src/commands/start.rs
For significant changes:
If a checkbox isn't relevant to the PR, mark it as done.
Specifications
This code obeys the consensus rules by generating valid blocks, but it uses the existing verifiers. So there are no consensus-critical changes here.
Complex Code or Requirements
This code launches concurrent async tasks and OS threads. We should check that panics and shutdowns are handled correctly. In particular, miner threads should restart mining with each new block template.
We should check that any common or expected errors are handled by retrying rather than panicking.
We should check that the threads are actually doing different work, they should have nonces with large gaps between them.
Solution
Rust Features:
internal-miner
feature and dependenciesSolver:
equihash
equihash::Solution::solve()
method with difficulty checksMiner:
Parallel Mining:
available_parallelism()
by defaultselect! {}
on solutions or new block templates usinglong_poll_id
Related Changes:
get_block_template
RPC change detectionTesting
I manually verified that:
htop
)Review
This PR is ready for review.
I'd like to focus on bugs and overall code structure in this review.
Reviewer Checklist
Check before approving the PR:
PR blockers can be dealt with in new tickets or PRs.
And check the PR Author checklist is complete.
Follow Up Work
equihash
changes merged and released, and update that dependency