-
Notifications
You must be signed in to change notification settings - Fork 720
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
Updating cardano-ledger #2455
Updating cardano-ledger #2455
Conversation
@@ -247,6 +248,10 @@ instance Crypto.Crypto crypto => ToJSON (Shelley.RewardUpdate crypto) where | |||
, "nonMyopic" .= Shelley.nonMyopic rUpdate | |||
] | |||
|
|||
instance Crypto.Crypto crypto => ToJSON (Shelley.PulsingRewUpdate crypto) where | |||
toJSON (Shelley.Pulsing _ _) = "calculating" |
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.
is this alright?
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.
I think if we're not interested in the intermediate calculation Aeson.Null
would probably be more appropriate.
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.
There is only a ToJSON
instance and no FromJSON
instance. Is this because the output is only intended as debugging output for consumption by 3rd party tools? Or something along those lines?
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.
that's my understanding @DavidEichmann , but @Jimbo4350 would know better.
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.
There is only a
ToJSON
instance and noFromJSON
instance. Is this because the output is only intended as debugging output for consumption by 3rd party tools? Or something along those lines?
yes. almost every SPO is using the JSON output for daily operation, calculations, leaderlogs, etc... or are we talking about another ToJSON here?
0abbdd9
to
9bd83f0
Compare
( ShelleyLedgerEra era ~ ledgerera, | ||
Consensus.ShelleyBasedEra ledgerera | ||
) => | ||
Decoder s (LBS.ByteString -> LedgerState 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.
I am now considering if it would be better to do the cbor-in-cbor encoding in the ledger package itself, so that there could be a FromCBOR instance of LedgerState and thus break less downstream. I'll maybe tackle that on Monday if the others agree.
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.
I've talked with @nc6 about this, and we decided that not having these odd cbor-in-cbor FromCBOR instances is probably best. So now I just need to make sure that node is adapted to handle the Annotator (LedgerState era)
.
* The ledger state now stores an PulsingRewUpdate instead of a RewardUpdate. The PulsingRewUpdate allows us to compute the staking rewards incrementally instead of all at once. This involves a new serialization format for the reward updates. * Annotated decoders are now used for PParams and PParamsDelta (the data structures now store their own serialization). Additionally, the LedgerState also now uses an annotated decoder. The serialization in consensus has been changed to use the cbor-in-cbor encoding for these types (including in the queries). * A bug was fixed in the reward calculation which was introduced in commit 31083fc5cecbe17f3628393072094b130058edd9. * The ledger repo now uses ghc-8.10.4 and cabal-3.4.0.0.
465db5e
to
b6320e0
Compare
I converted this back to draft, since the cbor-in-cbor encoding in the consensus query needs to be reverted. |
As someone who is not directly involved, I would like to add a thought: |
That is correct @gufmar , the nodes can do the calculation at any point in the epoch after the stability window. We have a fix in the ledger code that essentially just computes the rewards for a a small number of pools (probably one given the current number of registered stake pools) at a time. see IntersectMBO/cardano-ledger#2142 We are just trying to handle all the dependencies now. |
Replaced by #2474
|
2474: Updating cardano-ledger r=JaredCorduan a=JaredCorduan I have updated the cardano ledger package to the current master, and ouroboros-network to my last commit in IntersectMBO/ouroboros-network#2984 This replaces #2455, since `jc/update-ledger-to-ba74779256` was an overly-ambitious (and now incorrect) branch name. 😄 * The ledger state now stores an PulsingRewUpdate instead of a RewardUpdate. The PulsingRewUpdate allows us to compute the staking rewards incrementally instead of all at once. This involves a new serialization format for the reward updates. * A bug was fixed in the reward calculation which was introduced in commit 31083fc5cecbe17f3628393072094b130058edd9. (the bug was not a part of any release.) * The MIR certificates now have additional functionality, but such functionality is prohibited until protocol major version 5. Binary compatibility is preserved for the original functionality. The new functionality is the ability to transfer lovelace between the reserves and the treasury. * The ledger repo now uses ghc-8.10.4 and cabal-3.4.0.0. Co-authored-by: Jared Corduan <jaredcorduan@gmail.com>
I have updated the cardano ledger package to the current master, and ouroboros-network to my last commit in IntersectMBO/ouroboros-network#2971.
RewardUpdate. The PulsingRewUpdate allows us to compute the staking
rewards incrementally instead of all at once. This involves a new
serialization format for the reward updates.
data structures now store their own serialization). Additionally, the
LedgerState also now uses an annotated decoder. The serialization in
consensus has been changed to use the cbor-in-cbor encoding for these
types (including in the queries).
commit 31083fc5cecbe17f3628393072094b130058edd9.
Question is it okay that I have removed the
FromCBOR
instances of the protocol parameter updates and the ledger state? I did add the necessary functions to serialize them.