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

Throw exception with network based on different genesis #746

Conversation

moreal
Copy link
Contributor

@moreal 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
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 make-swarm-notify-different-network-during-fill-block branch from 5037302 to ef0939a Compare January 3, 2020 04:34
@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 January 3, 2020 04:56
@moreal moreal marked this pull request as ready for review January 3, 2020 04:56
@moreal moreal force-pushed the make-swarm-notify-different-network-during-fill-block branch from ef0939a to 7b8a50b Compare January 3, 2020 04:58
@moreal moreal force-pushed the make-swarm-notify-different-network-during-fill-block branch from bdebe97 to cc6edb6 Compare January 3, 2020 05:48
@moreal moreal merged commit ced58ed into planetarium:master Jan 3, 2020
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.

3 participants