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

Reduce block_rewards in the catchup fetcher #1595

Merged
merged 3 commits into from
Mar 19, 2019
Merged

Conversation

goodsoft
Copy link
Contributor

Fixes #1584

If one address was rewarded for two different uncles in one block, cardinality violation occurred due to rewards not being properly reduced.
The reducing function from Block.Rewards.Fetcher is now reused in Block.Fetcher.

@ghost ghost assigned goodsoft Mar 19, 2019
@ghost ghost added the in progress label Mar 19, 2019
@coveralls
Copy link

coveralls commented Mar 19, 2019

Pull Request Test Coverage Report for Build 132878e0-0b69-4917-8619-a2f584074bf7

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 10 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.1%) to 82.086%

Files with Coverage Reduction New Missed Lines %
apps/indexer/lib/indexer/block/catchup/fetcher.ex 1 64.63%
apps/indexer/lib/indexer/code/fetcher.ex 2 18.75%
apps/indexer/lib/indexer/block/fetcher/receipts.ex 2 68.75%
apps/indexer/lib/indexer/internal_transaction/fetcher.ex 5 44.64%
Totals Coverage Status
Change from base Build afacb8a5-94a3-4deb-992f-b444a4d9908d: -0.1%
Covered Lines: 4202
Relevant Lines: 5119

💛 - Coveralls

@goodsoft goodsoft force-pushed the gs-reduce-uncle-rewards branch 2 times, most recently from c0108c7 to 7bd3e13 Compare March 19, 2019 03:27
When a block contains rewards for two uncle blocks to the same address,
the Cardinality Violation error occurs due to rewards not being reduced.
Fixes #1584

If one address is rewarded for two different uncles in one block,
cardinality violation occured due to rewards not being reduced.
The reducing function from Block.Rewards.Fetcher is now reused in
Block.Fetcher.
@goodsoft goodsoft force-pushed the gs-reduce-uncle-rewards branch from 7bd3e13 to 5ed8a95 Compare March 19, 2019 03:58
@ghost ghost assigned vbaranov Mar 19, 2019
@vbaranov vbaranov merged commit 044f891 into master Mar 19, 2019
@ghost ghost removed the in progress label Mar 19, 2019
@vbaranov vbaranov deleted the gs-reduce-uncle-rewards branch March 19, 2019 15:09
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