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

Removes duplicate entries from Indexer.Fetcher.UncleBlock #2177

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

pasqu4le
Copy link
Contributor

@pasqu4le pasqu4le commented Jun 14, 2019

Resolves #2154
Resolves #2048

Motivation

Sometimes the same uncle gets fetched more than once in the same batch, causing the updating query to fail. As a solution, the Fetcher input entries are deduplicated.

Bug Fixes

I was not able to pinpoint the cause of the duplicate, but my best guess is that it is related by the asynchronicity of the fetching that causes Explorer.Chain.stream_unfetched_uncles to refetch an uncle before it's imported and its uncle_fetched_at gets set.

Given that the results from processing multiple times the same entry are the same and that there are no particular constraints on_conflictfor SecondDegreeRelations, the solution consists in simply eliminating the duplicates from the fetcher entries.

Checklist for your PR

  • I added an entry to CHANGELOG.md with this PR
  • If I added new functionality, I added tests covering it.
  • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • I checked whether I should update the docs and did so if necessary

@pasqu4le pasqu4le added the ready for review This PR is ready for reviews. label Jun 14, 2019
@pasqu4le pasqu4le self-assigned this Jun 14, 2019
@coveralls
Copy link

coveralls commented Jun 14, 2019

Pull Request Test Coverage Report for Build 2e18da10-7207-42cc-a79c-a1532e526fbf

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 80.866%

Files with Coverage Reduction New Missed Lines %
apps/indexer/lib/indexer/fetcher/internal_transaction.ex 2 58.62%
Totals Coverage Status
Change from base Build d1457540-d67d-4902-a1e3-627de9ba07e1: -0.03%
Covered Lines: 4932
Relevant Lines: 6099

💛 - Coveralls

@vbaranov vbaranov merged commit 558a85d into master Jun 19, 2019
@vbaranov vbaranov deleted the filter_duplicate_uncles branch June 19, 2019 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is ready for reviews.
Projects
None yet
6 participants