Revert "Handle staking info since kaia fork in downloader." #2182
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.
Reverts #2160
Initially, I mis-interpreted the testing results so I merged it. Sorry for the confusion.
During several snap sync tests, it was found that #2160 can't solve the block header verification issue correctly. The block header initially comes to
processHeaders
, which inserts the header into the header chain first. Then, the contents for fetched headers will be scheduled bySchedule
, which includes staking info. So, the staking info needs to be fetched with headers and ready beforeinsertHeaderChain
. But the current implementation fetches staking info afterinsertHeaderChain
, which means it does nothing. (It worked before kaia fork since it required staking info before staking update interval)Additionally, it seems that
randao
also breaks snap sync since it requires state at a block to retrieve the BLS registry. https://github.com/klaytn/klaytn/blob/dev/consensus/istanbul/backend/randao.go#L63To sum up, I concluded it would be better to consider all the cases carefully to fix the snap sync. If you have suggestions, please let me know. Thanks.