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

Tune `Block<T>.Hash` and `Transaction<T>.Id` #234

Merged
merged 6 commits into from May 10, 2019

Conversation

Projects
None yet
3 participants
@longfin
Copy link
Member

commented May 9, 2019

This PR adjusts Block<T>.Hash and Transaction<T>.Id as below to stabilize mining performance irrespective of the number of transactions.

  • Block<T>.Hash and Transaction<T>.Id determined in their constructor instead of dynamically generated each time.
  • Block<T>.Hash is no longer calculated using the full data of the Transaction<T>, but is calculated using only the Transaction<T>.Id.

@longfin longfin force-pushed the longfin:feature/cache-block-hash branch from d178d84 to eca6b99 May 9, 2019

@longfin longfin marked this pull request as ready for review May 9, 2019

@longfin longfin requested review from dahlia and earlbread May 9, 2019

@codecov

This comment has been minimized.

Copy link

commented May 9, 2019

Codecov Report

Merging #234 into master will decrease coverage by 0.09%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master     #234     +/-   ##
=========================================
- Coverage   83.56%   83.46%   -0.1%     
=========================================
  Files          75       75             
  Lines        3511     3496     -15     
=========================================
- Hits         2934     2918     -16     
- Misses        577      578      +1
Impacted Files Coverage Δ
Libplanet/Blocks/Block.cs 98.05% <100%> (-0.11%) ⬇️
Libplanet/Tx/Transaction.cs 93.33% <100%> (-0.24%) ⬇️
Libplanet/Serialization/BencodexFormatter.cs 80.85% <0%> (-1.07%) ⬇️
@dahlia

dahlia approved these changes May 9, 2019

@longfin longfin merged commit 4b21f1d into planetarium:master May 10, 2019

5 checks passed

Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
changelog This contains self-describing changelog.
Details
codecov/patch 100% of diff hit (target 83.56%)
Details
codecov/project Absolute coverage decreased by -0.09% but relative coverage increased by +16.43% compared to c198bc9
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.