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

Add Client fallback to local PoW option #682

Merged
merged 2 commits into from
Mar 2, 2022
Merged

Conversation

cycraig
Copy link
Contributor

@cycraig cycraig commented Mar 1, 2022

Description of change

Exposes the fallback_to_local_pow configuration option on the ClientBuilder (Config for Wasm bindings), which is enabled by default. This allows disabling the behaviour of performing proof-of-work locally when publishing and no nodes support remote PoW.

Aside: we should consider refactoring Config, either by

  • renaming it ClientConfig for clarity, or
  • renaming it ClientBuilder and adding a build method for consistency, or
  • replacing it with a duck-typed interface similar to other places in the Wasm bindings (may not be possible due to options with multiple parameters).

Added

  • Add ClientBuilder::fallback_to_local_pow.
  • Add Wasm Config.setFallbackToLocalPoW.

Links to any relevant issues

Fixes #667.

Type of change

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Wasm tests and examples pass locally.

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@cycraig cycraig added Wasm Related to Wasm bindings. Becomes part of the Wasm changelog Added A new feature that requires a minor release. Part of "Added" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. labels Mar 1, 2022
@cycraig cycraig requested a review from abdulmth March 1, 2022 20:14
@cycraig cycraig merged commit 8451e25 into dev Mar 2, 2022
@cycraig cycraig deleted the feat/fallback-local-pow branch March 2, 2022 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added A new feature that requires a minor release. Part of "Added" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. Wasm Related to Wasm bindings. Becomes part of the Wasm changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task] Allow build-time configuration of local proof-of-work fallback
2 participants