-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove duplicate blocks from changes_list before import #2777
Conversation
are you sure this is only happening with uncles? |
Pull Request Test Coverage Report for Build e9e300a7-1bec-4456-b257-49e8d1b7bfa7
💛 - Coveralls |
@ayrat555 it looks like it, uncles is the only one where this is happening (from the logs I have). The fix modifies the runner anyway so if this is happening with other block-inserting fetchers as well if will be de-duplicated anyway. I am looking into why this fetcher is the only one to be affected, as like the other should have the filtering before fetching and should not end up with duplicates during importing |
ordered_changes_list = Enum.sort_by(changes_list, & &1.hash) | ||
ordered_changes_list = | ||
changes_list | ||
|> Enum.sort_by(& &1.hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum.uniq_by
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would work for the duplicates, but they also need to be sorted
Motivation
Solves error arising (mostly started by block_uncle fetcher) when the same block is present twice in the same changes_list
Checklist for your PR
CHANGELOG.md
with this PRmaster
in theVersion
column.