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

Stake-pool list can return pools without cost, margin and pledge #1948

Closed
PegasusPool opened this issue Jul 24, 2020 · 4 comments
Closed

Stake-pool list can return pools without cost, margin and pledge #1948

PegasusPool opened this issue Jul 24, 2020 · 4 comments
Assignees

Comments

@PegasusPool
Copy link

PegasusPool commented Jul 24, 2020

Context

The Pegasus app crashed when processing the pools from cardano-wallet on "Shelley Testnet 2".
After investigating I realised that some pools have missing fields that I never expected to be null.

Query:
cardano-wallet-shelley stake-pool list --port 3102 --stake 1

Response:

...
    {
        "metrics": {
            "saturation": 1.4277020904353006,
            "non_myopic_member_rewards": {
                "quantity": 0,
                "unit": "lovelace"
            },
            "produced_blocks": {
                "quantity": 0,
                "unit": "block"
            },
            "relative_stake": {
                "quantity": 0.57,
                "unit": "percent"
            }
        },
        "id": "e0850a4319f3b75f4df3be01e30fb1f0e9840b71c0d7251c01bd5997"
    }
...
Information Cardano-node
Version 1.15.1 712a287602797e8fd889fbf73e56a08c3d8b004a
Platform Ubuntu 18.04
Installation Source
Information Cardano-wallet
Version 2020.7.6 (git revision: 42872e)
Platform Ubuntu 18.04
Installation Source

Expected behavior

Pools always have cost, margin and pledge value populated when stake-pool list is fetched

Actual behavior

Some stake pools have no cost, margin and pledge value

Issue Update

After deleting cardano-wallet's DB folder and restarting the wallet the pool with id e0850a4319f3b75f4df3be01e30fb1f0e9840b71c0d7251c01bd5997 is now showing up with cost, margin and pledge.

@KtorZ
Copy link
Member

KtorZ commented Jul 24, 2020

Pools information are fetched from 3 different places (ledger state, on-chain data and metadata server). It is utterly complicated / not desirable to maintain these three data-sources in sync. The pool cost, margin and pledge comes from on-chain certificates that are eventually read discovered. Yet, if you query the API right before they are, the wallet may not yet know about them but still know about pools via the ledger state queried from the node.

This is why these fields are marked as non-required in the API documentation. Though, once they are known, they will remain known.

I agree that the experience may not be the best one here, and there's no certainty that this will change anytime soon. Possibly, we could discard data received from the ledger state if the wallet hasn't yet discovered the corresponding certificate.

@PegasusPool
Copy link
Author

Thanks for the explanation @KtorZ
I'll deal with this in the app now and hope your proposal to discard data received from the ledger in the absence of a certificate will be implemented at some point.

@KtorZ
Copy link
Member

KtorZ commented Jul 27, 2020

Should be fixed in latest master now.

Fixed as in: pools will only be returned with cost, margin and pledge.

@piotr-iohk
Copy link
Contributor

lgtm

This issue was closed.
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

4 participants