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

Improve branch point finding #277

Merged
merged 5 commits into from Jun 11, 2019

Conversation

Projects
None yet
3 participants
@longfin
Copy link
Member

commented Jun 8, 2019

This PR improves performance of BlockChain<T>.Blocks.Contains(), BlockChain<T>.FindBranchPoint() and BlockChain<T>.FindNextHashes() to reduce response time for block hashes query.

@longfin longfin force-pushed the longfin:feature/improve-next-hashes branch from f79adb0 to 1c9dec1 Jun 8, 2019

@longfin longfin changed the title Feature/improve next hashes Improve `BlockChain<T>.FindNextHashes()` Jun 8, 2019

@longfin longfin changed the title Improve `BlockChain<T>.FindNextHashes()` Improve branch point finding Jun 8, 2019

@longfin longfin force-pushed the longfin:feature/improve-next-hashes branch 2 times, most recently from 6578780 to 1daa479 Jun 8, 2019

@longfin longfin marked this pull request as ready for review Jun 8, 2019

Show resolved Hide resolved CHANGES.md Outdated

@longfin longfin requested a review from dahlia Jun 10, 2019

@longfin longfin force-pushed the longfin:feature/improve-next-hashes branch from e53654f to 2ccd1e5 Jun 10, 2019

@dahlia dahlia added the autorebase label Jun 10, 2019

@autorebase autorebase bot removed the autorebase label Jun 10, 2019

@autorebase

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

The rebase failed:

Not Found

To rebase manually, run these commands in your terminal:

# Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/rebase feature/improve-next-hashes
# Navigate to the new directory.
cd .worktrees/rebase
# Rebase and resolve the likely conflicts.
git rebase --interactive --autosquash master
# Push the new branch state to GitHub.
git push --force
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/rebase

@longfin longfin force-pushed the longfin:feature/improve-next-hashes branch from 2ccd1e5 to a5e4368 Jun 10, 2019

@longfin longfin requested a review from earlbread Jun 10, 2019

Show resolved Hide resolved Libplanet/Blockchain/BlockChain.cs
Show resolved Hide resolved CHANGES.md Outdated
@codecov

This comment has been minimized.

Copy link

commented Jun 11, 2019

Codecov Report

Merging #277 into master will increase coverage by 0.05%.
The diff coverage is 78.57%.

@@            Coverage Diff             @@
##           master     #277      +/-   ##
==========================================
+ Coverage      87%   87.06%   +0.05%     
==========================================
  Files         180      180              
  Lines       11555    11532      -23     
==========================================
- Hits        10054    10040      -14     
+ Misses       1258     1253       -5     
+ Partials      243      239       -4
Impacted Files Coverage Δ
Libplanet/Store/BaseIndex.cs 33.33% <ø> (+1.66%) ⬆️
Libplanet/Blockchain/BlockChain.cs 96.74% <100%> (+0.27%) ⬆️
Libplanet/Store/TransactionSet.cs 83.33% <25%> (-8.34%) ⬇️
Libplanet/Store/BlockSet.cs 87.09% <57.14%> (-9.88%) ⬇️
Libplanet.Tests/Net/SwarmTest.cs 93.08% <0%> (+0.02%) ⬆️
Libplanet/Net/Swarm.cs 75.21% <0%> (+0.14%) ⬆️
Libplanet/HashDigest.cs 100% <0%> (+3.65%) ⬆️
1 similar comment
@codecov

This comment has been minimized.

Copy link

commented Jun 11, 2019

Codecov Report

Merging #277 into master will increase coverage by 0.05%.
The diff coverage is 78.57%.

@@            Coverage Diff             @@
##           master     #277      +/-   ##
==========================================
+ Coverage      87%   87.06%   +0.05%     
==========================================
  Files         180      180              
  Lines       11555    11532      -23     
==========================================
- Hits        10054    10040      -14     
+ Misses       1258     1253       -5     
+ Partials      243      239       -4
Impacted Files Coverage Δ
Libplanet/Store/BaseIndex.cs 33.33% <ø> (+1.66%) ⬆️
Libplanet/Blockchain/BlockChain.cs 96.74% <100%> (+0.27%) ⬆️
Libplanet/Store/TransactionSet.cs 83.33% <25%> (-8.34%) ⬇️
Libplanet/Store/BlockSet.cs 87.09% <57.14%> (-9.88%) ⬇️
Libplanet.Tests/Net/SwarmTest.cs 93.08% <0%> (+0.02%) ⬆️
Libplanet/Net/Swarm.cs 75.21% <0%> (+0.14%) ⬆️
Libplanet/HashDigest.cs 100% <0%> (+3.65%) ⬆️
@codecov

This comment has been minimized.

Copy link

commented Jun 11, 2019

Codecov Report

Merging #277 into master will decrease coverage by 6.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #277      +/-   ##
==========================================
- Coverage      87%   80.96%   -6.05%     
==========================================
  Files         180       61     -119     
  Lines       11555     1434   -10121     
==========================================
- Hits        10054     1161    -8893     
+ Misses       1258      245    -1013     
+ Partials      243       28     -215
Impacted Files Coverage Δ
Libplanet/Net/Messages/BlockHashes.cs
Libplanet/Net/NoSwarmContextException.cs
Libplanet.Tests/Action/ActionEvaluationTest.cs
Libplanet.Tests/Store/FileStoreTest.cs
Libplanet/Blocks/Block.cs
Libplanet/Net/PeerSetDelta.cs
...planet/Blockchain/Policies/BlockPolicyExtension.cs
Libplanet/Blocks/InvalidBlockTimestampException.cs
Libplanet/Net/Messages/PeerSetDelta.cs
Libplanet/Tx/InvalidTxUpdatedAddressesException.cs
... and 105 more

longfin and others added some commits Jun 8, 2019

Update CHANGES.md
Co-Authored-By: Hong Minhee <hong.minhee@gmail.com> (+2 squashed commit)
Co-Authored-By: Seunghun Lee <waydi1@gmail.com>

@longfin longfin force-pushed the longfin:feature/improve-next-hashes branch from 1a4bae8 to 62cb3c3 Jun 11, 2019

@longfin longfin requested review from dahlia and earlbread Jun 11, 2019

@dahlia

dahlia approved these changes Jun 11, 2019

@longfin longfin merged commit 7662a85 into planetarium:master Jun 11, 2019

15 of 16 checks passed

codecov/project 80.96% (-6.05%) compared to 990e22a
Details
Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
changelog This contains self-describing changelog.
Details
codecov/patch Coverage not affected when comparing 990e22a...62cb3c3
Details
docs Libplanet docs generated by DocFX
Details
planetarium.libplanet Build #20190611.3 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
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.