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

eth: fix snap sync cancellation #22334

Merged
merged 1 commit into from
Feb 16, 2021
Merged

Conversation

karalabe
Copy link
Member

#22179 introduced a slight regression when defining a new errCancelled error for snap sync. Whilst differentiating success from cancellation might be necessary, the downloader specifically handled state cancellations, which the new cancellation type broke. This PR just ensures that the downloader reacts the same way to snap and fast sync terminations.

@karalabe karalabe added this to the 1.10.0 milestone Feb 16, 2021
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM, although a slightly nicer approach may have been to define one ErrCancel. and let others just wrap it using fmt.Errorf("fast-sync %w", ErrCancel) ?

@karalabe
Copy link
Member Author

Unfortunately snap can't reference the downloader as that would be a dep loop. I think this is fine, we can drop fast sync after snap, so one cancellation will get deleted and imho the other is not needed, but don't want to touch it now.

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