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

Preload blocks from multiple peers at a time #707

Merged
merged 14 commits into from Feb 4, 2020

Conversation

@dahlia
Copy link
Member

dahlia commented Dec 4, 2019

This patch makes IDL parallel by requesting chunks of blocks to multiple peers. As complexity of IDL logic grows up, I added a separated class named BlockCompletion<T> which has only a pure logic of dealing with block demands and completion without actual I/Os, and made Swarm<T>.PreloadAsync() method to use it.

@dahlia dahlia force-pushed the dahlia:block-completion branch 2 times, most recently from bd6ec9c to 6210fe2 Dec 6, 2019
@dahlia dahlia marked this pull request as ready for review Dec 6, 2019
@dahlia dahlia requested review from longfin, moreal, limebell and earlbread Dec 6, 2019
@dahlia dahlia self-assigned this Dec 6, 2019
@longfin

This comment has been minimized.

Copy link
Member

longfin commented Dec 9, 2019

It seems builds fail. 😢

Libplanet.Tests/Net/BlockCompletionTest.cs Outdated Show resolved Hide resolved
Libplanet/Net/Messages/Message.cs Outdated Show resolved Hide resolved
Libplanet/Net/Swarm.cs Outdated Show resolved Hide resolved
@stale

This comment has been minimized.

Copy link

stale bot commented Dec 26, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 26, 2019
@dahlia dahlia removed the stale label Dec 26, 2019
@dahlia dahlia force-pushed the dahlia:block-completion branch 5 times, most recently from 3fd4ded to 37cd5f1 Dec 27, 2019
@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 2, 2020

Codecov Report

Merging #707 into master will increase coverage by 0.21%.
The diff coverage is 91.97%.

@@            Coverage Diff             @@
##           master     #707      +/-   ##
==========================================
+ Coverage   86.43%   86.65%   +0.21%     
==========================================
  Files         226      231       +5     
  Lines       19496    20444     +948     
==========================================
+ Hits        16852    17716     +864     
- Misses       1432     1502      +70     
- Partials     1212     1226      +14
Impacted Files Coverage Δ
Libplanet/Net/Messages/Message.cs 85.71% <ø> (ø) ⬆️
Libplanet.Tests/Blockchain/BlockChainTest.cs 98.74% <100%> (ø) ⬆️
Libplanet.Tests/Net/SwarmTest.cs 96.41% <100%> (-0.02%) ⬇️
Libplanet/Net/BlockDownloadState.cs 100% <100%> (ø) ⬆️
Libplanet.Tests/Blockchain/BlockLocatorTest.cs 100% <100%> (ø)
Libplanet/Net/StateDownloadState.cs 100% <100%> (ø) ⬆️
Libplanet/Net/BlockHashDownloadState.cs 100% <100%> (ø)
Libplanet/Blockchain/BlockChain.cs 90.3% <70.58%> (-0.35%) ⬇️
Libplanet/Net/BlockCompletion.cs 84.06% <84.06%> (ø)
Libplanet/Net/Swarm.cs 85.21% <90.86%> (+1.07%) ⬆️
... and 12 more
@dahlia dahlia force-pushed the dahlia:block-completion branch 7 times, most recently from 0598b60 to bbff23c Jan 2, 2020
@dahlia dahlia force-pushed the dahlia:block-completion branch from bbff23c to eabc62b Jan 16, 2020
@longfin longfin self-assigned this Jan 17, 2020
@dahlia dahlia dismissed stale reviews from limebell, moreal, and earlbread via b312195 Feb 4, 2020
@dahlia dahlia force-pushed the dahlia:block-completion branch from 7345445 to b312195 Feb 4, 2020
@dahlia dahlia requested review from limebell, moreal and earlbread and removed request for longfin Feb 4, 2020
@dahlia

This comment has been minimized.

Copy link
Member Author

dahlia commented Feb 4, 2020

@planetarium/libplanet Rebased this on the current master. Please review this again! FYI only changelogs had been changed since then.

@moreal
moreal approved these changes Feb 4, 2020
@dahlia dahlia merged commit 299f2fc into planetarium:master Feb 4, 2020
20 checks passed
20 checks passed
benchmarks (macos-latest)
Details
dist
Details
benchmarks (ubuntu-18.04)
Details
benchmarks (windows-latest)
Details
docs
Details
WIP Ready for review
Details
changelog This contains self-describing changelog.
Details
codecov/patch 91.97% of diff hit (target 86.43%)
Details
codecov/project 86.65% (+0.21%) compared to ddc95e0
Details
license/cla Contributor License Agreement is signed.
Details
planetarium.libplanet Build #20200204.11 had test failures
Details
planetarium.libplanet (Linux_Mono) Linux_Mono succeeded
Details
planetarium.libplanet (Linux_NETCore) Linux_NETCore succeeded
Details
planetarium.libplanet (Windows_Mono) Windows_Mono succeeded
Details
planetarium.libplanet (Windows_NETCore) Windows_NETCore succeeded
Details
planetarium.libplanet (Windows_NETCore_coverage) Windows_NETCore_coverage succeeded
Details
planetarium.libplanet (Windows_NETFramework) Windows_NETFramework succeeded
Details
planetarium.libplanet (macOS_Mono) macOS_Mono succeeded
Details
planetarium.libplanet (macOS_NETCore) macOS_NETCore succeeded
Details
planetarium.libplanet (macOS_Unity) macOS_Unity succeeded
Details
@limebell limebell mentioned this pull request Feb 4, 2020
2 of 2 tasks complete
limebell added a commit to limebell/libplanet that referenced this pull request Feb 11, 2020
limebell added a commit that referenced this pull request Feb 11, 2020
Revert "Preload blocks from multiple peers at a time" (#707)
dahlia added a commit to dahlia/libplanet that referenced this pull request Feb 11, 2020
dahlia added a commit to dahlia/libplanet that referenced this pull request Feb 14, 2020
libplanet pushed a commit to dahlia/libplanet that referenced this pull request Feb 22, 2020
dahlia added a commit to dahlia/libplanet that referenced this pull request Feb 24, 2020
dahlia added a commit that referenced this pull request Feb 24, 2020
Restore BlockCompletion<T> (#707) and more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.