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

Make Swarm<T>.RefreshTableAsync config constants configurable and change structure of PeerState #1215

Merged
merged 6 commits into from
Mar 26, 2021

Conversation

limebell
Copy link
Member

This PR contains two changes:

  • Added SwarmOptions.RefreshPeriod and SwarmOptions.RefreshLifespan which configures refresh of routing table. It have 10 seconds and 60 seconds as its default value.
  • Removed PeerState.Address, added PeerState.Peer instead which has more information.

This contains one backward incompatible change and one behavioral change, please feel free two tell me if it will be better to separate two patches into two pull requests.

@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #1215 (817f22a) into main (f10e176) will increase coverage by 0.11%.
The diff coverage is 86.84%.

❗ Current head 817f22a differs from pull request most recent head 7152bf6. Consider uploading reports for the commit 7152bf6 to get more accurate results

@@            Coverage Diff             @@
##             main    #1215      +/-   ##
==========================================
+ Coverage   86.01%   86.12%   +0.11%     
==========================================
  Files         361      361              
  Lines       32463    32492      +29     
==========================================
+ Hits        27922    27984      +62     
+ Misses       2757     2723      -34     
- Partials     1784     1785       +1     
Impacted Files Coverage Δ
Libplanet/Net/NetMQTransport.cs 78.62% <ø> (+1.17%) ⬆️
Libplanet/Net/Protocols/KademliaProtocol.cs 66.85% <0.00%> (+0.38%) ⬆️
Libplanet/Net/Swarm.cs 82.41% <78.57%> (+0.58%) ⬆️
Libplanet.Tests/Net/Protocols/TestTransport.cs 74.92% <100.00%> (ø)
Libplanet.Tests/Net/SwarmTest.cs 94.65% <100.00%> (+0.07%) ⬆️
Libplanet/Net/PeerState.cs 100.00% <100.00%> (+8.33%) ⬆️
Libplanet/Net/SwarmOptions.cs 100.00% <100.00%> (ø)
Libplanet/Net/Protocols/RoutingTable.cs 90.84% <0.00%> (+0.70%) ⬆️
... and 5 more

CHANGES.md Outdated Show resolved Hide resolved
longfin
longfin previously approved these changes Mar 17, 2021
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
Libplanet/Net/Swarm.cs Outdated Show resolved Hide resolved
@limebell limebell force-pushed the feature/configurable-constants branch from 9a41cac to e9c7a4b Compare March 19, 2021 04:29
dahlia
dahlia previously approved these changes Mar 22, 2021
CHANGES.md Outdated Show resolved Hide resolved
Libplanet/Net/Swarm.cs Outdated Show resolved Hide resolved
@limebell
Copy link
Member Author

Since ITransport hasn't released yet, I skipped changelog for ITransport.Running.

Libplanet/Net/ITransport.cs Outdated Show resolved Hide resolved
dahlia
dahlia previously approved these changes Mar 23, 2021
riemannulus
riemannulus previously approved these changes Mar 23, 2021
@limebell limebell merged commit 68fc0ba into planetarium:main Mar 26, 2021
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.

5 participants