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

add clause for transactions with indexed created contract code #2423

Conversation

ayrat555
Copy link
Contributor

fixes

2019-07-11T18:17:03.658 application=indexer fetcher=block_catchup first_block_number=8994213 last_block_number=8994213 [error] ** (FunctionClauseError) no function clause matching in anonymous fn/1 in Indexer.Block.Fetcher.async_import_created_contract_codes/1
    (indexer) lib/indexer/block/fetcher.ex:242: anonymous fn(%Explorer.Chain.Transaction{r: #Decimal<100832949619708834297399348907052617039655788733521098399664843178908027110657>, inserted_at: #DateTime<2018-10-19 02:55:46.140055Z>, gas: #Decimal<549193>, created_contract_code_indexed_at: #DateTime<2019-07-05 21:42:36.988889Z>, uncles: #Ecto.Association.NotLoaded<association :uncles is not loaded>, internal_transactions: #Ecto.Association.NotLoaded<association :internal_transactions is not loaded>, created_contract_address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<103, 231, 254, 203, 99, 42, 40, 52, 255, 130, 108, 107, 233, 231, 189, 224, 231, 54, 197, 15>>}, to_address_hash: nil, to_address: #Ecto.Association.NotLoaded<association :to_address is not loaded>, nonce: 3, hash: %Explorer.Chain.Hash{byte_count: 32, bytes: <<10, 12, 193, 51, 243, 82, 218, 195, 92, 72, 141, 83, 35, 184, 82, 167, 165, 227, 49, 249, 27, 56, 0, 71, 231, 227, 168, 203, 216, 84, 148, 200>>}, earliest_processing_start: nil, s: #Decimal<56138485804549247706106490118334191281238999681830886533886601177035075304480>, value: #Explorer.Chain.Wei<0>, block_number: 8994213, token_transfers: #Ecto.Association.NotLoaded<association :token_transfers is not loaded>, v: #Decimal<120>, input: %Explorer.Chain.Data{bytes: <<96, 128, 96, 64, 82, 52, 128, 21, 97, 0, 16, 87, 96, 0, 128, 253, 91, 80, 96, 64, 128, 81, 128, 130, 1, 144, 145, 82, 96, 9, 128, ...>>}, error: nil, cumulative_gas_used: #Decimal<609715>, forks: #Ecto.Association.NotLoaded<association :forks is not loaded>, from_address: #Ecto.Association.NotLoaded<association :from_address is not loaded>, updated_at: #DateTime<2019-07-11 18:16:44.683648Z>, __meta__: #Ecto.Schema.Metadata<:loaded, "transactions">, gas_used: #Decimal<549193>, old_block_hash: %Explorer.Chain.Hash{byte_count: 32, bytes: <<5, 235, 81, 255, 132, 113, 68, 103, 122, 122, 250, 252, 174, 36, 166, 143, 65, 88, 16, 141, 137, 46, ...>>}, from_address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<164, 30, 209, 159, 205, 84, 65, 214, 185, 84, 45, 192, 168, 240, 49, 57, 101, 241, 112, 103>>}, internal_transactions_indexed_at: nil, status: :ok, block_hash: %Explorer.Chain.Hash{byte_count: 32, bytes: <<5, 235, 81, 255, 132, 113, 68, 103, 122, 122, 250, 252, 174, 36, 166, 143, 65, 88, ...>>}, index: 2, logs: #Ecto.Association.NotLoaded<association :logs is not loaded>, gas_price: #Explorer.Chain.Wei<1000000000>, created_contract_address: #Ecto.Association.NotLoaded<association :created_contract_address is not loaded>, block: #Ecto.Association.NotLoaded<association :block is not loaded>}) in Indexer.Block.Fetcher.async_import_created_contract_codes/1
    (elixir) lib/enum.ex:2986: Enum.flat_map_list/2

Changelog

  • add clause for transactions with indexed created contract code

@coveralls
Copy link

coveralls commented Jul 24, 2019

Pull Request Test Coverage Report for Build 855c549a-dbfb-40e3-9ed9-7421b6f89329

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 79.289%

Files with Coverage Reduction New Missed Lines %
apps/block_scout_web/lib/block_scout_web/controllers/chain/market_history_chart_controller.ex 2 71.43%
Totals Coverage Status
Change from base Build 3ec20c7a-6267-472d-b111-966aa13ac742: 0.1%
Covered Lines: 5149
Relevant Lines: 6494

💛 - Coveralls

Copy link
Contributor

@pasqu4le pasqu4le left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no problem with the fix.

However I encountered the same issue before and its the reason behind #2375 that I thought solved the problem.
@ayrat555 did you encounter the error after this PR was merged?

@vbaranov
Copy link
Member

@pasqu4le

However I encountered the same issue before and its the reason behind #2375 that I thought solved the problem.

ah, #2375 is not a part of release yet. Thanks for noticing that. This error was from the production instance where that fix is not installed yet. Then I suggest postponing merging the current PR and try #2375 first if @ayrat555 has no objections.

@vbaranov vbaranov added the paused Issues that have been held off for now. label Jul 30, 2019
@vbaranov
Copy link
Member

I am closing this PR for now. After installing 2.0.2 there is no more such error on Kovan instance.

@vbaranov vbaranov closed this Jul 31, 2019
@vbaranov vbaranov removed the paused Issues that have been held off for now. label Jul 31, 2019
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