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

longfin
Copy link
Member

@longfin longfin 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 feature/improve-next-hashes branch from f79adb0 to 1c9dec1 Compare June 8, 2019 07:09
@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 feature/improve-next-hashes branch 2 times, most recently from 6578780 to 1daa479 Compare June 8, 2019 07:19
@longfin longfin marked this pull request as ready for review June 8, 2019 07:23
CHANGES.md Outdated Show resolved Hide resolved
@longfin longfin requested a review from dahlia June 10, 2019 02:02
earlbread
earlbread previously approved these changes Jun 10, 2019
@autorebase
Copy link
Contributor

autorebase bot 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 feature/improve-next-hashes branch from 2ccd1e5 to a5e4368 Compare June 10, 2019 11:01
@longfin longfin requested a review from earlbread June 10, 2019 13:22
earlbread
earlbread previously approved these changes Jun 10, 2019
Libplanet/Blockchain/BlockChain.cs Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot 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
Copy link

codecov bot 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
Copy link

codecov bot 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 longfin force-pushed the feature/improve-next-hashes branch from 1a4bae8 to 62cb3c3 Compare June 11, 2019 07:56
@longfin longfin requested review from dahlia and earlbread June 11, 2019 07:56
@longfin longfin merged commit 7662a85 into planetarium:master Jun 11, 2019
limebell pushed a commit to limebell/libplanet that referenced this pull request Jul 7, 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.

3 participants