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

les: duplicate downloader and fetcher to allow progressive refactoring #23561

Merged
merged 1 commit into from Sep 10, 2021

Conversation

karalabe
Copy link
Member

This PR duplicates (copy pasta) the eth/downloader and eth/fetcher packages under les and rewires the light client to use these instead. The reason is that we're working on overhauling eth to use eth/66 style request IDs. This permits us to switch from the current async packet handling (where replies descend from higher layers to lower layers) to a blocking API (where the response teleports to the request callsite directly), which makes everything a lot more correct and a lot cleaner.

The hard part of the refactor is that currently the reply packets propagate through a lot of layers, each potentially interacting with them. Changing the req/rep APIs to blocking ones inherently changes the internal behavior of these components and also their external APIs. It's hard enough to keep eth in one piece while this is done, but having to constantly keep les in the picture too and ensure it does not break is just pointless juggling.

After the update to the eth packages is done, we'll be able to see what the final shape of things are and we can decide to deduplicate these common components or potentially roll simplified ones for LES (which might make a lot of sense given that LES does not use 90% of the code it imports).

Copy link
Contributor

@zsfelfoldi zsfelfoldi 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

@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

@karalabe karalabe added this to the 1.10.9 milestone Sep 10, 2021
@karalabe karalabe merged commit 9ada4a2 into ethereum:master Sep 10, 2021
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