-
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
genesis/origin does not have a slot number #774
Conversation
@mrBliss I've just pushed a commit that makes ouroboros-consensus build and tests pass, but I may have done some dodgy things so please review and change. |
4b5edf7
to
0eeb798
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.
Great!
Can you do the same thing for BlockNo
? Because we need BlockNo 0
for the genesis EBB, so the empty chain should have no BlockNo
at all (i.e., Origin
).
@@ -385,7 +385,7 @@ instance (ByronGiven, Typeable cfg, ConfigContainsGenesis cfg) | |||
lvUB = SlotNo $ unSlotNo currentSlot + (2 * paramK) | |||
lvLB | |||
| 2 * paramK > unSlotNo currentSlot | |||
= genesisSlotNo | |||
= SlotNo 0 |
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.
@nc6 Is this correct?
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.
Since the lower bound is non-strict, it should be fine.
Giving |
With genesis block, you mean the very first EBB (and thus "thing" on the chain), right? (I call it the genesis EBB) An argument for |
This patches ouroboros-network to build and pass tests. ouroboros-consensus will be patched in a follow-up.
Follow-up to pointSlot type change in ouroboros-network, to make ouroboros-consensus build and tests pass. Must be reviewed by someone more familiar with ouroboros-consensus. I've probably made some changes that aren't right.
04cc32f
to
03aaf57
Compare
The genesis point is never on a fragment
@mrBliss I agree that the empty chain should have no chainLength :: HasHeader block => Chain block -> Word64
chainLength = maybe 0 (succ . unBlockNo) . headBlockNo which corresponds to the actual chain length, for valid chains. I went ahead and tried to do this but there is too much affected, including the |
I had done this before. Somehow it was lost in a merge/rebase.
pointOnChain p@(BlockPoint pslot phash) (c :> b) | ||
| pslot > blockSlot b = False | ||
| pslot == blockSlot b = phash == blockHash b | ||
| otherwise = pointOnChain p c |
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.
Can you align this last case on =
to appease my OCD 🙂
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.
Oops. Will do
I'll give it a try. |
@@ -144,11 +144,8 @@ pattern BlockPoint { atSlot, withHash } = Point (At (Point.Block atSlot withHash | |||
{-# COMPLETE GenesisPoint, BlockPoint #-} | |||
|
|||
-- Should be |
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 line should also be removed.
I have a branch for this: https://github.com/input-output-hk/ouroboros-network/tree/mrBliss/point_blockno The main advantage of And quoting Duncan:
|
bors r+ |
774: genesis/origin does not have a slot number r=avieth a=avieth `pointSlot` now has type `Point block ->WithOrigin SlotNo`. There is no slot for the origin/genesis point. Co-authored-by: Alexander Vieth <[email protected]>
pointSlot
now has typePoint block ->WithOrigin SlotNo
. There is no slot for the origin/genesis point.