Skip to content

Conversation

@ten15bit
Copy link
Contributor

@ten15bit ten15bit commented Mar 24, 2021

Description

  • a previous refactoring moved the block header work queue to sync state to keep it together with the work queues for block bodies and receipts - this had the unintended side-effect that it also got persisted (which we don't want to happen)
  • there was a bug that happened under certain conditions when downloading the final header skeleton
    • let's say we still need to download skeleton headers for the range 5100 to 5200 and our max batch size is 30 the request that would be made would have been to get 4 headers with a gap of 30 - so we're actually requesting up to 5220 which the peer might not have. In that case it would send us back only 3 headers which would fail our validation (because we expect 4).
    • improved the logging of outstanding requests: it would sometimes say waiting for [0] requests when it was actually waiting for the header skeleton
  • improves the check whether the peer that we're requesting the skeleton headers from has a high enough best block

Proposed Solution

  • moved the header work queue out of sync state again
  • changed the calculation of limit so it would only request 3 headers in the example above, so the header skeleton would contain headers 5100 to 5190. After that a new skeleton would be requested with one batch of size 10.

Testing

@ten15bit ten15bit marked this pull request as ready for review March 26, 2021 13:53
Copy link
Contributor

@AnastasiiaL AnastasiiaL left a comment

Choose a reason for hiding this comment

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

the rest I understand and it makes sense 👍

@ten15bit ten15bit merged commit 9893aa0 into develop Mar 26, 2021
@ten15bit ten15bit deleted the fix/etcm-719 branch March 26, 2021 16:50
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.

4 participants