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.
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
fix(dot/state/epoch, lib/babe): enable block production through epochs without rely on finalization #2593
fix(dot/state/epoch, lib/babe): enable block production through epochs without rely on finalization #2593
Changes from 9 commits
3fc7d75
960dd15
ed5b41b
bbf4b15
6e87289
46bde58
697abcc
719a724
246e442
2ea979c
4f0f701
2a637d4
5eac5bb
5e57512
07a1d9c
1f3e18d
cf0d28d
f196dbb
9b69ffb
257c2bb
612a293
89d544e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
what do you mean the header is not fully imported? a block can only be imported or not imported afaik
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.
The problem I notice is that at the block where we should change to the next epoch, I got the error
blocktree.ErrEndNodeNotFound
on functionchainProcessor.processBlockData
.This method (
processBlockData
) calls the methodhandleHeader
which calls thebabeVerifier.VerifyBlock(header)
, and the variableheader
contains the header value of the first block in the next epoch. TheVerifyBlock
method (lib/babe/verify.go
) calls the methodgetVerifierInfo
which calls theepochState.GetEpochData
using the variablesheader
andepoch
.The
epochState.GetEpochData
did not find anything in the database for epoch 1 so we look up in the memory map using theheader
and that is when the problem happens, the block state is not aware of theheader
(first block in the next epoch) and return:end node does not exist
.The fully error is:
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.
that makes sense, this seems like a decent fix, but maybe we should just pass the parent hash into this function instead, since the parent would always be imported already (i think). what do you think?
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.
@noot yeah, it can work but we should use the parent header only if we got a problem with the current header, passing the parent header directly can cause the same problem leading us to use the parent of the parent. So keeping this implementation we can handle cases where the block is not in the block tree but some ancestor is and retrieves the right config/epoch data.