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

Partially fix hive test #4417

Merged
merged 4 commits into from
Aug 23, 2022
Merged

Partially fix hive test #4417

merged 4 commits into from
Aug 23, 2022

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Aug 12, 2022

Changes:

  • Connect invalid block chain ahead of time.
  • Refactored unit test so that all test uses Context.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Comments about testing , should you have some (optional)

  • Can sync goerli to head.
  • Hive test when run locally have no regression.
  • Still running hive test on github action....

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@asdacap asdacap requested a review from MarekM25 August 23, 2022 06:45
@MarekM25
Copy link
Contributor

Which hive tests are partially fixed thanks to this PR?
Do you think we can add some unit tests?

@asdacap
Copy link
Contributor Author

asdacap commented Aug 23, 2022

I think it was one of the GasUsed tests. Don't remember exactly the case.

@asdacap
Copy link
Contributor Author

asdacap commented Aug 23, 2022

Ok, now I remember I think. We don't do any validation in beacon header sync, so no chain is connected here. But during MergeBlockDownloader, a block failed, which mean it stop suggesting at that point, invalid chain is not connected to its descendent as no validation was attempted. Then another NP of it's descendent also fail block validation, but since its not connected, it's last valid block is its not-validated parent block instead of the parent of the first non-valid block.

@MarekM25
Copy link
Contributor

Ok, now I remember I think. We don't do any validation in beacon header sync, so no chain is connected here. But during MergeBlockDownloader, a block failed, which mean it stop suggesting at that point, invalid chain is not connected to its descendent as no validation was attempted. Then another NP of it's descendent also fail block validation, but since its not connected, it's last valid block is its not-validated parent block instead of the parent of the first non-valid block.

Ok, I think I understood issue, but what will happen if we restart client in this case?

@asdacap
Copy link
Contributor Author

asdacap commented Aug 23, 2022

I'm guessing, we will have the same issue.

@MarekM25
Copy link
Contributor

I'm guessing, we will have the same issue.

ok, so this PR will improve our behaviour, but do you have any thoughts what we can do after restart?

@asdacap
Copy link
Contributor Author

asdacap commented Aug 23, 2022

Not at the moment

@MarekM25 MarekM25 merged commit 647637d into master Aug 23, 2022
@MarekM25 MarekM25 deleted the partially-fix-hive-test branch August 23, 2022 13:57
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.

None yet

3 participants