-
Notifications
You must be signed in to change notification settings - Fork 156
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
Redo how we manage deposits #3127
Conversation
06cd38d
to
0243f57
Compare
f4f60f8
to
18e42dc
Compare
18e42dc
to
8adbc16
Compare
8adbc16
to
ef3a546
Compare
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 haven't looked through the full PR yet, here are my comments thus far
eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/DPState.hs
Outdated
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/DPState.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs
Outdated
Show resolved
Hide resolved
Went through all the code, added some small remarks and asked (likely stupid) questions mostly for my education . |
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.
Here are some more comments and suggestions
I don't fully grasp the logic in this PR, since I had limited exposure to staking and delegations, however from what I do understand I don't see any real problems.
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/DPState.hs
Outdated
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/DPState.hs
Outdated
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/DPState.hs
Outdated
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/DPState.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/Combinators.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/Combinators.hs
Outdated
Show resolved
Hide resolved
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/AggPropTests.hs
Show resolved
Hide resolved
2ade737
to
0005baa
Compare
b178fd1
to
a66d4d3
Compare
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/AggPropTests.hs
Outdated
Show resolved
Hide resolved
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.
👍
1df22f8
to
616f333
Compare
functions that computed deposits, obligation, and refunds (keyRefunds and totalDeposits, obigation etc) were changed to take DPState as input Added DPState to UtxoEnv replacing pool stake. Incorporated TreeDiff to show differences in two NewEpochState's. Gathered all the TreeDiff stuff into one module Cardano.Ledger.TreeDiff in cardano-binary. This includes all needed orphan instances from external types. Importing this module should supply everything needed, and carry the orphan instances. Added (.->>) as a version of (.->) that uses tree diff in small-steps-test Added property tests that test the new invariants that must hold 1) utxosDepoits == sum (dsDeposited) + sum (psDeposited) 2) dom rewards == dom dsDeposited Added Cardano.Ledger.Shelley.Internal, module to be used when debugging.
616f333
to
4d54672
Compare
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.
Awesome work!!!
This PR explores one mechanism for tracking deposits for each Stake credential and each Pool.
Motivated by #3113
Here is what happened
Added deposits (key deposits) to DState and (pool deposits) PState.
Functions that computed deposits, obligation, and refunds (keyRefunds
and totalDeposits, obigation etc) were changed to take DPState as input
Added DPState to UtxoEnv replacing pool stake. Incorporated TreeDiff
to show differences in two NewEpochState's. Gathered all the TreeDiff
stuff into one module Cardano.Ledger.TreeDiff in cardano-binary. This
includes all needed orphan instances from external types. Importing this module
should supply everything needed, and carry the orphan instances.
Added (.->>) as a version of (.->) that uses tree diff in small-steps-test
Added property tests that test the new invariants that must hold
1) utxosDepoits == sum (dsDeposited) + sum (psDeposited)
2) dom rewards == dom dsDeposited