-
Notifications
You must be signed in to change notification settings - Fork 87
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
No pipelining of blocks from the future #4310
No pipelining of blocks from the future #4310
Conversation
845fdd9
to
b06b8f8
Compare
b06b8f8
to
a81b00e
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.
Would you mark this PR as Draft? I didn't anticipate that I could do it. I did it.
checkInFuture :: ValidatedFragment (Header blk) (LedgerState blk) | ||
-- > checkInFuture _ af >>= \(af', fut) -> | ||
-- > af == af' <=> null fut | ||
checkInFuture :: LedgerState blk -> AnchoredFragment (Header blk) |
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.
Please add a comment explaining the assumptions about the given ledger state and the given fragment.
(hardForkSummary cfg (VF.validatedLedger validated)) | ||
now | ||
(VF.validatedFragment validated) | ||
checkInFuture = \ledgerState af -> do |
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 checkFragment
has an error
case in it, please add a comment here explaining how the assumptions made by checkInFuture
guard this call to checkFragment
.
-- Remove future blocks from the chain, and update the ChainDB state | ||
-- that keeps track of those blocks, so we can take them into account | ||
-- in the decision to make blocks available for pipelining. | ||
candidate' <- futureCheckCandidate chainSelEnv candidate |
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.
Hmm. Unless you've figure out a more thorough argument, my understanding was that we would leave the existing future check as-is, and merely add a check to only enable pipelining when the translation is available and isn't in the future. At the moment, this diff seems to me to be removing/changing the existing future check instead of leaving it as-is.
-- > checkInFuture vf >>= \(af, fut) -> | ||
-- > validatedFragment vf == af <=> null fut | ||
checkInFuture :: ValidatedFragment (Header blk) (LedgerState blk) | ||
-- > checkInFuture _ af >>= \(af', fut) -> |
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.
Perhaps we could use this opportunity to add more comments to this function (especially the return type).
@bartfrenk This commit sketches what I think is the minimal possible change: 1bc9135 Does it look sound to you? cc @amesgen |
Closing in favor of #4334. |
Description
Updates chain selection to first check for blocks from the future before setting the tentative header. This avoids pipelining blocks from the future.
Checklist