Merge pull request #5676 from blockscout/vb-fix-clique

Fix wrong miner address shown for post EIP-1559 block for clique network
pull/5679/head
Victor Baranov 2 years ago committed by GitHub
commit 556b9ee066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 18
      apps/indexer/lib/indexer/transform/blocks.ex

@ -3,6 +3,7 @@
### Features
### Fixes
- [#5676](https://github.com/blockscout/blockscout/pull/5676) - Fix wrong miner address shown for post EIP-1559 block for clique network
### Chore
- [#5674](https://github.com/blockscout/blockscout/pull/5674) - Disable token holder refreshing

@ -35,9 +35,8 @@ defmodule Indexer.Transform.Blocks do
recover_pub_key(signature_hash, decode(signature))
end
# Signature hash calculated from the block header.
# Needed for PoA-based chains
defp signature_hash(block) do
# Get EIP-1559 compatible block header
defp get_header_data(block) do
header_data = [
decode(block.parent_hash),
decode(block.sha3_uncles),
@ -56,6 +55,19 @@ defmodule Indexer.Transform.Blocks do
decode(block.nonce)
]
if Map.has_key?(block, :base_fee_per_gas) do
# credo:disable-for-next-line
header_data ++ [block.base_fee_per_gas]
else
header_data
end
end
# Signature hash calculated from the block header.
# Needed for PoA-based chains
defp signature_hash(block) do
header_data = get_header_data(block)
ExKeccak.hash_256(ExRLP.encode(header_data))
end

Loading…
Cancel
Save