-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add missed headers from headers pool into tracker pool #2316
Add missed headers from headers pool into tracker pool #2316
Conversation
SebastianMarian
commented
Sep 22, 2020
- Implemented a mechanism which adds into tracker pool the needed headers which are not found there but they exist in headers pool
…ders which are not found there but they exist in headers pool
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.
Tested also in import-db mode. Works as expected.
@@ -957,7 +957,7 @@ func (mp *metaProcessor) createAndProcessCrossMiniBlocksDstMe( | |||
} | |||
mp.hdrsForCurrBlock.mutHdrsForBlock.Unlock() | |||
|
|||
mp.requestShardHeadersIfNeeded(hdrsAddedForShard, lastShardHdr) | |||
go mp.requestShardHeadersIfNeeded(hdrsAddedForShard, lastShardHdr) |
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.
no need for go routine - you have under it.
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.
Actually I have added because the call of the new method addHeaderIntoTrackerPool which has been added in underlying method. I will remove go from there
@@ -1611,7 +1611,7 @@ func (sp *shardProcessor) createAndProcessMiniBlocksDstMe( | |||
} | |||
sp.hdrsForCurrBlock.mutHdrsForBlock.Unlock() | |||
|
|||
sp.requestMetaHeadersIfNeeded(hdrsAdded, lastMetaHdr) | |||
go sp.requestMetaHeadersIfNeeded(hdrsAdded, lastMetaHdr) |
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.
no need for go routine
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.
Actually I have added because the call of the new method addHeaderIntoTrackerPool which has been added in underlying method. I will remove go from there
@@ -231,7 +231,7 @@ func (bp *blockProcessor) ComputeLongestChain(shardID uint32, header data.Header | |||
var sortedHeadersHashes [][]byte | |||
|
|||
defer func() { | |||
bp.requestHeadersIfNeeded(header, sortedHeaders, headers) | |||
go bp.requestHeadersIfNeeded(header, sortedHeaders, headers) |
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 there is a go routine in that function - thus there is no need for this. or delete go routine in the underlying funciton
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.
Actually I have added because the call of the new method AddHeaderFromPool which has been added in underlying method. I will remove go from there
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 ok, import-db test in progress....
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.
much better.
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.
initial import-db test passed. Sync time ~7-8h on shard 0
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.
System tests passed.