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

Modify implementation of where_transaction_has_multiple_internal_transactions #2267

Conversation

pasqu4le
Copy link
Contributor

Closes #2076

Changelog

Enhancements

While keeping the same result as the previous check for siblings (SELECT/LIMIT 2/COUNT/(> 1)) the new implementation is less expensive by using the existing indexes (EXISTS/index comparison).

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 28, 2019
@pasqu4le pasqu4le self-assigned this Jun 28, 2019
…ltiple_internal_transactions`

Problem: the implementation of that `WHERE` filter is too inefficient.
In particular this was brought to attention because it causes `Explorer.Etherscan.list_internal_transactions/2` to timeout for some addresses.
(For example: address `0x1B3858E01CCE5d0491f3c96A9996a65607f3493b`)

Solution: while keeping the same result the previous check for siblings (SELECT/LIMIT 2/COUNT/(> 1)) has been replaced by a less expensive one that better uses the existing indexes (EXISTS/index comparison).
@pasqu4le pasqu4le force-pushed the pp-change-where_transaction_has_multiple_internal_transactions-implementation branch from 93ccbba to 453d042 Compare June 28, 2019 12:11
@coveralls
Copy link

coveralls commented Jun 28, 2019

Pull Request Test Coverage Report for Build bf5b5480-f892-4158-8201-f5f9ec78401a

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

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 2736c39d-98f5-4c22-8da8-9862d0d52b5b: -0.03%
Covered Lines: 5116
Relevant Lines: 6304

💛 - Coveralls

vbaranov pushed a commit that referenced this pull request Jul 1, 2019
vbaranov added a commit that referenced this pull request Jul 2, 2019
@vbaranov vbaranov merged commit 59948e2 into master Jul 3, 2019
@vbaranov vbaranov deleted the pp-change-where_transaction_has_multiple_internal_transactions-implementation branch July 3, 2019 08: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
Development

Successfully merging this pull request may close these issues.

txlistinternal is timing out on some addresses
4 participants