-
Notifications
You must be signed in to change notification settings - Fork 207
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
Implement pre-sharing of proposed block #1426
Labels
Comments
Merged
mergify bot
pushed a commit
that referenced
this issue
May 28, 2021
### Description This refactors the miner with a couple goals 1. Simplify the block construction logic. 2. Enable pre-construciton / pre-sharing of blocks in the miner 3. Fix the pending state bug I worked towards these goals by - Reducing the number of go-routines passing work to each other. There is now 1 main loop goroutine. - Make the block creation process as linear as possible (and use contexts to cancel instead of global interrupts). - Each step in the block production cycle is now done in `miner/block.go` - There is no longer a shared "current environment" for the in flight block, but a new environment is made for each request (which is the `blockState` struct). - Block production is cancelable with contexts instead of global interrupts - I have removed as much blocking as possible from `engine.Prepare` - It no longer sleeps until the block time - that is done in the worker - It does not wait until the next sequence for nodes that are not validating ### Other changes - Removes proof of work specific miner interfaces. - Removes miner/unconfirmed.go - Includes some upstream changes made to `miner/miner.go` to simplify the start up logic. ### Tested Unit tests still pass. Tested end to end on `trianglesphere/miner_refactor_v2` TODO: test that this fixes the pending bug. ### Related issues - Fixes #1419 - Partial fix of #1426 ### Backwards compatibility Yes
streamming block construction superseeds this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: