-
Notifications
You must be signed in to change notification settings - Fork 89
Make imm DB epoch independent version 3.0 #1750
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72ba76c
to
6d79a46
Compare
I'm not adding a migration to rename the chunk files; see #1755. |
Unlike the immutable DB, Praos actually does care about epoch boundaries (this is why the Shelley spec takes an EpochInfo as argument). So we will leave this as EpochInfo, but use the one from cardano-slotting.
And just use the one from cardano-slotting (soon we'll not use it at all anymore).
This commit doesn't change the semantics of the code, merely updates it to account for the fact that the ChunkInfo API is no longer monadic.
This is just a simple renaming. In the next commit we'll start making more significant changes.
The only consequence (so far) of this is that `maxRelativeSlot` must now have access to the internals.
`Enum` still implies a translation from and to `Int`. All we need is a successor function.
This doesn't (yet) _change_ these definitions, merely moves them.
This replaces `epochInfoRelative`.
And provide some related infrastructure.
This reintroduces `EpochInfo` for the analysis (which really do care about EpochInfo rather than `ChunkInfo`).
Only `.Cache` and `.Primary` use the raw definition from `.Internal`.
This at least allows us to find such use cases more easily.
This is a huge commit, that replaces `EpochNo` with `ChunkNo` _almost_, but crucially not _quite_, everywhere. Where they remain they are invariably related to EBB (the `EpochNo` of an EBB). During review we should make sure that these use cases are correct. Tested this separately (`test-storage`), and it passes 11,100 tests.
This adds a bunch of invariants, and forces us to be more precise with `RelativeSlot`. It also strengthens the `PrimaryIndex` tests, equips them with a more general generator, as well as a basic shrinker. Passes 100,000 `PrimaryIndex` tests and 10,000 Immutable DB QSM tests.
Again passed 1M `PrimaryIndex` tests and 10k immutable DB QSM tests.
In particular, `EpochNo` and `EpochSize` should not be exported from `Common` as most of the core consensus infrastructure now is entirely agnostic about epochs.
This adds the plumbing to provide `ChunkInfo` where needed, but the generator still uses an epoch size of 10; just testing the plumbing so far. Passes 10k tests.
Still passes 10k tests. (We do get test failures if we allow the generator to pick `0` for `numRegularBlocks`.)
This is a reasonably large commit, but most of it is propagation of HasCallStack for better test failures. Really only needed to make two changs: * Update the ChainDB and immutable DB generators not to produce EBBs * Fix one bug in `slotMightBeEBB` Both the chain DB and immutable DB passed 10k tests.
This commit doesn't change anything semantically, just renames things that were still called "epoch" but should by rights be called "chunk".
4c46b15
to
d174105
Compare
mrBliss
approved these changes
Mar 6, 2020
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.
Monster PR! LGTM
bors r+ |
This was referenced Mar 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is my third attempt at doing this, but it's now almost done. Only things left to do:
ChunkSize
that doesn't support EBBsepoch
that should be renamed tochunk
.