-
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
optimize TICKF #3209
optimize TICKF #3209
Conversation
ec56a75
to
3f93e3e
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 understand this a tad-bit better after reviewing this PR. Thank you! 🙌
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/RulesTests.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.
This makes sense. Just a few minor suggestions
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/RulesTests.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/RulesTests.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/RulesTests.hs
Outdated
Show resolved
Hide resolved
eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/RulesTests.hs
Outdated
Show resolved
Hide resolved
7d4660d
to
7e6c081
Compare
Calculating the stake pool distribution in the NEWEPOCH rule is problematic due to its role in the consensus layer. When a node checks to see if it is the leader for a slot crossing the epoch boundary, the node re-computes the distribution every second, and the calculation takes over a second. As a stop gap measure, we memoize the computation by creating a thunk for it at the moment when all the data is available, which happens to be an entire epoch before it is needed. In particular, we create the thunk inside the `SnapShots` record in the SNAP rule.
TICKF now only includes the logic needed to compute the same LedgerView as TICK.
7e6c081
to
69bbb7a
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 stuff! 👍
Description
This PR optimizes the
TICKF
transition, particularly for the problematically slow computations on the epoch boundary. See the ADR in this PR for more context. See also #3034.This PR consists of four commits: one for each of the two optimizations mentioned in the ADR, one for the ADR, and one to fix a broken link in the PR template.
I did not update the changelog since all the changes are invisible outside of this code base.
replaces #3140 and #3141
Checklist
scripts/ormolise.sh