diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a90086b4..68522ecff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Fixes - [#1829](https://github.com/poanetwork/blockscout/pull/1829) - Handle nil quantities in block decoding routine +- [#1830](https://github.com/poanetwork/blockscout/pull/1830) - Make block size field nullable ### Chore @@ -43,6 +44,7 @@ - [#1802](https://github.com/poanetwork/blockscout/pull/1802) - make coinmarketcap's number of pages configurable - [#1799](https://github.com/poanetwork/blockscout/pull/1799) - Use eth_getUncleByBlockHashAndIndex for uncle block fetching - [#1531](https://github.com/poanetwork/blockscout/pull/1531) - docker: fix dockerFile for secp256k1 building + - [#1835](https://github.com/poanetwork/blockscout/pull/1835) - fix: ignore `pong` messages without error ### Chore diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex index e4e6d2ac8c..baa4ce61c1 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex @@ -152,6 +152,11 @@ defmodule EthereumJSONRPC.WebSocket.WebSocketClient do @impl :websocket_client def websocket_handle({:ping, ""}, _request, %__MODULE__{} = state), do: {:reply, {:pong, ""}, state} + @impl :websocket_client + def websocket_handle({:pong, _}, _request, state) do + {:ok, state} + end + @impl :websocket_client def websocket_info({:"$gen_call", from, request}, _, %__MODULE__{} = state) do case handle_call(request, from, state) do diff --git a/apps/explorer/lib/explorer/chain/block.ex b/apps/explorer/lib/explorer/chain/block.ex index 974f1531bb..58d187d9d8 100644 --- a/apps/explorer/lib/explorer/chain/block.ex +++ b/apps/explorer/lib/explorer/chain/block.ex @@ -10,10 +10,9 @@ defmodule Explorer.Chain.Block do alias Explorer.Chain.{Address, Gas, Hash, Transaction} alias Explorer.Chain.Block.{Reward, SecondDegreeRelation} - @optional_attrs ~w(internal_transactions_indexed_at)a + @optional_attrs ~w(internal_transactions_indexed_at size)a - @required_attrs ~w(consensus difficulty gas_limit gas_used hash miner_hash nonce number parent_hash size timestamp - total_difficulty)a + @required_attrs ~w(consensus difficulty gas_limit gas_used hash miner_hash nonce number parent_hash timestamp total_difficulty)a @typedoc """ How much work is required to find a hash with some number of leading 0s. It is measured in hashes for PoW diff --git a/apps/explorer/priv/repo/migrations/20190424170833_change_block_size_to_nullable.exs b/apps/explorer/priv/repo/migrations/20190424170833_change_block_size_to_nullable.exs new file mode 100644 index 0000000000..90769c7233 --- /dev/null +++ b/apps/explorer/priv/repo/migrations/20190424170833_change_block_size_to_nullable.exs @@ -0,0 +1,15 @@ +defmodule Explorer.Repo.Migrations.ChangeBlockSizeToNullable do + use Ecto.Migration + + def up do + alter table(:blocks) do + modify(:size, :integer, null: true) + end + end + + def down do + alter table(:blocks) do + modify(:size, :integer, null: false) + end + end +end