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

Change type of Peer.EndPoint to DnsEndPoint #166

Merged
merged 2 commits into from Apr 4, 2019

Conversation

Projects
None yet
3 participants
@longfin
Copy link
Member

commented Apr 1, 2019

This PR changes Peer.EndPoint's type to DnsEndPoint to resolve #165.

In this process, I've found a problem that the node behind the NAT can't connect properly, but I will treat it as a separate issue.

@longfin longfin requested review from dahlia, ipdae and earlbread Apr 1, 2019

@codecov

This comment has been minimized.

Copy link

commented Apr 1, 2019

Codecov Report

Merging #166 into master will decrease coverage by 3.1%.
The diff coverage is 38.46%.

@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
- Coverage   87.04%   83.93%   -3.11%     
==========================================
  Files          71       71              
  Lines        3226     3243      +17     
==========================================
- Hits         2808     2722      -86     
- Misses        418      521     +103
Impacted Files Coverage Δ
Libplanet/Net/Peer.cs 85.18% <100%> (+0.56%) ⬆️
Libplanet/Net/Swarm.cs 81.54% <29.41%> (-5.47%) ⬇️
Libplanet/Net/IceServer.cs 0% <0%> (-100%) ⬇️
Libplanet/Net/IceServerException.cs 0% <0%> (-100%) ⬇️
Libplanet/Net/NetworkStreamProxy.cs 0% <0%> (-80.77%) ⬇️

@longfin longfin dismissed stale reviews from earlbread and dahlia via 452b28c Apr 1, 2019

@longfin longfin force-pushed the longfin:feature/165 branch from afbf585 to 452b28c Apr 1, 2019

@longfin

This comment has been minimized.

Copy link
Member Author

commented Apr 1, 2019

@dahlia @earlbread I've amend the commit to cover Dns.GetHostAddressesAsync() in unittest. PTAL.

@longfin longfin force-pushed the longfin:feature/165 branch from e8cdf71 to e5e5a0b Apr 1, 2019

@longfin

This comment has been minimized.

Copy link
Member Author

commented Apr 1, 2019

I've append another bug fix.

@longfin longfin force-pushed the longfin:feature/165 branch from e5e5a0b to 1029349 Apr 2, 2019

Show resolved Hide resolved CHANGES.md Outdated
Show resolved Hide resolved CHANGES.md Outdated
Show resolved Hide resolved CHANGES.md Outdated
@@ -75,7 +76,7 @@ public partial class Swarm : ICollection<Peer>, IDisposable
public Swarm(
PrivateKey privateKey,
TimeSpan dialTimeout,
IPAddress ipAddress = null,
string host = null,

This comment has been minimized.

Copy link
@dahlia

dahlia Apr 2, 2019

Member

What if an invalid address is passed? Does the constructor throw an exception, or merely Swarm crashes at unspecified moments?

This comment has been minimized.

Copy link
@longfin

longfin Apr 2, 2019

Author Member

Neither. Swarm will advertise the address as its endpoint, and as a result will be isolated from the network.

Do we need to check connectability? (It's probably hard on the constructor, and it's possible in StartAsync()).

This comment has been minimized.

Copy link
@dahlia

dahlia Apr 2, 2019

Member

Although it would good to have basic validations on the given ipAddress, at this point we necessarily need that IMHO.

This comment has been minimized.

Copy link
@longfin

longfin Apr 2, 2019

Author Member

host can be an IP address, but it can also be any host name. so I think it is a bit tricky to check here statically.

Show resolved Hide resolved Libplanet/Net/Swarm.cs Outdated
Show resolved Hide resolved Libplanet/Net/Swarm.cs

@longfin longfin force-pushed the longfin:feature/165 branch from 1029349 to 4bdacac Apr 2, 2019

@longfin longfin self-assigned this Apr 3, 2019

@longfin longfin force-pushed the longfin:feature/165 branch from 4bdacac to 1795383 Apr 4, 2019

@longfin longfin requested review from dahlia and earlbread Apr 4, 2019

@dahlia

dahlia approved these changes Apr 4, 2019

@longfin longfin merged commit 790fcc8 into planetarium:master Apr 4, 2019

3 of 5 checks passed

codecov/patch 38.46% of diff hit (target 87.04%)
Details
codecov/project 83.93% (-3.11%) compared to 8931917
Details
Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
changelog This contains self-describing changelog.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.