-
Notifications
You must be signed in to change notification settings - Fork 25
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
Remove cdbFutureBlocks
#1269
Remove cdbFutureBlocks
#1269
Conversation
6a29209
to
d3b359c
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.
Nice! Love the +186/-516 ratio 😁
I didn't Approve yet because of the ongoing discussion on the REVIEW comment, etc.
docs/website/contents/for-developers/HandlingBlocksFromTheFuture.md
Outdated
Show resolved
Hide resolved
docs/website/contents/for-developers/HandlingBlocksFromTheFuture.md
Outdated
Show resolved
Hide resolved
...boros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs
Outdated
Show resolved
Hide resolved
...boros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs
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.
Looks good!
Inspecting rg -i future -t haskell
resulted in the following places that should also be adapted:
-
Line 689 in 16fa875
-- future. Although the chain DB does not adopt future blocks, if the The ChainDB no longer does this; rather, it now has this as a precondition, so what we are doing here is good.
-
Lines 74 to 80 in 16fa875
-- When the system clock moved back, we have to restart the node, -- because the ImmutableDB validation might have to truncate some -- blocks from the future. Note that a full validation is not -- required, as the default validation (most recent epoch) will keep -- on truncating epochs until a block that is not from the future is -- found. , ErrorPolicy $ \(_ :: SystemClockMovedBackException) -> Just shutdownNode This comment is incorrect both with and without this PR; the ImmutableDB does not truncate blocks from the future. (This comment is quite old (IntersectMBO/ouroboros-network@eed741a), I haven't checked whether it might have been correct back then).
Same thing here, the comment has been copy-pasted:
Lines 68 to 74 in 16fa875
-- When the system clock moved back, we have to restart the node, -- because the ImmutableDB validation might have to truncate some -- blocks from the future. Note that a full validation is not -- required, as the default validation (most recent epoch) will keep -- on truncating epochs until a block that is not from the future is -- found. <> mkRethrowPolicy (\_ctx (_ :: SystemClockMovedBackException) -> shutdownNode) -
Line 681 in 16fa875
| InFutureExceedsClockSkew !(RealPoint blk) can be removed (or maybe even the entire
InvalidBlockReason
type)
docs/website/contents/for-developers/HandlingBlocksFromTheFuture.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/ChainDB/StateMachine.hs
Outdated
Show resolved
Hide resolved
...boros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs
Outdated
Show resolved
Hide resolved
...boros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs
Show resolved
Hide resolved
I converted it to a draft till the consensus packages needed for Node 10.0 have been released. |
d8ae619
to
cedff47
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.
LGTM (after (maybe partial) squashing), only two minor comments
docs/website/contents/for-developers/HandlingBlocksFromTheFuture.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/API.hs
Outdated
Show resolved
Hide resolved
After #525, the `cdbFutureBlocks` field became unnecessary, as we now delay headers until they are no longer from the (near) future.
cedff47
to
d7ce177
Compare
... instead of the new tip. Chain selection uses `Query.getTipPoint` instead of `chainSelectionForBlock`.
The precondition states we never add blocks from the future.
The `ChainDB` state machine model does not need to take the block slots into account, as a result this part of the logic has been removed from the model and tests.
we might forge atop a block form the future
... since it was only wrapping up an `ExtValidationError` value.
d7ce177
to
21ab657
Compare
The handling of blocks from the future in the ChainDB was removed in #1269.
After #525, the
cdbFutureBlocks
field became unnecessary, as we now delay headers until they are no longer from the (near) future.Closes #1260