-
Notifications
You must be signed in to change notification settings - Fork 172
Improve snapshot creation performance #5516
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
Conversation
8698376 to
7fb6177
Compare
7fb6177 to
a4fd4ae
Compare
libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/AggPropTests.hs
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/PulsingReward.hs
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/PulsingReward.hs
Show resolved
Hide resolved
There was some duplicate computation as well as redundant retention of unnecessary data in the `SnapShots`. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach. See my comments on #5516 for more details on individual optimizations.
a4fd4ae to
2f2aace
Compare
There was some duplicate computation as well as redundant retention of unnecessary data in the `SnapShots`. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach. See my comments on #5516 for more details on individual optimizations.
2f2aace to
cf6e7f1
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 reviewed mostly the new computations from core, would like to look closer at the rules changes, but I need a break, will do it tomorrow!
libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Sharing.hs
Outdated
Show resolved
Hide resolved
There was some duplicate computation as well as redundant retention of unnecessary data in the `SnapShots`. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach. See my comments on #5516 for more details on individual optimizations.
cf6e7f1 to
d41fa15
Compare
There was some duplicate computation as well as redundant retention of unnecessary data in the `SnapShots`. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach. See my comments on #5516 for more details on individual optimizations.
d41fa15 to
a206f95
Compare
teodanciu
left a comment
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.
Looks good to me.
Rewards and snapshots are such unknown territories, but thanks to this PR I started to understand they work.
The calculations using the new structure seem equivalent to the old ones to me, and how awesome that we're now avoiding redundant computations!
libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/API.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/PoolReReg.hs
Outdated
Show resolved
Hide resolved
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/PulsingReward.hs
Show resolved
Hide resolved
There was some duplicate computation as well as redundant retention of unnecessary data in the `SnapShots`. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach. See my comments on #5516 for more details on individual optimizations.
a206f95 to
dad6b50
Compare
dad6b50 to
513ef70
Compare
There was some duplicate computation as well as redundant retention of unnecessary data in the `SnapShots`. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach. See my comments on #5516 for more details on individual optimizations.
513ef70 to
e8212f4
Compare
Because it conflcicts with our internal type.
There was some duplicate computation as well as redundant retention of unnecessary data in the `SnapShots`. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach. See my comments on #5516 for more details on individual optimizations.
e8212f4 to
e612ea2
Compare
e612ea2 to
22b039e
Compare
Description
There was some duplicate computation as well as redundant retention of unnecessary data in the
SnapShots. This commit introdcues a better approach that eliminates the need for the above overhead, while temporarely keeping the old appraoch with some assertions that will be further used to confirm accuracy on mainnet data. Keeping old approach should not incur any overhead, since it was made lazy and is only forced during testing with assertions. The plan is to remove this old approach before the next release, however there is no danger to go to production with these follow up changes, due to lazy evaluation of an old approach.See my comments for more details on individual optimizations
Checklist
CHANGELOG.mdfiles updated for packages with externally visible changes.NOTE: New section is never added with the code changes. (See RELEASING.md).
.cabalandCHANGELOG.mdfiles when necessary, according to theversioning process.
.cabalfiles updated when necessary.NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
scripts/fourmolize.sh).scripts/cabal-format.sh).scripts/gen-cddl.sh)hie.yamlupdated (usescripts/gen-hie.sh).