-
Notifications
You must be signed in to change notification settings - Fork 461
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
FixTotalDifficulty db migration #5439
FixTotalDifficulty db migration #5439
Conversation
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.
I think if it is really needed we should write the FixTd process with block numbers (from and to) as an argument (check FixBlooms etc.) but not sure if it is the root cause of the problem
This reverts commit 312a3e1.
And update about this PR ? Will this PR be merged ? |
@abcfy2 Most probably will be merged next week. After that we can make custom docker image for you. Or you can wait until next release |
Thanks. But I use Ubuntu ppa for deployment. So I have to wait for next release. Thanks all the same. |
private void RunMigration(long startingBlock, long? lastBlock, CancellationToken cancellationToken) | ||
{ | ||
IChainLevelInfoRepository chainLevelInfoRepository = _api.ChainLevelInfoRepository ?? throw new ArgumentNullException(nameof(_api.ChainLevelInfoRepository)); | ||
IBlockTree blockTree = _api.BlockTree ?? throw new ArgumentNullException(nameof(_api.BlockTree)); |
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.
If migration is only using BlockTree and ChainLevelInfoHistory, it could accept these interfaces in constructor and perform argument check earlier.
|
||
UInt256 expectedTd = previousTd + header.Difficulty; | ||
ChainLevelInfo currentLevel = chainLevelInfoRepository.LoadLevel(blockNumber)!; | ||
UInt256 actualTd = currentLevel.BlockInfos[0].TotalDifficulty; |
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.
Just a question - is this possible to have different TD in block info at any other index?
Fixes Closes Resolves #
#5341
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing