Skip to content

[FIX] Block fetcher failing test fix #889

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

Conversation

pslaski
Copy link
Contributor

@pslaski pslaski commented Jan 12, 2021

Description

One of the block fetcher's test (should process checkpoint blocks when checkpoint can fit into waiting headers queue) was failing nondeterministically.

Important Changes Introduced

  • added setting AwaitingBodiesToBeIgnored as a fetching bodies status in case of changing waiting headers queue during bodies fetching (to avoid blacklisting peers which respond to pending block bodies requests)
  • fixed test structure

@dmitry-worker
Copy link
Contributor

The tests are no longer failing 👍
It looks like I don't have enough knowledge to get what's going on and why it is working now.
@kapke, @ntallar if you have some time to take a look - please help us out.

Copy link
Contributor

@lemastero lemastero left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kapke kapke left a comment

Choose a reason for hiding this comment

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

LGTM!

@pslaski
Copy link
Contributor Author

pslaski commented Jan 13, 2021

@dmitry-worker
This test was prepared for the scenario:

  1. ask for the first part of headers -> ask for the next part of headers (result: 20 headers in the waiting headers queue)
  2. ask for bodies for the first part of headers (result: 10 ready blocks and 10 waiting headers)
  3. send checkpoint which can fit into waiting headers queue (result: 10 ready blocks and 6 waiting headers - checkpoint in the end)
  4. ask for bodies for the second part of headers (result: 16 ready blocks)
  5. Pick blocks from fetcher and check if there are valid and if there is a checkpoint

there were 2 problems:

  1. Bad test structure: Between 2) and 3) fetcher is also asking for bodies for the second part of headers (10 headers) which was missing in the test
  2. bodies received from the previous point couldn't pass bodies validation (validation against waiting headers) as checkpoint were changing waiting headers queue in the meantime - that's a reason for adding setting AwaitingBodiesToBeIgnored as a fetching bodies status in case of changing waiting headers queue during bodies fetching

@pslaski pslaski merged commit 19ed816 into develop Jan 13, 2021
@pslaski pslaski deleted the fix-failing-fetcher-test-checkpoint-block-fit-into-waiting-headers branch January 13, 2021 10:44
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