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 basic cardano-wallet-shelley package #1657

Closed
8 tasks done
Anviking opened this issue May 13, 2020 · 3 comments
Closed
8 tasks done

Add basic cardano-wallet-shelley package #1657

Anviking opened this issue May 13, 2020 · 3 comments
Assignees

Comments

@Anviking
Copy link
Member

Anviking commented May 13, 2020

Context

ADP-289

Decision

Do the initial scaffolding to integrate with a Shelley node.

Acceptance Criteria

Straight from the U/S:

  • There should be a cardano-wallet-shelley new package target which instantiates the wallet core engine and API for Shelley wallets with a working networking layer.
  • The integration tests must be setup to work with a Shelley cardano-node.
  • Integration scenarios which however requires making transactions may be disabled for these aren't supported yet by the core node.
  • The transaction layer may throw and be unimplemented for now.

Development

QA

  • There is a cardano-wallet-shelley executable that connects to the shelley node
  • Integration tests are setup and run (a few) scenarios not requiring transactions
@Anviking Anviking self-assigned this May 13, 2020
@Anviking Anviking changed the title Initial integration with Shelley Node Add basic cardano-wallet-shelley package May 13, 2020
iohk-bors bot added a commit that referenced this issue May 14, 2020
1626: Initial integration with shelley node r=Anviking a=Anviking

# Issue Number

ADP-289, #1657

# Overview

- [x] Copied the `cardano-wallet-byron` structure and made it compile for shelley
- [x] Completely unimplemented `TransactionLayer`
- [x] A few integration tests and unit tests are running (that don't need txs)
- [x] Add appropriate CLI and API
- [x] Make sure a wallet can be restored

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


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

@Anviking

I see a lot of these in wallet log:

[cardano-wallet.wallet-engine:Warning:5871] [2020-05-14 16:54:28.42 UTC] 661e2159: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")

It looks like wallet fails to fetch blocks?
I see the node is moving up, the node log says from time to time:

Chain extended, new tip:...

But the wallet doesn't seem to keep up and wallets become unsynced.
Also node tip from /network/information is not moving up.

To reproduce:

  1. start cardano-node:
cardano-node run \
	--topology ff-topology.json \
	--socket-path ./node.socket \
	--database-path ./db \
	--config ff-config.json \
	--port 3300

  1. start wallet:
cardano-wallet-shelley serve \
	--node-socket ./node.socket \
	--testnet ./ff-genesis.json \
	--database ./wallet-db
  1. Observe that wallet gets synced up to the node tip.
  2. You may create a wallet, wallet gets synced
  3. Let it work for a while and you may observe that wallet seems not to follow the chain. In the wallet log there is:
[cardano-wallet.wallet-engine:Warning:5871] [2020-05-14 16:54:28.42 UTC] 661e2159: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")

Wallets become unsynced.

iohk-bors bot added a commit that referenced this issue May 15, 2020
1668: Remove 30s timeout in for chain-sync requests r=Anviking a=Anviking

# Issue Number

#1657 

# Overview

- [x] I removed the possibility for chain sync commands to timeout.

# Comments

Without this the wallet would get stuck on the friends and family testnet

```
[cardano-wallet.wallet-engine:Info:37] [2020-05-15 15:39:52.49 UTC] 755ef893: syncProgress: restored
[cardano-wallet.wallet-engine:Info:37] [2020-05-15 15:39:52.49 UTC] 755ef893: discovered 0 new transaction(s)
[cardano-wallet.wallet-engine:Info:37] [2020-05-15 15:39:52.49 UTC] 755ef893: local tip: cf853d5d<-[baba20fd-11.5092#6393]
[cardano-wallet.wallet-engine:Warning:37] [2020-05-15 15:40:22.49 UTC] 755ef893: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")
[cardano-wallet.wallet-engine:Warning:37] [2020-05-15 15:40:53.47 UTC] 755ef893: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")
[cardano-wallet.wallet-engine:Warning:37] [2020-05-15 15:41:25.47 UTC] 755ef893: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")
[cardano-wallet.wallet-engine:Warning:37] [2020-05-15 15:41:59.48 UTC] 755ef893: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")
[cardano-wallet.wallet-engine:Warning:37] [2020-05-15 15:42:34.49 UTC] 755ef893: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")
[cardano-wallet.wallet-engine:Warning:37] [2020-05-15 15:43:09.50 UTC] 755ef893: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")
[cardano-wallet.wallet-engine:Warning:37] [2020-05-15 15:43:44.51 UTC] 755ef893: Failed to get next blocks: ErrGetBlockNetworkUnreachable (ErrNetworkUnreachable "timeout")
```

but on that note, shouldn't it have recovered? 🤔 

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


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

@Anviking
After #1668 I see that wallets (byron and shelley) do keep up with the chain 🎉. However there is still problem with GET network/information, i.e. the node tip is not moving and it reports as being unsynced after a while...

iohk-bors bot added a commit that referenced this issue May 18, 2020
1671: Fix non-terminating fromPParams r=Anviking a=Anviking

# Issue Number

#1657 

# Overview

- [x] I made `fromPParams` not loop indefinitely and break the tip-following.

# Comments

The node tip now updates correctly:
```
$ cardano-wallet-shelley network information
Ok.
{
    "network_tip": {
        "epoch_number": 22,
        "slot_number": 8397
    },
    "node_tip": {
        "height": {
            "quantity": 12738,
            "unit": "block"
        },
        "epoch_number": 22,
        "slot_number": 8360
    },
    "sync_progress": {
        "status": "ready"
    },
    "next_epoch": {
        "epoch_start_time": "2020-05-18T14:15:00Z",
        "epoch_number": 23
    }
}
 $ cardano-wallet-shelley network information
Ok.
{
    "network_tip": {
        "epoch_number": 22,
        "slot_number": 8398
    },
    "node_tip": {
        "height": {
            "quantity": 12739,
            "unit": "block"
        },
        "epoch_number": 22,
        "slot_number": 8398
    },
    "sync_progress": {
        "status": "ready"
    },
    "next_epoch": {
        "epoch_start_time": "2020-05-18T14:15:00Z",
        "epoch_number": 23
    }
}
```

 - Could have added a test that `fromPParams` terminates/doesn't throw, but that seemed a bit too specific. When we add `Test.Integration.Scenario.API.Shelley.Wallets` I think those scenarios will cover this.

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue May 22, 2020
1676: Bump cardano-node to pioneer-3 r=rvl a=Anviking

# Issue
None, or #1657
# Overview

- [x] I have bumped cardano-node to the `pioneer-3` tag, such that the new friends-and-family testnet works

# Comments

- `nix-shell` not working yet

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


1679: Reduce running time of fee estimation endpoint r=rvl a=rvl

### Issue Number

Relates to ADP-283 / #1648.

### Overview

The nightly api endpoint latency benchmark got 100× slower for `postTransactionFee`. This fixes it by moving common setup for coin selection outside of the loop.

### Comments

```
    Latencies for 10 fixture wallets scenario
        postTransactionFee - before - 102.2 ms
        postTransactionFee  - after - 4.8 ms
```

1680: Fix port selection in the db migration tests r=rvl a=rvl

### Issue number

Relates to #1649

### Overview

Each migration test running in turn was using the same port.

However due to the `SO_LINGER` TCP socket option, the port remains in use for a short time after the wallet server process exits.

So use a different port for each test.

### Comments

Tested with:

    nix-build -A migration-tests -o migration-tests && ./migration-tests/runall.sh


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

OK, closing. Wallet seems to work fine on f&f now.

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