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

Augment of query spo-stake-distribution to include the DRep delegation choices of the Pool's rewards accounts #990

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Dec 9, 2024

Changelog

- description: |
    Augment of query spo-stake-distribution to include the DRep delegation choices of the Pool's rewards accounts
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

We want to augment spo-stake-distribution with extra information (this is #911), which is what we do in this PR. However, we will be able to simplify this PR when using IntersectMBO/cardano-ledger#4735.

But @gitmachtl tagged this as important to have before the Christmas vacation, so here is this PR with a more complex implementation until we integrate the ledger.

Fixes #911

How to trust this PR

Try it on sanchonet:

> cabal run cardano-cli -- conway query spo-stake-distribution --testnet-magic 4 --all-spos
[
    [
        "02641404878b0b7efce28de535c67ddcf073606082d01a3eb01a82ab",
        10473479211237,
        null
    ],
    [
        "1b7a61ba3e5292f34666af3bb2f0b8d36e5001aa41e235709ffa6910",
        10394901955096,
        "drep-alwaysNoConfidence"
    ],
    [
        "30c650e28e1df418bf6881a893fbf872043b522d27d7ad8ead443c82",
        10375665878234,
        null
    ],
    [
        "350856bd7854339f7baef0e71e34dbc73f256552814f1d94e42281c3",
        10374503288238,
        null
    ],
    [
        "3531737ad43673ec059ff03249c3b8d4cfe29fa764d7fd96cc731805",
        97467769,
        "drep-keyHash-f8bfba212e8bc2e516312121bbd6d95e6f6a330f0b67a95a75758dcc"
    ],
    [
        "395933c7b6ca33d1f4a2b22472a6321bc050b166f3f89bb4195f68d5",
        47288144,
        "drep-alwaysAbstain"
    ],
    [
        "3c4fb94e1a2c5649a870aee5a70f21cd64807c7dc38632efcaf3d921",
        13064011955300,
        null
    ],
 ...
]

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

An earlier version of this PR (based on cardano-cli 10.1.0.0 tag) is still available here: https://github.com/IntersectMBO/cardano-cli/commits/smelc/10.0.01-hoops-augment-spo-stake-distribution/

@smelc
Copy link
Contributor Author

smelc commented Dec 9, 2024

@gitmachtl> can you test this PR? (like before, you need https://github.com/IntersectMBO/cardano-api/commits/smelc/legacy-additional-exports/, there is an SRP in this PR).


Note that I haven't forgotten about the renaming of the command (for example to spo-votepower-distribution) but didn't want to mix the renaming with this PR.

Also note that we'll need to wait for @Jimbo4350 to approve this temporary solution until we can update the ledger.

@smelc
Copy link
Contributor Author

smelc commented Dec 11, 2024

@gitmachtl> did you have time to try this one?

@gitmachtl
Copy link
Contributor

gitmachtl commented Dec 11, 2024

@smelc hey, not yet. will do in a bit. thanks for the reminder! helped to sort out some daedalus issues yesterday...

@gitmachtl
Copy link
Contributor

@smelc this is looking pretty good!

cli query and output of non null-delegations

${cardanocli} conway query spo-stake-distribution --all-spos | jq -r "[.[] | select(.[2] != null)] | sort_by(.[0])"
[
  [
    "1b7a61ba3e5292f34666af3bb2f0b8d36e5001aa41e235709ffa6910",
    10407851494044,
    "drep-alwaysNoConfidence"
  ],
  [
    "3531737ad43673ec059ff03249c3b8d4cfe29fa764d7fd96cc731805",
    97467769,
    "drep-keyHash-f8bfba212e8bc2e516312121bbd6d95e6f6a330f0b67a95a75758dcc"
  ],
  [
    "395933c7b6ca33d1f4a2b22472a6321bc050b166f3f89bb4195f68d5",
    47288144,
    "drep-alwaysAbstain"
  ],
  [
    "3d7418d55574750082424c2d725207ae6f9be4b4987f0b7c5621215c",
    10113763361201,
    "drep-keyHash-9e43f6190761a51a89e6b1d15933725f47dd16e1d48236b564e7fbeb"
  ],
  [
    "3db9daeed3a410cdf1abb08c1647fc36e3f6431f04a0825ae6902799",
    11402067383163,
    "drep-keyHash-91af2885c7b266848e4a3f34b0b1ab37ec2d5341647eaf149c0f1850"
  ],
  [
    "eae7268bbae047d838d95de2d635681df9eb1f122a4798779f3e8918",
    10388199558759,
    "drep-keyHash-29d399a2ad2f08d4de8b43e15ff5ccc9115af259ae23b84f487ec1c9"
  ],
  [
    "f08b6d872f3caa1b4e65cd1e74d51e6ac000e7303ac18c92d0fca1c1",
    97469265,
    "drep-alwaysNoConfidence"
  ],
  [
    "f5fddd5469f8bbedb726227df2c6feaeaaeaf79aa597a1fb7f971af4",
    10487629590393,
    "drep-keyHash-ff72c7e189bc85b3ac3928fea9248ae1f64feb8bdbc9269b1019dd27"
  ]
]

same via the koios query returns:

[
  [
    "1b7a61ba3e5292f34666af3bb2f0b8d36e5001aa41e235709ffa6910",
    10407851494044,
    "drep-alwaysNoConfidence"
  ],
  [
    "3531737ad43673ec059ff03249c3b8d4cfe29fa764d7fd96cc731805",
    97467769,
    "drep1ytutlw3p969u9egkxysjrw7km90x763npu9k0226w46cmnq6pkh99"
  ],
  [
    "395933c7b6ca33d1f4a2b22472a6321bc050b166f3f89bb4195f68d5",
    47288144,
    "drep-alwaysAbstain"
  ],
  [
    "3d7418d55574750082424c2d725207ae6f9be4b4987f0b7c5621215c",
    10113763361201,
    "drep1y20y8aseqas62x5fu6cazkfnwf050hgku82gyd44vnnlh6cvc33a9"
  ],
  [
    "3db9daeed3a410cdf1abb08c1647fc36e3f6431f04a0825ae6902799",
    11402067383163,
    "drep1y2g672y9c7exdpywfglnfv934vm7ct2ng9j8atc5ns83s5q88fcpn"
  ],
  [
    "eae7268bbae047d838d95de2d635681df9eb1f122a4798779f3e8918",
    10388199558759,
    "drep1yg5a8xdz45hs34x73dp7zhl4eny3zkhjtxhz8wz0fplvrjgxq08h5"
  ],
  [
    "f08b6d872f3caa1b4e65cd1e74d51e6ac000e7303ac18c92d0fca1c1",
    97469265,
    "drep-alwaysNoConfidence"
  ],
  [
    "f5fddd5469f8bbedb726227df2c6feaeaaeaf79aa597a1fb7f971af4",
    10487629590393,
    "drep1ytlh93lp3x7gtvav8y50a2fy3tslvnlt30dujf5mzqva6fcalc5ps"
  ]
]

I compared them and they are identical, just koios returns the CIP129 drep format. But its the same Hash and same lovelaces. This is looking ok!

I also checked about DRep-Script delegations on Mainnet, currently two pools have there rewards account delegated to a DRep-Script:

./cardano-cli conway query spo-stake-distribution --all-spos | jq -r '[.[] | select((.[2] // "") | contains("script"))] | sort_by(.[0])'
[
  [
    "07ac7dee6c82177096b70ccf21cfb8965c1fb08e079f9ca4af4b2b3e",
    20799126055136,
    "drep-scriptHash-eb8a7cf53e349af978e81c64ceefcea659a05559b83c384cf938e0ca"
  ],
  [
    "28e52e9155c89591201620193eeb8ec53832fd753950e60d9e666993",
    1419983575643,
    "drep-scriptHash-89c36b1d78bb70ad750ecc33331a6ba73a52159bb76b1d1f162813eb"
  ]
]

I checked both pools via adastat.net and the delegation is correct too. 🎉

Thats awesome 😄

@smelc smelc force-pushed the smelc/hoops-augment-spo-stake-distribution branch from 53f48d5 to 41641c7 Compare December 12, 2024 13:49
@smelc smelc added the next-update Needs a dependency to be updated to be merged label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-update Needs a dependency to be updated to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] - Update cardano-cli conway query spo-stake-distribution
2 participants