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

List/create shelley wallet while cardano-node is syncing takes a long time #1759

Closed
piotr-iohk opened this issue Jun 15, 2020 · 1 comment
Closed
Assignees

Comments

@piotr-iohk
Copy link
Contributor

piotr-iohk commented Jun 15, 2020

Context

Information -
Version 2020.6.5 (git revision: 0fd72625c3ed83999a59c6187445774210ac5d12)
Platform Linux, all?
Installation From source

Steps to Reproduce

  1. start cardano-node + cardano-wallet on Shelley testnet.
    e.g.:
    cardano-node:
nix-build -A scripts.ff.node -o ff-node-local && ./ff-node-local

cardano-wallet-shelley:

cardano-wallet-shelley serve --port 8090 \
	--node-socket /path/to/node.socket  \
	--testnet /nix/store/v8lb35176p73f6ksp7p5rhkqmygi1zj9-ff-genesis.json \
        --database ./testnet-ff
  1. While node is in the process of syncing, create shelley wallet and/or try to list shelley wallets.

Expected behavior

Results should appear.

Actual behavior

It takes quite a long time. Occasionally one can get:

Code = 503,
Message = {"code":"network_unreachable","message":"The node backend is unreachable at the moment. Trying again in a bit might work."}

When it takes long time, it appears to be co-related with the log entries for "Querying the reward account balance" and "Result for account":

[RequestId 38] [GET] /v2/wallets
[cardano-wallet.wallet-db:Info:1940] [2020-06-15 11:25:15.16 UTC] Found existing wallet: 54dd899cfa7f27b8e02a127f6b9088b77fd150e1
[cardano-wallet.network:Info:1940] [2020-06-15 11:25:15.16 UTC] Querying the reward account balance for 256db575ccb98453aae20137dbbc45311150a9732278fe64fc3233379eed3f66 at 70617265<-[c2b78cdb-8.12970#8927]

...waiting for result...

[cardano-wallet.network:Info:1940] [2020-06-15 11:25:15.17 UTC] Result for account 256db575ccb98453aae20137dbbc45311150a9732278fe64fc3233379eed3f66:
  delegations = fromList []
  rewards = fromList []

result received.


Resolution


QA

  • Manually testing reward balance and performance on the shelley_testnet. :-/
@rvl rvl self-assigned this Jun 15, 2020
iohk-bors bot added a commit that referenced this issue Jun 29, 2020
1768: Store delegation reward account balances in the database r=rvl a=rvl

### Issue Number

ADP-302 / #1750 / #1759

### Overview

Turns out querying reward account balances can be slow.
This is not good if it's done when listing/getting wallets.
Better to do these queries in a separate thread and cache the results in the database.

- [x] Add new database table for the latest known wallet reward account balance.
- [x] Use the database when getting the reward account balance.
- [x] Add a network layer method to watch the node tip.
- [x] Update the account balance in each wallet when the node tip changes (asynchronously).
- [x] Store reward account balance in db as it arrives.
- [x] Adapt Jörmungandr network layer


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Jun 29, 2020
1768: Store delegation reward account balances in the database r=KtorZ a=rvl

### Issue Number

ADP-302 / #1750 / #1759

### Overview

Turns out querying reward account balances can be slow.
This is not good if it's done when listing/getting wallets.
Better to do these queries in a separate thread and cache the results in the database.

- [x] Add new database table for the latest known wallet reward account balance.
- [x] Use the database when getting the reward account balance.
- [x] Add a network layer method to watch the node tip.
- [x] Update the account balance in each wallet when the node tip changes (asynchronously).
- [x] Store reward account balance in db as it arrives.
- [x] Adapt Jörmungandr network layer


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Jun 29, 2020
1768: Store delegation reward account balances in the database r=KtorZ a=rvl

### Issue Number

ADP-302 / #1750 / #1759

### Overview

Turns out querying reward account balances can be slow.
This is not good if it's done when listing/getting wallets.
Better to do these queries in a separate thread and cache the results in the database.

- [x] Add new database table for the latest known wallet reward account balance.
- [x] Use the database when getting the reward account balance.
- [x] Add a network layer method to watch the node tip.
- [x] Update the account balance in each wallet when the node tip changes (asynchronously).
- [x] Store reward account balance in db as it arrives.
- [x] Adapt Jörmungandr network layer


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Jun 29, 2020
1768: Store delegation reward account balances in the database r=KtorZ a=rvl

### Issue Number

ADP-302 / #1750 / #1759

### Overview

Turns out querying reward account balances can be slow.
This is not good if it's done when listing/getting wallets.
Better to do these queries in a separate thread and cache the results in the database.

- [x] Add new database table for the latest known wallet reward account balance.
- [x] Use the database when getting the reward account balance.
- [x] Add a network layer method to watch the node tip.
- [x] Update the account balance in each wallet when the node tip changes (asynchronously).
- [x] Store reward account balance in db as it arrives.
- [x] Adapt Jörmungandr network layer


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Jun 30, 2020
1768: Store delegation reward account balances in the database r=rvl a=rvl

### Issue Number

ADP-302 / #1750 / #1759

### Overview

Turns out querying reward account balances can be slow.
This is not good if it's done when listing/getting wallets.
Better to do these queries in a separate thread and cache the results in the database.

- [x] Add new database table for the latest known wallet reward account balance.
- [x] Use the database when getting the reward account balance.
- [x] Add a network layer method to watch the node tip.
- [x] Update the account balance in each wallet when the node tip changes (asynchronously).
- [x] Store reward account balance in db as it arrives.
- [x] Adapt Jörmungandr network layer


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
@piotr-iohk
Copy link
Contributor Author

LGTM. Issue not observed currently on shelley testnet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants