Merge pull request #5456 from blockscout/vb-allow-arbitrary-block-fields

Ignore arbitrary block details fields for custom Ethereum clients
pull/5458/head
Victor Baranov 3 years ago committed by GitHub
commit 45766828e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 16
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block.ex

@ -29,6 +29,7 @@
- [#5239](https://github.com/blockscout/blockscout/pull/5239) - Add accounting for block rewards in `getblockreward` api method
### Chore
- [#5456](https://github.com/blockscout/blockscout/pull/5456) - Ignore arbitrary block details fields for custom Ethereum clients
- [#5450](https://github.com/blockscout/blockscout/pull/5450) - Logging error in publishing of smart-contract
- [#5433](https://github.com/blockscout/blockscout/pull/5433) - Caching modules refactoring
- [#5419](https://github.com/blockscout/blockscout/pull/5419) - Add check if address exists for some api methods

@ -585,13 +585,9 @@ defmodule EthereumJSONRPC.Block do
# double check that no new keys are being missed by requiring explicit match for passthrough
# `t:EthereumJSONRPC.address/0` and `t:EthereumJSONRPC.hash/0` pass through as `Explorer.Chain` can verify correct
# hash format
# bitcoinMergedMiningCoinbaseTransaction bitcoinMergedMiningHeader bitcoinMergedMiningMerkleProof hashForMergedMining - RSK https://github.com/blockscout/blockscout/pull/2934
# committedSeals committee pastCommittedSeals proposerSeal round - Autonity network https://github.com/blockscout/blockscout/pull/3480
# blockGasCost extDataGasUsed - sgb/ava https://github.com/blockscout/blockscout/pull/5301
# blockExtraData extDataHash - Avalanche https://github.com/blockscout/blockscout/pull/5348
defp entry_to_elixir({key, _} = entry)
when key in ~w(author extraData hash logsBloom miner mixHash nonce parentHash receiptsRoot sealFields sha3Uncles
signature stateRoot step transactionsRoot uncles bitcoinMergedMiningCoinbaseTransaction bitcoinMergedMiningHeader bitcoinMergedMiningMerkleProof hashForMergedMining committedSeals committee pastCommittedSeals proposerSeal round blockGasCost extDataGasUsed blockExtraData extDataHash),
signature stateRoot step transactionsRoot uncles),
do: entry
defp entry_to_elixir({"timestamp" = key, timestamp}) do
@ -606,4 +602,14 @@ defmodule EthereumJSONRPC.Block do
defp entry_to_elixir({"l1BlockNumber", _}) do
{:ignore, :ignore}
end
# bitcoinMergedMiningCoinbaseTransaction bitcoinMergedMiningHeader bitcoinMergedMiningMerkleProof hashForMergedMining - RSK https://github.com/blockscout/blockscout/pull/2934
# committedSeals committee pastCommittedSeals proposerSeal round - Autonity network https://github.com/blockscout/blockscout/pull/3480
# blockGasCost extDataGasUsed - sgb/ava https://github.com/blockscout/blockscout/pull/5301
# blockExtraData extDataHash - Avalanche https://github.com/blockscout/blockscout/pull/5348
# vrf vrfProof - Harmony
# ...
defp entry_to_elixir({_, _}) do
{:ignore, :ignore}
end
end

Loading…
Cancel
Save