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
Implement leadership-schedule command for stake pool operators #3464
Implement leadership-schedule command for stake pool operators #3464
Conversation
332b459
to
8ec6f66
Compare
f9d7783
to
6a890e7
Compare
9ebe265
to
4fcf994
Compare
"Failed to successfully decode protocol state" | ||
|
||
-- | Return the slots at which a particular stake pool operator is | ||
-- expected to mint a block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document for which epoch(s) the function will report over.
Also similar functionality in cncli
allows the operator to query for either the current
epoch or the next
epoch which helps them schedule downtime, so it would be nice if we can achieve something similar here.
& hoistMaybe (ShelleyQueryCmdEraConsensusModeMismatch (AnyConsensusMode cMode) anyE) | ||
|
||
let pparamsQuery = QueryInEra eInMode $ QueryInShelleyBasedEra sbe QueryProtocolParameters | ||
serDebugLedgerStateQuery = QueryInEra eInMode . QueryInShelleyBasedEra sbe $ QueryDebugLedgerState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the ser
prefix? Does it mean Shelly ERa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serialised
20d10ff
to
c07e124
Compare
This is the result of my testing:
Wait a few minutes, then in another shell:
Can you tell me where I'm going wrong? |
This is what I get when trying the same on
For this, I queried against the This was the
|
So you need have a stake pool running. I would use |
I need to update the version mismatch error as it currently gives no information. |
…dership schedule for a given stake pool in the current epoch.
b43fbce
to
c799dc3
Compare
@newhoggy you should test CLI with node built from same branch. Ledger state format has changed from 1.30 to here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a functionality perspective, this works great! Tested against a couple pools. Got leadership schedule for last epoch (using --current
before the boundary) and then compared to db-sync slot leader from block table. 💯 from my perspective. So happy to have this done!
bors r+ |
3464: Implement leadership-schedule command for stake pool operators r=Jimbo4350 a=Jimbo4350 Resolves #1027 The `leadership-schedule` command can calculate a given stake pool's leadership schedule in the current epoch Output: ``` > cardano-cli query leadership-schedule \ --testnet-magic 42 \ --genesis example/shelley/genesis.json \ --stake-pool-id pool12t0y7agkqct89pf00eeytkvfjlquv76tjy27duannan9w63ckxv \ --vrf-signing-key-file example/node-pool1/shelley/vrf.skey --current > SlotNo UTC Time ------------------------------------------------------------- 4073 2021-12-29 17:26:54.998001755 UTC 4126 2021-12-29 17:27:00.298001755 UTC 4206 2021-12-29 17:27:08.298001755 UTC 4256 2021-12-29 17:27:13.298001755 UTC 4309 2021-12-29 17:27:18.598001755 UTC 4376 2021-12-29 17:27:25.298001755 UTC 4423 2021-12-29 17:27:29.998001755 UTC 4433 2021-12-29 17:27:30.998001755 UTC ``` Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
c799dc3
to
f4be627
Compare
Canceled. |
bors r+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Build succeeded: |
Resolves #1027
The
leadership-schedule
command can calculate a given stake pool's leadership schedule in the current epochOutput: