-
Notifications
You must be signed in to change notification settings - Fork 86
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
Empty RunNode #2687
Merged
Merged
Empty RunNode #2687
Conversation
This file contains 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
mrBliss
commented
Oct 15, 2020
ouroboros-consensus-byron-test/src/Ouroboros/Consensus/ByronDual/Node.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/Node/Storage.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-byron-test/src/Ouroboros/Consensus/ByronDual/Node.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-byron/src/Ouroboros/Consensus/Byron/Ledger/Config.hs
Show resolved
Hide resolved
ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/Config.hs
Outdated
Show resolved
Hide resolved
edsko
approved these changes
Oct 15, 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.
Excellent! RunNode
finally empty, and the Denegerate
instance now empty as well -- the HFC takes care of it all :) Awesome :)
Turn it into the `estimateBlockSize` method of `SerialiseNodeToNodeConstraints`. Add `estimateHfcBlockSize` to `SerialiseHFC` so that we can provide a default instance for the HFC which can still be overridden.
Split off the remaining methods from `RunNode` into `NodeInitStorage` in the new `Ouroboros.Consensus.Node.InitStorage` module. Introduce (yet) another config: the `StorageConfig`, used by the methods of `NodeInitStorage`. Reason: we can't project a HFC `TopLevelConfig` to the `TopLevelConfig` from one era because of the partial consensus and ledger configs, but we *can* do that for a `StorageConfig`. This makes it possible to implement `NodeInitStorage` for the HFC. Since we have an `NodeInitStorage` instance for the HFC, we can give one for `RunNode` too instead of having to provide it for each HFC instantiation! Our sin bin is finally empty. End goal achieved 😎
Merge `checkEmpty` and `addBlock` in `addBlockIfEmpty`. This is currently the only use of this API and merging them expresses the intent better. Moreover, this avoids the racy nature of the two (although there will be no race condition in practice).
mrBliss
force-pushed
the
mrBliss/empty-runnode
branch
from
October 15, 2020 08:48
cd88d70
to
ce3b7ba
Compare
bors merge |
Build succeeded: |
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 done in two steps, see the first two commit messages.