Skip to content
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

Allow node to work without work generation #2312

Merged

Conversation

guilhermelawless
Copy link
Contributor

@guilhermelawless guilhermelawless commented Sep 23, 2019

These changes prevent the node from hanging when work generation is requested in any way and generation is not possible.

  • work_threads 0 and !opencl -> local generation disabled (only used for RPC work_generate with use_peers false)
  • local generation disabled and 0 work peers -> work generation disabled
  • Work watcher can still watch the block, but does not rework
  • Precaching will silently fail
  • RPCs send/receive/account_representative_set/block_create have appropriate errors
  • QT wallet will show "Work generation disabled" when trying to e.g. send a block. A future PR could display a permanent status message to warn the user that work generation is disabled, and prevent certain actions
  • Distributed work / work pool will fail when generation is not possible, but I do a check on every caller for custom error handling (all of the above)

Marking as non-breaking change since RPCs would simply hang before.

Most changes are for tests due to changing work_pool::generate to an optional. Actual tests added:

  • rpc.cpp
  • work_pool.cpp
  • distributed_work.cpp
  • wallet.cpp

These changes prevent the node from hanging when work generation is requested in any way and generation is not possible.

- work_threads 0 and !opencl  ->  local generation disabled
- local generation disabled and 0 work peers -> work generation disabled
- Work watcher can still watch the block, but does not rework
- Precaching will silently not be done
- RPCs send/receive/account_representative_set/block_create will error correctly
- QT wallet will show "Work generation disabled" when trying to use, a future PR could display a permanent status message to warn the user that work generation is disabled
- Distributed work / work pool will fail when generation is not possible, but the same is checked on callers for custom error messages
@guilhermelawless guilhermelawless added quality improvements This item indicates the need for or supplies changes that improve maintainability rpc nonbreaking change labels Sep 23, 2019
@guilhermelawless guilhermelawless added this to the V20.0 milestone Sep 23, 2019
@guilhermelawless guilhermelawless self-assigned this Sep 23, 2019
@guilhermelawless guilhermelawless merged commit 8ca90f1 into nanocurrency:master Oct 1, 2019
@guilhermelawless guilhermelawless deleted the allow-pow-disabled branch October 1, 2019 15:02
@zhyatt zhyatt added rpc Changes related to Remote Procedure Calls and removed rpc nonbreaking change labels Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality improvements This item indicates the need for or supplies changes that improve maintainability rpc Changes related to Remote Procedure Calls
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants