Skip to content
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/network: improve syncing at head #1465

Merged
merged 49 commits into from
Mar 16, 2021
Merged

fix: dot/network: improve syncing at head #1465

merged 49 commits into from
Mar 16, 2021

Conversation

noot
Copy link
Contributor

@noot noot commented Mar 15, 2021

Changes

  • allow syncer to allow block requests of variable size and start value when "near" the head (ie. node head block is less than 128 blocks away from chain head)
  • update blocktree.AddBlock to accept types.Header (since it doesn't need the block body)
  • remove highestBlockHeader from BlockState since it's unused
  • update syncer to allow syncing blocks with number below our head (needed in case of chain forks, small ones are likely near the head)
  • handle BlockData processing failure better by requesting parent block if we have a "failed to get parent hash" error (this seems to happen near the head often)

Tests

go test ./dot/network -short
go test ./dot/sync -short
go test ./lib/blocktree

Issues

@noot noot self-assigned this Mar 15, 2021
@codecov
Copy link

codecov bot commented Mar 15, 2021

Codecov Report

Merging #1465 (605a42e) into development (34befe0) will increase coverage by 0.19%.
The diff coverage is 52.40%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #1465      +/-   ##
===============================================
+ Coverage        57.82%   58.01%   +0.19%     
===============================================
  Files              152      152              
  Lines            15226    15307      +81     
===============================================
+ Hits              8804     8881      +77     
+ Misses            4878     4871       -7     
- Partials          1544     1555      +11     
Flag Coverage Δ
unit-tests 58.01% <52.40%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dot/config.go 34.64% <0.00%> (ø)
dot/core/test_helpers.go 74.03% <0.00%> (ø)
lib/utils/utils.go 24.35% <0.00%> (ø)
dot/state/block.go 47.12% <16.66%> (-0.94%) ⬇️
dot/sync/syncer.go 42.78% <40.47%> (-2.09%) ⬇️
dot/network/sync.go 63.70% <65.03%> (+8.27%) ⬆️
cmd/gossamer/config.go 73.10% <100.00%> (-0.14%) ⬇️
dot/network/test_helpers.go 75.80% <100.00%> (+1.61%) ⬆️
dot/state/storage.go 41.80% <100.00%> (+1.12%) ⬆️
dot/sync/message.go 68.75% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99a50eb...605a42e. Read the comment docs.

@noot noot marked this pull request as ready for review March 16, 2021 01:00
Copy link
Member

@edwardmack edwardmack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, it closes an Epic, that's epic! Also, nice idea moving the logger out of the struct.

@noot noot merged commit 7859393 into development Mar 16, 2021
@noot noot deleted the noot/sync-at-head branch March 16, 2021 22:52
github-actions bot pushed a commit that referenced this pull request Mar 16, 2021
noot: fix: dot/network: improve syncing at head (#1465)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync Kusama Network Interop with Kusama
4 participants