Merge pull request #2843 from poanetwork/ab-fix-small-skips-feature

fix realtime fetcher small skips feature
pull/2845/head
Victor Baranov 5 years ago committed by GitHub
commit 675b2b600a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex
  3. 4
      apps/indexer/lib/indexer/block/realtime/fetcher.ex
  4. 4
      apps/indexer/test/indexer/block/realtime/fetcher_test.exs

@ -7,6 +7,7 @@
- [#2822](https://github.com/poanetwork/blockscout/pull/2822) - Estimated address count on the main page, if cache is empty
### Fixes
- [#2843](https://github.com/poanetwork/blockscout/pull/2843) - fix realtime fetcher small skips feature
- [#2841](https://github.com/poanetwork/blockscout/pull/2841) - LUKSO dashboard height fix
- [#2837](https://github.com/poanetwork/blockscout/pull/2837) - fix txlist ordering issue
- [#2830](https://github.com/poanetwork/blockscout/pull/2830) - Fix wrong color of contract icon on xDai chain

@ -308,7 +308,7 @@ defmodule EthereumJSONRPC.Transaction do
end
def to_elixir(transaction) when is_binary(transaction) do
Logger.warn(["Fetched transaction is not full: ", transaction])
# Logger.warn(["Fetched transaction is not full: ", transaction])
nil
end

@ -250,9 +250,13 @@ defmodule Indexer.Block.Realtime.Fetcher do
[number]
true ->
if number - previous_number - 1 > 10 do
(number - 10)..number
else
(previous_number + 1)..number
end
end
end
defp reorg?(number, max_number_seen) when is_integer(max_number_seen) and number <= max_number_seen do
true

@ -448,7 +448,7 @@ defmodule Indexer.Block.Realtime.FetcherTest do
old_number = 94
assert (previous_number + 1)..number == Realtime.Fetcher.determine_fetching_action(number, previous_number, nil)
assert (old_number + 1)..number == Realtime.Fetcher.determine_fetching_action(number, old_number, nil)
assert (number - 10)..number == Realtime.Fetcher.determine_fetching_action(number, old_number, nil)
end
test "when number immediately follows the previous_number it is fetched" do
@ -472,7 +472,7 @@ defmodule Indexer.Block.Realtime.FetcherTest do
number = max_number_seen + max_skipping_distance + 1
assert (previous_number + 1)..number ==
assert (number - 10)..number ==
Realtime.Fetcher.determine_fetching_action(number, previous_number, max_number_seen)
end
end

Loading…
Cancel
Save