-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ChainSyncClient: No
BlockNo
when tip is genesis
The `Tip` data-type was ```haskell data Tip b = Tip { tipPoint :: !(Point b) , tipBlockNo :: !BlockNo } ``` where `Point` uses `WithOrigin`. This is not correct. When `tipPoint` is `Origin`, then there _is_ no `tipBlockNo` (`genesisBlockNo` is the block number of the first block on the chain). In this commit we change this to ```haskell data Tip b = -- | The tip is genesis TipGenesis -- | The tip is not genesis | Tip !SlotNo !(HeaderHash b) !BlockNo ``` It doesn't, however, make any real changes, providing instead some "legacy" API that pretends that we _do_ always have a `BlockNo`. This primarily affects consensus only, in networking this only appears in examples and tests. We also use this legacy format to avoid changing the binary presentation of `Tip`, so that this PR does _not_ break backwards compatibility.
- Loading branch information
Showing
8 changed files
with
77 additions
and
35 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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