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

Remove upper limit for ChainLevelHelper.GetNextHeader #4373

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Aug 6, 2022

Changes:

  • Remove ChainLevelHelper.GetNextHeader.

Types of changes

  • 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)

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...

@MarekM25
Copy link
Contributor

MarekM25 commented Aug 7, 2022

our unit tests are failing

@asdacap
Copy link
Contributor Author

asdacap commented Aug 8, 2022

Fixed

@MarekM25 MarekM25 self-requested a review August 8, 2022 07:28
@MarekM25 MarekM25 self-requested a review August 8, 2022 07:29
@@ -110,6 +110,13 @@ public class MergeBlockDownloader : BlockDownloader

bool HasMoreToSync(out BlockHeader[]? headers, out int headersToRequest)
{
if (!_beaconPivot.BeaconPivotExists())
Copy link
Contributor

Choose a reason for hiding this comment

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

This condition is wrong. We can have situation when we don't have beacon pivot and we want to sync.

Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about Math.Min(ProcessDestination, BestKnownNumber) >= BestKnownBeaconNumber?

Copy link
Contributor

Choose a reason for hiding this comment

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

Imagine that you have timeout in NewPayloadHandler. For the next payload we insert it without cache and return SYNCING. We don't have beaconPivot in this situation.

@asdacap asdacap force-pushed the remove-chainlevelhelper-upper-limit branch from ec509ed to d361bee Compare August 8, 2022 07:41
@MarekM25 MarekM25 merged commit e6d893d into master Aug 8, 2022
@MarekM25 MarekM25 deleted the remove-chainlevelhelper-upper-limit branch August 8, 2022 09:22
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.

2 participants