Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Refactor syncing to use streams #85

Merged
merged 1 commit into from
Dec 30, 2018
Merged

Refactor syncing to use streams #85

merged 1 commit into from
Dec 30, 2018

Conversation

vpulim
Copy link
Contributor

@vpulim vpulim commented Dec 29, 2018

This is a major refactor of the sync components (lib/sync). The reason for the refactor is that there was no support for back-pressure on storing blocks during sync operations. This eventually led to errors when blocks were being downloaded faster than they were being written. This PR replaces the original Fetcher implementation with a new version that uses node Readable/Writable streams which implement back-pressure out of the box. The new stream based Fetcher will queue downloaded blocks and pause until write operations can catch up.

This PR also does a small re-factor of the EthereumService class. Instead of having separate Handlers for handling incoming messages, EthereumService is subclassed into FastEthereumService and LightEthereumService which directly handle incoming messages in a new handle() method.

@coveralls
Copy link

coveralls commented Dec 29, 2018

Coverage Status

Coverage decreased (-1.2%) to 92.731% when pulling e68234c on streams into 8987d88 on master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants