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

Fix the canonical chain is deleted #675

Merged
merged 3 commits into from Nov 14, 2019

Conversation

@earlbread
Copy link
Member

earlbread commented Nov 14, 2019

This fixed a bug where the canonical chain would be deleted if block download failed.

@earlbread earlbread added the bug label Nov 14, 2019
@earlbread earlbread requested review from dahlia, longfin, limebell and moreal Nov 14, 2019
@earlbread earlbread self-assigned this Nov 14, 2019
@codecov

This comment has been minimized.

Copy link

codecov bot commented Nov 14, 2019

Codecov Report

Merging #675 into master will increase coverage by 0.01%.
The diff coverage is 96.55%.

@@            Coverage Diff             @@
##           master     #675      +/-   ##
==========================================
+ Coverage   87.33%   87.34%   +0.01%     
==========================================
  Files         218      218              
  Lines       17760    17781      +21     
==========================================
+ Hits        15510    15531      +21     
- Misses       1187     1192       +5     
+ Partials     1063     1058       -5
Impacted Files Coverage Δ
Libplanet.Tests/Net/SwarmTest.cs 98.86% <100%> (+0.01%) ⬆️
Libplanet/Net/Swarm.cs 86.29% <83.33%> (+0.35%) ⬆️
Libplanet/Store/DefaultStore.cs 82.64% <0%> (-1.24%) ⬇️
await BootstrapAsync(swarmA, swarmB.AsPeer);

swarmA.BroadcastBlocks(new[] { block });
await Task.Delay(100);

This comment has been minimized.

Copy link
@dahlia

dahlia Nov 14, 2019

Member

This scenario seems likely to make the test flaky, because swarmA.BroadcastBlocks(new[] { block }) could be faster than we assume… how about watching chainB.TipChanged event instead?

This comment has been minimized.

Copy link
@earlbread

earlbread Nov 14, 2019

Author Member

Unfortunately, we can't use the TipChanged event because block downloading should be failed before block appending is complete.

This comment has been minimized.

Copy link
@dahlia

dahlia Nov 14, 2019

Member

Could we make a new event to test this then?

This comment has been minimized.

Copy link
@earlbread

earlbread Nov 14, 2019

Author Member

I added Swarm<T>. FillBlocksAsyncFailed for this test case.

Libplanet/Net/Swarm.cs Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
Copy link
Contributor

limebell left a comment

LGTM

@earlbread earlbread force-pushed the earlbread:fix-chain-delete branch from bd35912 to 7997905 Nov 14, 2019
earlbread and others added 2 commits Nov 14, 2019
Co-Authored-By: Hong Minhee <hong.minhee@gmail.com>
@earlbread earlbread dismissed stale reviews from limebell, longfin, and dahlia via 0bb5b95 Nov 14, 2019
@earlbread earlbread force-pushed the earlbread:fix-chain-delete branch from 7997905 to 0bb5b95 Nov 14, 2019
@moreal
moreal approved these changes Nov 14, 2019
@earlbread earlbread merged commit ba6e84d into planetarium:master Nov 14, 2019
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 96.55% of diff hit (target 87.33%)
Details
codecov/project 87.34% (+0.01%) compared to d6ddce6
Details
license/cla Contributor License Agreement is signed.
Details
planetarium.libplanet Build #20191114.9 succeeded
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
@earlbread earlbread deleted the earlbread:fix-chain-delete branch Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.