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

Enable local proof-of-work fallback #579

Merged
merged 1 commit into from
Jan 12, 2022
Merged

Enable local proof-of-work fallback #579

merged 1 commit into from
Jan 12, 2022

Conversation

cycraig
Copy link
Contributor

@cycraig cycraig commented Jan 11, 2022

Description of change

This enables the pow-fallback feature for iota-client, which means publishing messages falls back to performing proof-of-work locally (on the client) when no nodes support remote proof-of-work.

NOTE: this changes the behaviour of the local_pow setting on the ClientBuilder, making it a preference whether or not to try remote PoW first before using local PoW rather than a hard setting. Since the pow-fallback is a compile-time feature we cannot change whether or not to fallback at runtime. This change may be temporary.

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

Tested with a local one-click-Tangle with remote PoW enabled and disabled on the Hornet node.

  1. When remote PoW on the node is disabled and local PoW on the client is false without local fallback from this PR, we get the following error from the Client when trying to publish a new identity:

    Err > Error [ClientError]: Node error: Response error with status code 400: {"error":{"code":"400","message":"invalid parameter, error: proof of work is not enabled on this node: code=400, message=invalid parameter"}}

  2. When remote PoW on the node is disabled with the local fallback enabled by this PR, the client performs PoW locally and successfully publishes the new identity (regardless of the local_pow variable).

  3. When remote PoW on the node is enabled the client respects the local_pow variable as per the current behaviour.

Change checklist

Add an x to the boxes that are relevant to your changes.

  • 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 Rust Related to the core Rust code. Becomes part of the Rust changelog. Patch Change without affecting the API that requires a patch release. Part of "Patch" section in changelog labels Jan 11, 2022
@cycraig cycraig merged commit 0bc02a3 into dev Jan 12, 2022
@cycraig cycraig deleted the fix/pow-fallback branch January 12, 2022 09:46
@cycraig cycraig mentioned this pull request Jan 12, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Patch Change without affecting the API that requires a patch release. Part of "Patch" 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.

3 participants