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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw exception with network based on different genesis #746

Conversation

@moreal
Copy link
Contributor

moreal commented Jan 2, 2020

There was no action when Swarm<T> received blocks of other network (chain). It caused that the node entered to wrong network but it couldn't realize. So I made it to throw exception in the case. In addition, IMO it's better to remove the peer from the peers table but I'm not sure it's okay.
Please leave commnets if you have some opinions about that. 馃榿

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 2, 2020

Codecov Report

Merging #746 into master will increase coverage by 0.05%.
The diff coverage is 96.87%.

@@            Coverage Diff             @@
##           master     #746      +/-   ##
==========================================
+ Coverage   86.48%   86.54%   +0.05%     
==========================================
  Files         222      222              
  Lines       19232    19261      +29     
==========================================
+ Hits        16633    16669      +36     
+ Misses       1419     1411       -8     
- Partials     1180     1181       +1
Impacted Files Coverage 螖
Libplanet/Blocks/InvalidGenesisBlockException.cs 71.42% <酶> (酶) 猬嗭笍
Libplanet/Net/Swarm.cs 82.87% <100%> (+0.36%) 猬嗭笍
Libplanet.Tests/Net/SwarmTest.cs 96.1% <96%> (-0.01%) 猬囷笍
Libplanet.Tests/Net/Protocols/TestSwarm.cs 78.59% <0%> (+0.73%) 猬嗭笍
@moreal moreal force-pushed the moreal:make-swarm-notify-different-network-during-fill-block branch from 5037302 to ef0939a Jan 3, 2020
@moreal moreal changed the title [WIP] Throw exception with network based on different genesis. Throw exception with network based on different genesis. Jan 3, 2020
@moreal moreal changed the title Throw exception with network based on different genesis. Throw exception with network based on different genesis Jan 3, 2020
@moreal moreal requested review from longfin and earlbread Jan 3, 2020
@moreal moreal marked this pull request as ready for review Jan 3, 2020
@moreal moreal force-pushed the moreal:make-swarm-notify-different-network-during-fill-block branch from ef0939a to 7b8a50b Jan 3, 2020
Libplanet.Tests/Net/SwarmTest.cs Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
@moreal moreal force-pushed the moreal:make-swarm-notify-different-network-during-fill-block branch from bdebe97 to cc6edb6 Jan 3, 2020
@longfin
longfin approved these changes Jan 3, 2020
@moreal moreal merged commit ced58ed into planetarium:master Jan 3, 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 96.87% of diff hit (target 86.48%)
Details
codecov/project 86.54% (+0.05%) compared to 1aa8eb1
Details
license/cla Contributor License Agreement is signed.
Details
planetarium.libplanet Build #20200103.4 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.