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

Harvesting: fallback option in case when statistics service fail to find a node #1817

Open
cryptoBeliever opened this issue Dec 20, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@cryptoBeliever
Copy link
Contributor

cryptoBeliever commented Dec 20, 2021

What Happened

During harvesting page improvements: #1781 there was a change to query (by nodePublicKey) for node using statistics service. Chosen by user node is no longer stored in local storage because we are able to identify URL based on statistics service.

Unfortunately, statistics service may not always know about all nodes for example:

In such situation (when statistics service don't have information about selected by user node) there are two problems:

  1. Wallet is not able to query nodePublicKey based on node URL (at this moment for that is used statistics service) forcing user to provide nodePublicKey manually even if node exposes API
  2. When user provide manually nodePublicKey and will start harvesting then wallet is not able "find" correct URL (statistics service returns 404 error) to check status.

How to Reproduce

As a precondition we need a valid node that is not listed in statistics service. At the moment of rising this issue it was 154.53.43.170

  1. Go to an account that can start harvesting (balance >= 10000 and importance > 0)
  2. Go to harvesting view
  3. Put "Node URL" using a node that is not known by statistics service (154.53.43.170)
    First problem: wallet asks for nodePublicKey but it could query it using /node/info endpoint since it's the dual node.

image

  1. Put nodePublicKey manually, link keys and after tx confirmation start harvesting

Second problem: After second transaction confirmation status is still "Activation in progress" and after some time "Failed". It's because wallet is not able "find" node URL based on statistics service.

In debug console we can see that statistics service returns 404 for publicKey and nodePublicKey calls:

https://symbol.services/nodes/F854E875BD2A158909B1E8BC287DC6F1FE051B55AC4E37648B29ECEEC3563991 -> 404 'not found'
https://symbol.services/nodes/nodePublicKey/C5D1FB3FD8E356AC34B31067A02CF930E520480C9C2BAD3CE336CA13BD8316C4 -> 404 'not found'

Harvesting is indeed activated which can be checked using /node/unlockedaccount endpoint. So problem is only node URL by nodePublicKey resolution.

image

Why This Happens

It happens because the wallet don't store anymore information about chosen by user node URL. When statistics service did not discover yet selected by user node, a wallet is not able query correct node URL to check harvesting status.

Proposed Improvement

  1. As a fallback option save (in local storage) URL of node on which user requested harvesting. Use this URL to check harvesting status (if nodePublicKey on blockchain matches with nodePublicKey returned by /node/info endpoint) in case when statistics service returns 404.

  2. When user provide node URL then to query nodePublicKey use information from /node/info endpoint (because this is more reliable) instead statistics service.

@cryptoBeliever cryptoBeliever added the enhancement New feature or request label Dec 20, 2021
@cryptoBeliever cryptoBeliever changed the title Harvesting - fallback option on case when statistics service fail to find a node Harvesting - fallback option in case when statistics service fail to find a node Dec 22, 2021
@cryptoBeliever cryptoBeliever changed the title Harvesting - fallback option in case when statistics service fail to find a node Harvesting: fallback option in case when statistics service fail to find a node Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant