diff --git a/CHANGELOG.md b/CHANGELOG.md index 258c379cb9..96137e1268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ ## 3.7.3-beta ### Features +- [#4520](https://github.com/blockscout/blockscout/pull/4520) - Add support for EIP-1559 - [#4569](https://github.com/blockscout/blockscout/pull/4569) - Smart-Contract: remove comment with the submission date - [#4568](https://github.com/blockscout/blockscout/pull/4568) - TX page: Token transfer and minting section improvements - [#4540](https://github.com/blockscout/blockscout/pull/4540) - Allign copy buttons for `Block Details` and `Transaction Details` pages diff --git a/apps/block_scout_web/lib/block_scout_web/templates/block/_tile.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/block/_tile.html.eex index 143376a22a..2a7034967e 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/block/_tile.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/block/_tile.html.eex @@ -1,3 +1,5 @@ +<% burned_fee = if !is_nil(@block.base_fee_per_gas), do: Wei.mult(@block.base_fee_per_gas, BlockBurnedFeeCounter.fetch(@block.hash)), else: nil %> +<% priority_fee = if !is_nil(@block.base_fee_per_gas), do: BlockPriorityFeeCounter.fetch(@block.hash), else: nil %>
@@ -53,6 +55,12 @@ <% end %>
+ <%= if !is_nil(@block.base_fee_per_gas) do %> + + <%= format_wei_value(%Wei{value: priority_fee}, :ether) %> <%= gettext "Priority Fees" %> + + <%= format_wei_value(burned_fee, :ether) %> <%= gettext "Burnt Fees" %> + <% end %> <%= formatted_gas(@block.gas_limit) %> <%= gettext "Gas Limit" %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex index 496cec31bb..51f9f41369 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex @@ -1,3 +1,5 @@ +<% burned_fee = if !is_nil(@block.base_fee_per_gas), do: Wei.mult(@block.base_fee_per_gas, BlockBurnedFeeCounter.fetch(@block.hash)), else: nil %> +<% priority_fee = if !is_nil(@block.base_fee_per_gas), do: BlockPriorityFeeCounter.fetch(@block.hash), else: nil %>
<%= render BlockScoutWeb.Advertisement.TextAdView, "index.html", conn: @conn %>
@@ -186,6 +188,35 @@
<%= to_string(@block.nonce) %>
<% end %> + <%= if !is_nil(@block.base_fee_per_gas) do%> + +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("Minimum fee required per unit of gas. Fee adjusts based on network congestion.") %> + <%= gettext("Base Fee per Gas") %> +
+
<%= format_wei_value(@block.base_fee_per_gas, :gwei) %>
+
+ +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("xDai burned from transactions included in the block (Base fee (per unit of gas) * Gas Used).") %> + <%= gettext("Burnt Fees") %> +
+
<%= format_wei_value(burned_fee, :ether) %>
+
+ +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("User-defined tips sent to validator for transaction priority/inclusion.") %> + <%= gettext("Priority Fee / Tip") %> +
+
<%= format_wei_value(%Wei{value: priority_fee}, :ether) %>
+
+ <% end %> <%= if show_reward?(@block.rewards) do %>
<%= for block_reward <- @block.rewards do %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex index 7ec051a627..59b7b8d004 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex @@ -2,6 +2,13 @@ <% from_address_hash = @transaction.from_address_hash %> <% to_address_hash = @transaction.to_address_hash %> <% created_address_hash = @transaction.created_contract_address_hash %> +<% type = if @transaction.type == 2, do: "2 (EIP-1559)", else: @transaction.type %> +<% base_fee_per_gas = if block, do: block.base_fee_per_gas, else: nil %> +<% max_priority_fee_per_gas = @transaction.max_priority_fee_per_gas %> +<% max_fee_per_gas = @transaction.max_fee_per_gas %> +<% burned_fee = if !is_nil(max_fee_per_gas) and !is_nil(@transaction.gas_used) and !is_nil(base_fee_per_gas), do: Wei.mult(base_fee_per_gas, @transaction.gas_used), else: nil %> +<% priority_fee_per_gas = if is_nil(max_priority_fee_per_gas) or is_nil(base_fee_per_gas), do: nil, else: Enum.min_by([max_priority_fee_per_gas, Wei.sub(max_fee_per_gas, base_fee_per_gas)], fn x -> Wei.to(x, :wei) end) %> +<% priority_fee = if is_nil(priority_fee_per_gas), do: nil, else: Wei.mult(priority_fee_per_gas, @transaction.gas_used) %> <% decoded_input_data = decoded_input_data(@transaction) %> <% status = transaction_status(@transaction) %> <% circles_addresses_list = CustomContractsHelpers.get_custom_addresses_list(:circles_addresses) %> @@ -284,8 +291,7 @@
<%= value(@transaction) %> <%= if !empty_exchange_rate?(@exchange_rate) do %> - ( + ( data-usd-exchange-rate=<%= @exchange_rate.usd_value %>> ) <% end %> @@ -315,6 +321,16 @@
<%= gas_price(@transaction, :gwei) %>
+ <%= if !is_nil(type) do %> +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("Transaction type, introduced in EIP-2718.") %> + <%= gettext "Transaction Type" %> +
+
<%= type %>
+
+ <% end %>
@@ -325,6 +341,46 @@
<%= format_gas_limit(@transaction.gas) %>
+ <%= if !is_nil(max_fee_per_gas) do %> +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("Maximum total amount per unit of gas a user is willing to pay for a transaction, including base fee and priority fee.") %> + <%= gettext "Max Fee per Gas" %> +
+
<%= format_wei_value(max_fee_per_gas, :gwei) %>
+
+ <% end %> + <%= if !is_nil(max_priority_fee_per_gas) do %> +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("User defined maximum fee (tip) per unit of gas paid to validator for transaction prioritization.") %> + <%= gettext "Max Priority Fee per Gas" %> +
+
<%= format_wei_value(max_priority_fee_per_gas, :gwei) %>
+
+ <% end %> + <%= if !is_nil(priority_fee) do %> +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("User-defined tip sent to validator for transaction priority/inclusion.") %> + <%= gettext "Priority Fee / Tip" %> +
+
<%= format_wei_value(priority_fee, :ether) %>
+
+ <% end %> + <%= if !is_nil(burned_fee) do %> +
+
+ <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html", + text: gettext("Amount of xDai burned for this transaction. Equals Block Base Fee per Gas * Gas Used.") %> + <%= gettext "Transaction Burned Fee" %> +
+
<%= format_wei_value(burned_fee, :gwei) %>
+
+ <% end %>
diff --git a/apps/block_scout_web/lib/block_scout_web/views/block_view.ex b/apps/block_scout_web/lib/block_scout_web/views/block_view.ex index 4db89f3da5..78a22e7670 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/block_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/block_view.ex @@ -6,6 +6,7 @@ defmodule BlockScoutWeb.BlockView do alias Explorer.Chain alias Explorer.Chain.{Block, Wei} alias Explorer.Chain.Block.Reward + alias Explorer.Counters.{BlockBurnedFeeCounter, BlockPriorityFeeCounter} @dialyzer :no_match diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 191ca194e4..ab291a5b61 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -13,7 +13,7 @@ msgstr[0] "" msgstr[1] "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:27 +#: lib/block_scout_web/templates/block/_tile.html.eex:29 msgid "%{count} transaction" msgid_plural "%{count} transactions" msgstr[0] "" @@ -42,12 +42,12 @@ msgid "%{address} - %{subnetwork} Explorer" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:10 +#: lib/block_scout_web/templates/block/overview.html.eex:12 msgid "%{block_type} Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:47 +#: lib/block_scout_web/templates/block/overview.html.eex:49 msgid "%{block_type} Height" msgstr "" @@ -57,12 +57,12 @@ msgid "%{block_type}s" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:76 +#: lib/block_scout_web/templates/block/overview.html.eex:78 msgid "%{count} Transaction" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:78 +#: lib/block_scout_web/templates/block/overview.html.eex:80 #: lib/block_scout_web/templates/chain/_block.html.eex:11 msgid "%{count} Transactions" msgstr "" @@ -107,7 +107,7 @@ msgid "- We're indexing this chain right now. Some of the counts may be inaccura msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:183 +#: lib/block_scout_web/templates/block/overview.html.eex:185 msgid "64-bit hash of value verifying proof-of-work (note: null for POA chains)." msgstr "" @@ -123,7 +123,7 @@ msgid "

To become a candidate, your staking address must be funded with %{toke msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:86 +#: lib/block_scout_web/templates/block/overview.html.eex:88 msgid "A block producer who successfully included the block onto the blockchain." msgstr "" @@ -185,7 +185,7 @@ msgid "Action" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:332 +#: lib/block_scout_web/templates/transaction/overview.html.eex:388 msgid "Actual gas amount used by the transaction." msgstr "" @@ -197,12 +197,12 @@ msgid "Address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:175 +#: lib/block_scout_web/templates/transaction/overview.html.eex:182 msgid "Address (external or contract) receiving the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:155 +#: lib/block_scout_web/templates/transaction/overview.html.eex:162 msgid "Address (external or contract) sending the transaction." msgstr "" @@ -260,10 +260,15 @@ msgid "Amount of %{symbol} placed by an address." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:195 +#: lib/block_scout_web/templates/block/overview.html.eex:226 msgid "Amount of distributed reward. Miners receive a static block reward + Tx fees + uncle fees." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:378 +msgid "Amount of xDai burned for this transaction. Equals Block Base Fee per Gas * Gas Used." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." @@ -322,6 +327,11 @@ msgstr "" msgid "Banned until block #%{banned_until} (%{estimated_unban_day})" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:197 +msgid "Base Fee per Gas" +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:5 #: lib/block_scout_web/templates/api_docs/index.html.eex:5 @@ -337,14 +347,14 @@ msgid "Become a Candidate" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:353 +#: lib/block_scout_web/templates/transaction/overview.html.eex:409 msgid "Binary data included with the transaction. See input / logs below for additional info." msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_coin_balance/_coin_balances.html.eex:8 -#: lib/block_scout_web/templates/block/overview.html.eex:24 -#: lib/block_scout_web/templates/transaction/overview.html.eex:114 +#: lib/block_scout_web/templates/block/overview.html.eex:26 +#: lib/block_scout_web/templates/transaction/overview.html.eex:121 msgid "Block" msgstr "" @@ -366,7 +376,7 @@ msgid "Block Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:45 +#: lib/block_scout_web/templates/block/overview.html.eex:47 msgid "Block Height" msgstr "" @@ -381,7 +391,7 @@ msgid "Block Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:146 +#: lib/block_scout_web/templates/block/overview.html.eex:148 msgid "Block difficulty for miner, used to calibrate block generation time (Note: constant in POA based networks)." msgstr "" @@ -396,7 +406,7 @@ msgid "Block number" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:113 +#: lib/block_scout_web/templates/transaction/overview.html.eex:120 msgid "Block number containing the transaction." msgstr "" @@ -449,6 +459,12 @@ msgstr "" msgid "Bridged from Ethereum" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/_tile.html.eex:62 +#: lib/block_scout_web/templates/block/overview.html.eex:206 +msgid "Burnt Fees" +msgstr "" + #, elixir-format #: lib/block_scout_web/views/internal_transaction_view.ex:21 msgid "Call" @@ -500,7 +516,7 @@ msgid "Choose Target Pool" msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:62 +#: lib/block_scout_web/views/block_view.ex:63 msgid "Chore Reward" msgstr "" @@ -577,12 +593,12 @@ msgid "Confirmed" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:92 +#: lib/block_scout_web/templates/transaction/overview.html.eex:99 msgid "Confirmed by " msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:146 +#: lib/block_scout_web/templates/transaction/overview.html.eex:153 msgid "Confirmed within" msgstr "" @@ -623,7 +639,7 @@ msgid "Constructor Arguments" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:185 +#: lib/block_scout_web/templates/transaction/overview.html.eex:192 msgid "Contract" msgstr "" @@ -709,8 +725,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:37 #: lib/block_scout_web/templates/address/overview.html.eex:38 -#: lib/block_scout_web/templates/block/overview.html.eex:93 -#: lib/block_scout_web/templates/block/overview.html.eex:94 +#: lib/block_scout_web/templates/block/overview.html.eex:95 +#: lib/block_scout_web/templates/block/overview.html.eex:96 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:40 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:41 msgid "Copy Address" @@ -737,14 +753,14 @@ msgstr "" #: #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:14 #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:15 -#: lib/block_scout_web/templates/transaction/overview.html.eex:165 -#: lib/block_scout_web/templates/transaction/overview.html.eex:166 +#: lib/block_scout_web/templates/transaction/overview.html.eex:172 +#: lib/block_scout_web/templates/transaction/overview.html.eex:173 msgid "Copy From Address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:117 -#: lib/block_scout_web/templates/block/overview.html.eex:118 +#: lib/block_scout_web/templates/block/overview.html.eex:119 +#: lib/block_scout_web/templates/block/overview.html.eex:120 msgid "Copy Hash" msgstr "" @@ -754,8 +770,8 @@ msgid "Copy Metadata" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:137 -#: lib/block_scout_web/templates/block/overview.html.eex:138 +#: lib/block_scout_web/templates/block/overview.html.eex:139 +#: lib/block_scout_web/templates/block/overview.html.eex:140 msgid "Copy Parent Hash" msgstr "" @@ -774,10 +790,10 @@ msgstr "" #: #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:31 #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:32 -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 -#: lib/block_scout_web/templates/transaction/overview.html.eex:195 -#: lib/block_scout_web/templates/transaction/overview.html.eex:204 -#: lib/block_scout_web/templates/transaction/overview.html.eex:205 +#: lib/block_scout_web/templates/transaction/overview.html.eex:201 +#: lib/block_scout_web/templates/transaction/overview.html.eex:202 +#: lib/block_scout_web/templates/transaction/overview.html.eex:211 +#: lib/block_scout_web/templates/transaction/overview.html.eex:212 msgid "Copy To Address" msgstr "" @@ -788,30 +804,30 @@ msgid "Copy Token ID" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:55 +#: lib/block_scout_web/templates/transaction/overview.html.eex:62 msgid "Copy Transaction Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:56 +#: lib/block_scout_web/templates/transaction/overview.html.eex:63 msgid "Copy Txn Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:379 +#: lib/block_scout_web/templates/transaction/overview.html.eex:435 msgid "Copy Txn Hex Input" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:385 +#: lib/block_scout_web/templates/transaction/overview.html.eex:441 msgid "Copy Txn UTF-8 Input" msgstr "" #, elixir-format #: lib/block_scout_web/templates/log/_data_decoded_view.html.eex:20 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:38 -#: lib/block_scout_web/templates/transaction/overview.html.eex:378 -#: lib/block_scout_web/templates/transaction/overview.html.eex:384 +#: lib/block_scout_web/templates/transaction/overview.html.eex:434 +#: lib/block_scout_web/templates/transaction/overview.html.eex:440 msgid "Copy Value" msgstr "" @@ -861,7 +877,7 @@ msgid "Current Stake:" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:65 +#: lib/block_scout_web/templates/transaction/overview.html.eex:72 msgid "Current transaction state: Success, Failed (Error), or Pending (In Process)" msgstr "" @@ -879,12 +895,12 @@ msgid "Data" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:62 +#: lib/block_scout_web/templates/block/overview.html.eex:64 msgid "Date & time at which block was produced." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:132 +#: lib/block_scout_web/templates/transaction/overview.html.eex:139 msgid "Date & time of transaction inclusion, including length of time for confirmation." msgstr "" @@ -967,7 +983,7 @@ msgid "Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:147 +#: lib/block_scout_web/templates/block/overview.html.eex:149 msgid "Difficulty" msgstr "" @@ -1032,7 +1048,7 @@ msgid "Emission Contract" msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:70 +#: lib/block_scout_web/views/block_view.ex:71 msgid "Emission Reward" msgstr "" @@ -1150,7 +1166,7 @@ msgstr "" #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:42 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:40 #: lib/block_scout_web/templates/address_transaction/index.html.eex:38 -#: lib/block_scout_web/templates/transaction/overview.html.eex:156 +#: lib/block_scout_web/templates/transaction/overview.html.eex:163 #: lib/block_scout_web/views/address_internal_transaction_view.ex:9 #: lib/block_scout_web/views/address_token_transfer_view.ex:9 #: lib/block_scout_web/views/address_transaction_view.ex:9 @@ -1163,30 +1179,30 @@ msgid "GET" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:57 -#: lib/block_scout_web/templates/block/overview.html.eex:175 -#: lib/block_scout_web/templates/transaction/overview.html.eex:324 +#: lib/block_scout_web/templates/block/_tile.html.eex:65 +#: lib/block_scout_web/templates/block/overview.html.eex:177 +#: lib/block_scout_web/templates/transaction/overview.html.eex:340 msgid "Gas Limit" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:314 +#: lib/block_scout_web/templates/transaction/overview.html.eex:320 msgid "Gas Price" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:62 -#: lib/block_scout_web/templates/block/overview.html.eex:166 +#: lib/block_scout_web/templates/block/_tile.html.eex:70 +#: lib/block_scout_web/templates/block/overview.html.eex:168 msgid "Gas Used" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:333 +#: lib/block_scout_web/templates/transaction/overview.html.eex:389 msgid "Gas Used by Transaction" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:52 +#: lib/block_scout_web/templates/block/overview.html.eex:54 msgid "Genesis Block" msgstr "" @@ -1202,19 +1218,19 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:52 -#: lib/block_scout_web/views/block_view.ex:20 +#: lib/block_scout_web/views/block_view.ex:21 #: lib/block_scout_web/views/wei_helpers.ex:77 msgid "Gwei" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:111 +#: lib/block_scout_web/templates/block/overview.html.eex:113 msgid "Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:361 -#: lib/block_scout_web/templates/transaction/overview.html.eex:365 +#: lib/block_scout_web/templates/transaction/overview.html.eex:417 +#: lib/block_scout_web/templates/transaction/overview.html.eex:421 msgid "Hex (Default)" msgstr "" @@ -1260,12 +1276,12 @@ msgid "Inactive Pool Addresses. Current validator pools are specified by a check msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:345 +#: lib/block_scout_web/templates/transaction/overview.html.eex:401 msgid "Index position of Transaction in the block." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:208 +#: lib/block_scout_web/templates/block/overview.html.eex:239 msgid "Index position(s) of referenced stale blocks." msgstr "" @@ -1285,7 +1301,7 @@ msgid "Input" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:177 +#: lib/block_scout_web/templates/transaction/overview.html.eex:184 msgid "Interacted With (To)" msgstr "" @@ -1378,22 +1394,22 @@ msgid "Likelihood of Becoming a Validator on the Next Epoch" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:267 +#: lib/block_scout_web/templates/transaction/overview.html.eex:274 msgid "List of ERC-1155 tokens created in the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:251 +#: lib/block_scout_web/templates/transaction/overview.html.eex:258 msgid "List of token burnt in the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:234 +#: lib/block_scout_web/templates/transaction/overview.html.eex:241 msgid "List of token minted in the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:218 +#: lib/block_scout_web/templates/transaction/overview.html.eex:225 msgid "List of token transferred in the transaction." msgstr "" @@ -1466,16 +1482,31 @@ msgstr "" msgid "Max Amount to Move:" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:349 +msgid "Max Fee per Gas" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:359 +msgid "Max Priority Fee per Gas" +msgstr "" + #, elixir-format #: lib/block_scout_web/views/transaction_view.ex:330 msgid "Max of" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:323 +#: lib/block_scout_web/templates/transaction/overview.html.eex:339 msgid "Maximum gas amount approved for the transaction." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:348 +msgid "Maximum total amount per unit of gas a user is willing to pay for a transaction, including base fee and priority fee." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/tokens/instance/metadata/index.html.eex:18 #: lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:10 @@ -1489,15 +1520,15 @@ msgid "Method Id" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:38 -#: lib/block_scout_web/templates/block/overview.html.eex:87 +#: lib/block_scout_web/templates/block/_tile.html.eex:40 +#: lib/block_scout_web/templates/block/overview.html.eex:89 #: lib/block_scout_web/templates/chain/_block.html.eex:15 msgid "Miner" msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:60 -#: lib/block_scout_web/views/block_view.ex:65 +#: lib/block_scout_web/views/block_view.ex:61 +#: lib/block_scout_web/views/block_view.ex:66 msgid "Miner Reward" msgstr "" @@ -1518,6 +1549,11 @@ msgstr "" msgid "Minimum Stake:" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:196 +msgid "Minimum fee required per unit of gas. Fee adjusts based on network congestion." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/stakes/_stakes_modal_pool_info.html.eex:24 msgid "Mining Address:" @@ -1605,8 +1641,8 @@ msgid "No Information" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:184 -#: lib/block_scout_web/templates/transaction/overview.html.eex:343 +#: lib/block_scout_web/templates/block/overview.html.eex:186 +#: lib/block_scout_web/templates/transaction/overview.html.eex:399 msgid "Nonce" msgstr "" @@ -1667,7 +1703,7 @@ msgid "Parameters" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:127 +#: lib/block_scout_web/templates/block/overview.html.eex:129 msgid "Parent Hash" msgstr "" @@ -1722,12 +1758,12 @@ msgid "Pools searching is already in progress for this address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:345 +#: lib/block_scout_web/templates/transaction/overview.html.eex:401 msgid "Position" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:213 +#: lib/block_scout_web/templates/block/overview.html.eex:244 msgid "Position %{index}" msgstr "" @@ -1755,10 +1791,21 @@ msgid "Price" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:313 +#: lib/block_scout_web/templates/transaction/overview.html.eex:319 msgid "Price per unit of gas specified by the sender. Higher gas prices can prioritize transaction inclusion during times of high usage." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:215 +#: lib/block_scout_web/templates/transaction/overview.html.eex:369 +msgid "Priority Fee / Tip" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/_tile.html.eex:60 +msgid "Priority Fees" +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/common_components/_btn_qr_code.html.eex:10 #: lib/block_scout_web/templates/common_components/_modal_qr_code.html.eex:5 @@ -1777,7 +1824,7 @@ msgid "RPC" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:354 +#: lib/block_scout_web/templates/transaction/overview.html.eex:410 msgid "Raw Input" msgstr "" @@ -1854,17 +1901,17 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:66 +#: lib/block_scout_web/templates/transaction/overview.html.eex:73 msgid "Result" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:103 +#: lib/block_scout_web/templates/transaction/overview.html.eex:110 msgid "Revert reason" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:48 +#: lib/block_scout_web/templates/block/_tile.html.eex:50 #: lib/block_scout_web/templates/chain/_block.html.eex:24 #: lib/block_scout_web/views/internal_transaction_view.ex:28 msgid "Reward" @@ -1966,12 +2013,12 @@ msgid "Show only those I have stake in" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:102 +#: lib/block_scout_web/templates/block/overview.html.eex:104 msgid "Size" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:101 +#: lib/block_scout_web/templates/block/overview.html.eex:103 msgid "Size of the block in bytes." msgstr "" @@ -2094,7 +2141,7 @@ msgid "Static Call" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:78 +#: lib/block_scout_web/templates/transaction/overview.html.eex:85 msgid "Status" msgstr "" @@ -2151,7 +2198,7 @@ msgid "The Number of Delegators in the Pool" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:110 +#: lib/block_scout_web/templates/block/overview.html.eex:112 msgid "The SHA256 hash of the block." msgstr "" @@ -2161,7 +2208,7 @@ msgid "The amount can be claimed after the current epoch finishes." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:43 +#: lib/block_scout_web/templates/block/overview.html.eex:45 msgid "The block height of a particular block is defined as the number of blocks preceding it in the blockchain." msgstr "" @@ -2181,7 +2228,7 @@ msgid "The first amount is the validator’s own stake, the second is the total msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:126 +#: lib/block_scout_web/templates/block/overview.html.eex:128 msgid "The hash of the block from which this block was generated." msgstr "" @@ -2191,7 +2238,7 @@ msgid "The number of delegators providing stake to the pool. Click on the number msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:71 +#: lib/block_scout_web/templates/block/overview.html.eex:73 msgid "The number of transactions in the block." msgstr "" @@ -2207,7 +2254,7 @@ msgid "The rest addresses are delegators of its pool." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:102 +#: lib/block_scout_web/templates/transaction/overview.html.eex:109 msgid "The revert reason of the transaction." msgstr "" @@ -2218,7 +2265,7 @@ msgid "The staking epochs for which the reward could be claimed (read-only field msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:77 +#: lib/block_scout_web/templates/transaction/overview.html.eex:84 msgid "The status of the transaction: Confirmed or Unconfirmed." msgstr "" @@ -2228,7 +2275,7 @@ msgid "The table refreshed block(s) ago." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:165 +#: lib/block_scout_web/templates/block/overview.html.eex:167 msgid "The total gas amount used in the block and its percentage of gas filled in the block." msgstr "" @@ -2382,13 +2429,13 @@ msgid "This pool is banned until block #%{banned_until} (%{estimated_unban_day}) msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:41 +#: lib/block_scout_web/templates/transaction/overview.html.eex:48 msgid "This transaction is pending confirmation." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:63 -#: lib/block_scout_web/templates/transaction/overview.html.eex:133 +#: lib/block_scout_web/templates/block/overview.html.eex:65 +#: lib/block_scout_web/templates/transaction/overview.html.eex:140 msgid "Timestamp" msgstr "" @@ -2396,7 +2443,7 @@ msgstr "" #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:36 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:34 #: lib/block_scout_web/templates/address_transaction/index.html.eex:32 -#: lib/block_scout_web/templates/transaction/overview.html.eex:179 +#: lib/block_scout_web/templates/transaction/overview.html.eex:186 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_token_transfer_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 @@ -2493,22 +2540,22 @@ msgid "Tokens" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:252 +#: lib/block_scout_web/templates/transaction/overview.html.eex:259 msgid "Tokens Burnt" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:268 +#: lib/block_scout_web/templates/transaction/overview.html.eex:275 msgid "Tokens Created" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:235 +#: lib/block_scout_web/templates/transaction/overview.html.eex:242 msgid "Tokens Minted" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:219 +#: lib/block_scout_web/templates/transaction/overview.html.eex:226 msgid "Tokens Transferred" msgstr "" @@ -2529,7 +2576,7 @@ msgid "Topics" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:157 +#: lib/block_scout_web/templates/block/overview.html.eex:159 msgid "Total Difficulty" msgstr "" @@ -2544,17 +2591,17 @@ msgid "Total blocks" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:156 +#: lib/block_scout_web/templates/block/overview.html.eex:158 msgid "Total difficulty of the chain until this block." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:174 +#: lib/block_scout_web/templates/block/overview.html.eex:176 msgid "Total gas limit provided by all transactions in the block." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:298 +#: lib/block_scout_web/templates/transaction/overview.html.eex:304 msgid "Total transaction fee." msgstr "" @@ -2585,17 +2632,22 @@ msgid "Transaction %{transaction}, %{subnetwork} %{transaction}" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:32 +#: lib/block_scout_web/templates/transaction/overview.html.eex:379 +msgid "Transaction Burned Fee" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:39 msgid "Transaction Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:299 +#: lib/block_scout_web/templates/transaction/overview.html.eex:305 msgid "Transaction Fee" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:48 +#: lib/block_scout_web/templates/transaction/overview.html.eex:55 msgid "Transaction Hash" msgstr "" @@ -2606,14 +2658,24 @@ msgid "Transaction Inputs" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:342 +#: lib/block_scout_web/templates/transaction/overview.html.eex:329 +msgid "Transaction Type" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:398 msgid "Transaction number from the sending address. Each transaction sent from an address increments the nonce by 1." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:328 +msgid "Transaction type, introduced in EIP-2718." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:7 #: lib/block_scout_web/templates/address_transaction/index.html.eex:17 -#: lib/block_scout_web/templates/block/overview.html.eex:72 +#: lib/block_scout_web/templates/block/overview.html.eex:74 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/chain/show.html.eex:236 #: lib/block_scout_web/templates/layout/_topnav.html.eex:41 @@ -2661,7 +2723,7 @@ msgid "Type" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:368 +#: lib/block_scout_web/templates/transaction/overview.html.eex:424 msgid "UTF-8" msgstr "" @@ -2672,12 +2734,12 @@ msgid "Unable to find any pools you could claim a reward from." msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:74 +#: lib/block_scout_web/views/block_view.ex:75 msgid "Uncle Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:209 +#: lib/block_scout_web/templates/block/overview.html.eex:240 #: lib/block_scout_web/templates/layout/_topnav.html.eex:29 msgid "Uncles" msgstr "" @@ -2693,7 +2755,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:47 +#: lib/block_scout_web/templates/transaction/overview.html.eex:54 msgid "Unique character string (TxID) assigned to every verified transaction." msgstr "" @@ -2719,6 +2781,21 @@ msgstr "" msgid "Use the search box to find a hosted network, or select from the list of available networks below." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:358 +msgid "User defined maximum fee (tip) per unit of gas paid to validator for transaction prioritization." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:368 +msgid "User-defined tip sent to validator for transaction priority/inclusion." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:214 +msgid "User-defined tips sent to validator for transaction priority/inclusion." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:45 msgid "Validated" @@ -2755,12 +2832,12 @@ msgid "Validator pools can be banned for misbehavior (such as not revealing secr msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:283 +#: lib/block_scout_web/templates/transaction/overview.html.eex:290 msgid "Value" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:282 +#: lib/block_scout_web/templates/transaction/overview.html.eex:289 msgid "Value sent in the native token (and USD) if applicable." msgstr "" @@ -3011,7 +3088,7 @@ msgid "candidate" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:190 +#: lib/block_scout_web/templates/transaction/overview.html.eex:197 msgid "created" msgstr "" @@ -3089,3 +3166,8 @@ msgstr "" #: lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex:18 msgid "validator" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:205 +msgid "xDai burned from transactions included in the block (Base fee (per unit of gas) * Gas Used)." +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 191ca194e4..ab291a5b61 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -13,7 +13,7 @@ msgstr[0] "" msgstr[1] "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:27 +#: lib/block_scout_web/templates/block/_tile.html.eex:29 msgid "%{count} transaction" msgid_plural "%{count} transactions" msgstr[0] "" @@ -42,12 +42,12 @@ msgid "%{address} - %{subnetwork} Explorer" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:10 +#: lib/block_scout_web/templates/block/overview.html.eex:12 msgid "%{block_type} Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:47 +#: lib/block_scout_web/templates/block/overview.html.eex:49 msgid "%{block_type} Height" msgstr "" @@ -57,12 +57,12 @@ msgid "%{block_type}s" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:76 +#: lib/block_scout_web/templates/block/overview.html.eex:78 msgid "%{count} Transaction" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:78 +#: lib/block_scout_web/templates/block/overview.html.eex:80 #: lib/block_scout_web/templates/chain/_block.html.eex:11 msgid "%{count} Transactions" msgstr "" @@ -107,7 +107,7 @@ msgid "- We're indexing this chain right now. Some of the counts may be inaccura msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:183 +#: lib/block_scout_web/templates/block/overview.html.eex:185 msgid "64-bit hash of value verifying proof-of-work (note: null for POA chains)." msgstr "" @@ -123,7 +123,7 @@ msgid "

To become a candidate, your staking address must be funded with %{toke msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:86 +#: lib/block_scout_web/templates/block/overview.html.eex:88 msgid "A block producer who successfully included the block onto the blockchain." msgstr "" @@ -185,7 +185,7 @@ msgid "Action" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:332 +#: lib/block_scout_web/templates/transaction/overview.html.eex:388 msgid "Actual gas amount used by the transaction." msgstr "" @@ -197,12 +197,12 @@ msgid "Address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:175 +#: lib/block_scout_web/templates/transaction/overview.html.eex:182 msgid "Address (external or contract) receiving the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:155 +#: lib/block_scout_web/templates/transaction/overview.html.eex:162 msgid "Address (external or contract) sending the transaction." msgstr "" @@ -260,10 +260,15 @@ msgid "Amount of %{symbol} placed by an address." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:195 +#: lib/block_scout_web/templates/block/overview.html.eex:226 msgid "Amount of distributed reward. Miners receive a static block reward + Tx fees + uncle fees." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:378 +msgid "Amount of xDai burned for this transaction. Equals Block Base Fee per Gas * Gas Used." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." @@ -322,6 +327,11 @@ msgstr "" msgid "Banned until block #%{banned_until} (%{estimated_unban_day})" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:197 +msgid "Base Fee per Gas" +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:5 #: lib/block_scout_web/templates/api_docs/index.html.eex:5 @@ -337,14 +347,14 @@ msgid "Become a Candidate" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:353 +#: lib/block_scout_web/templates/transaction/overview.html.eex:409 msgid "Binary data included with the transaction. See input / logs below for additional info." msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_coin_balance/_coin_balances.html.eex:8 -#: lib/block_scout_web/templates/block/overview.html.eex:24 -#: lib/block_scout_web/templates/transaction/overview.html.eex:114 +#: lib/block_scout_web/templates/block/overview.html.eex:26 +#: lib/block_scout_web/templates/transaction/overview.html.eex:121 msgid "Block" msgstr "" @@ -366,7 +376,7 @@ msgid "Block Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:45 +#: lib/block_scout_web/templates/block/overview.html.eex:47 msgid "Block Height" msgstr "" @@ -381,7 +391,7 @@ msgid "Block Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:146 +#: lib/block_scout_web/templates/block/overview.html.eex:148 msgid "Block difficulty for miner, used to calibrate block generation time (Note: constant in POA based networks)." msgstr "" @@ -396,7 +406,7 @@ msgid "Block number" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:113 +#: lib/block_scout_web/templates/transaction/overview.html.eex:120 msgid "Block number containing the transaction." msgstr "" @@ -449,6 +459,12 @@ msgstr "" msgid "Bridged from Ethereum" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/_tile.html.eex:62 +#: lib/block_scout_web/templates/block/overview.html.eex:206 +msgid "Burnt Fees" +msgstr "" + #, elixir-format #: lib/block_scout_web/views/internal_transaction_view.ex:21 msgid "Call" @@ -500,7 +516,7 @@ msgid "Choose Target Pool" msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:62 +#: lib/block_scout_web/views/block_view.ex:63 msgid "Chore Reward" msgstr "" @@ -577,12 +593,12 @@ msgid "Confirmed" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:92 +#: lib/block_scout_web/templates/transaction/overview.html.eex:99 msgid "Confirmed by " msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:146 +#: lib/block_scout_web/templates/transaction/overview.html.eex:153 msgid "Confirmed within" msgstr "" @@ -623,7 +639,7 @@ msgid "Constructor Arguments" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:185 +#: lib/block_scout_web/templates/transaction/overview.html.eex:192 msgid "Contract" msgstr "" @@ -709,8 +725,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:37 #: lib/block_scout_web/templates/address/overview.html.eex:38 -#: lib/block_scout_web/templates/block/overview.html.eex:93 -#: lib/block_scout_web/templates/block/overview.html.eex:94 +#: lib/block_scout_web/templates/block/overview.html.eex:95 +#: lib/block_scout_web/templates/block/overview.html.eex:96 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:40 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:41 msgid "Copy Address" @@ -737,14 +753,14 @@ msgstr "" #: #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:14 #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:15 -#: lib/block_scout_web/templates/transaction/overview.html.eex:165 -#: lib/block_scout_web/templates/transaction/overview.html.eex:166 +#: lib/block_scout_web/templates/transaction/overview.html.eex:172 +#: lib/block_scout_web/templates/transaction/overview.html.eex:173 msgid "Copy From Address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:117 -#: lib/block_scout_web/templates/block/overview.html.eex:118 +#: lib/block_scout_web/templates/block/overview.html.eex:119 +#: lib/block_scout_web/templates/block/overview.html.eex:120 msgid "Copy Hash" msgstr "" @@ -754,8 +770,8 @@ msgid "Copy Metadata" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:137 -#: lib/block_scout_web/templates/block/overview.html.eex:138 +#: lib/block_scout_web/templates/block/overview.html.eex:139 +#: lib/block_scout_web/templates/block/overview.html.eex:140 msgid "Copy Parent Hash" msgstr "" @@ -774,10 +790,10 @@ msgstr "" #: #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:31 #: lib/block_scout_web/templates/transaction/_total_transfers_from_to.html.eex:32 -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 -#: lib/block_scout_web/templates/transaction/overview.html.eex:195 -#: lib/block_scout_web/templates/transaction/overview.html.eex:204 -#: lib/block_scout_web/templates/transaction/overview.html.eex:205 +#: lib/block_scout_web/templates/transaction/overview.html.eex:201 +#: lib/block_scout_web/templates/transaction/overview.html.eex:202 +#: lib/block_scout_web/templates/transaction/overview.html.eex:211 +#: lib/block_scout_web/templates/transaction/overview.html.eex:212 msgid "Copy To Address" msgstr "" @@ -788,30 +804,30 @@ msgid "Copy Token ID" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:55 +#: lib/block_scout_web/templates/transaction/overview.html.eex:62 msgid "Copy Transaction Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:56 +#: lib/block_scout_web/templates/transaction/overview.html.eex:63 msgid "Copy Txn Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:379 +#: lib/block_scout_web/templates/transaction/overview.html.eex:435 msgid "Copy Txn Hex Input" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:385 +#: lib/block_scout_web/templates/transaction/overview.html.eex:441 msgid "Copy Txn UTF-8 Input" msgstr "" #, elixir-format #: lib/block_scout_web/templates/log/_data_decoded_view.html.eex:20 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:38 -#: lib/block_scout_web/templates/transaction/overview.html.eex:378 -#: lib/block_scout_web/templates/transaction/overview.html.eex:384 +#: lib/block_scout_web/templates/transaction/overview.html.eex:434 +#: lib/block_scout_web/templates/transaction/overview.html.eex:440 msgid "Copy Value" msgstr "" @@ -861,7 +877,7 @@ msgid "Current Stake:" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:65 +#: lib/block_scout_web/templates/transaction/overview.html.eex:72 msgid "Current transaction state: Success, Failed (Error), or Pending (In Process)" msgstr "" @@ -879,12 +895,12 @@ msgid "Data" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:62 +#: lib/block_scout_web/templates/block/overview.html.eex:64 msgid "Date & time at which block was produced." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:132 +#: lib/block_scout_web/templates/transaction/overview.html.eex:139 msgid "Date & time of transaction inclusion, including length of time for confirmation." msgstr "" @@ -967,7 +983,7 @@ msgid "Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:147 +#: lib/block_scout_web/templates/block/overview.html.eex:149 msgid "Difficulty" msgstr "" @@ -1032,7 +1048,7 @@ msgid "Emission Contract" msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:70 +#: lib/block_scout_web/views/block_view.ex:71 msgid "Emission Reward" msgstr "" @@ -1150,7 +1166,7 @@ msgstr "" #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:42 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:40 #: lib/block_scout_web/templates/address_transaction/index.html.eex:38 -#: lib/block_scout_web/templates/transaction/overview.html.eex:156 +#: lib/block_scout_web/templates/transaction/overview.html.eex:163 #: lib/block_scout_web/views/address_internal_transaction_view.ex:9 #: lib/block_scout_web/views/address_token_transfer_view.ex:9 #: lib/block_scout_web/views/address_transaction_view.ex:9 @@ -1163,30 +1179,30 @@ msgid "GET" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:57 -#: lib/block_scout_web/templates/block/overview.html.eex:175 -#: lib/block_scout_web/templates/transaction/overview.html.eex:324 +#: lib/block_scout_web/templates/block/_tile.html.eex:65 +#: lib/block_scout_web/templates/block/overview.html.eex:177 +#: lib/block_scout_web/templates/transaction/overview.html.eex:340 msgid "Gas Limit" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:314 +#: lib/block_scout_web/templates/transaction/overview.html.eex:320 msgid "Gas Price" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:62 -#: lib/block_scout_web/templates/block/overview.html.eex:166 +#: lib/block_scout_web/templates/block/_tile.html.eex:70 +#: lib/block_scout_web/templates/block/overview.html.eex:168 msgid "Gas Used" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:333 +#: lib/block_scout_web/templates/transaction/overview.html.eex:389 msgid "Gas Used by Transaction" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:52 +#: lib/block_scout_web/templates/block/overview.html.eex:54 msgid "Genesis Block" msgstr "" @@ -1202,19 +1218,19 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/chain/show.html.eex:52 -#: lib/block_scout_web/views/block_view.ex:20 +#: lib/block_scout_web/views/block_view.ex:21 #: lib/block_scout_web/views/wei_helpers.ex:77 msgid "Gwei" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:111 +#: lib/block_scout_web/templates/block/overview.html.eex:113 msgid "Hash" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:361 -#: lib/block_scout_web/templates/transaction/overview.html.eex:365 +#: lib/block_scout_web/templates/transaction/overview.html.eex:417 +#: lib/block_scout_web/templates/transaction/overview.html.eex:421 msgid "Hex (Default)" msgstr "" @@ -1260,12 +1276,12 @@ msgid "Inactive Pool Addresses. Current validator pools are specified by a check msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:345 +#: lib/block_scout_web/templates/transaction/overview.html.eex:401 msgid "Index position of Transaction in the block." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:208 +#: lib/block_scout_web/templates/block/overview.html.eex:239 msgid "Index position(s) of referenced stale blocks." msgstr "" @@ -1285,7 +1301,7 @@ msgid "Input" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:177 +#: lib/block_scout_web/templates/transaction/overview.html.eex:184 msgid "Interacted With (To)" msgstr "" @@ -1378,22 +1394,22 @@ msgid "Likelihood of Becoming a Validator on the Next Epoch" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:267 +#: lib/block_scout_web/templates/transaction/overview.html.eex:274 msgid "List of ERC-1155 tokens created in the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:251 +#: lib/block_scout_web/templates/transaction/overview.html.eex:258 msgid "List of token burnt in the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:234 +#: lib/block_scout_web/templates/transaction/overview.html.eex:241 msgid "List of token minted in the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:218 +#: lib/block_scout_web/templates/transaction/overview.html.eex:225 msgid "List of token transferred in the transaction." msgstr "" @@ -1466,16 +1482,31 @@ msgstr "" msgid "Max Amount to Move:" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:349 +msgid "Max Fee per Gas" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:359 +msgid "Max Priority Fee per Gas" +msgstr "" + #, elixir-format #: lib/block_scout_web/views/transaction_view.ex:330 msgid "Max of" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:323 +#: lib/block_scout_web/templates/transaction/overview.html.eex:339 msgid "Maximum gas amount approved for the transaction." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:348 +msgid "Maximum total amount per unit of gas a user is willing to pay for a transaction, including base fee and priority fee." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/tokens/instance/metadata/index.html.eex:18 #: lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:10 @@ -1489,15 +1520,15 @@ msgid "Method Id" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:38 -#: lib/block_scout_web/templates/block/overview.html.eex:87 +#: lib/block_scout_web/templates/block/_tile.html.eex:40 +#: lib/block_scout_web/templates/block/overview.html.eex:89 #: lib/block_scout_web/templates/chain/_block.html.eex:15 msgid "Miner" msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:60 -#: lib/block_scout_web/views/block_view.ex:65 +#: lib/block_scout_web/views/block_view.ex:61 +#: lib/block_scout_web/views/block_view.ex:66 msgid "Miner Reward" msgstr "" @@ -1518,6 +1549,11 @@ msgstr "" msgid "Minimum Stake:" msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:196 +msgid "Minimum fee required per unit of gas. Fee adjusts based on network congestion." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/stakes/_stakes_modal_pool_info.html.eex:24 msgid "Mining Address:" @@ -1605,8 +1641,8 @@ msgid "No Information" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:184 -#: lib/block_scout_web/templates/transaction/overview.html.eex:343 +#: lib/block_scout_web/templates/block/overview.html.eex:186 +#: lib/block_scout_web/templates/transaction/overview.html.eex:399 msgid "Nonce" msgstr "" @@ -1667,7 +1703,7 @@ msgid "Parameters" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:127 +#: lib/block_scout_web/templates/block/overview.html.eex:129 msgid "Parent Hash" msgstr "" @@ -1722,12 +1758,12 @@ msgid "Pools searching is already in progress for this address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:345 +#: lib/block_scout_web/templates/transaction/overview.html.eex:401 msgid "Position" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:213 +#: lib/block_scout_web/templates/block/overview.html.eex:244 msgid "Position %{index}" msgstr "" @@ -1755,10 +1791,21 @@ msgid "Price" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:313 +#: lib/block_scout_web/templates/transaction/overview.html.eex:319 msgid "Price per unit of gas specified by the sender. Higher gas prices can prioritize transaction inclusion during times of high usage." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:215 +#: lib/block_scout_web/templates/transaction/overview.html.eex:369 +msgid "Priority Fee / Tip" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/_tile.html.eex:60 +msgid "Priority Fees" +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/common_components/_btn_qr_code.html.eex:10 #: lib/block_scout_web/templates/common_components/_modal_qr_code.html.eex:5 @@ -1777,7 +1824,7 @@ msgid "RPC" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:354 +#: lib/block_scout_web/templates/transaction/overview.html.eex:410 msgid "Raw Input" msgstr "" @@ -1854,17 +1901,17 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:66 +#: lib/block_scout_web/templates/transaction/overview.html.eex:73 msgid "Result" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:103 +#: lib/block_scout_web/templates/transaction/overview.html.eex:110 msgid "Revert reason" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/_tile.html.eex:48 +#: lib/block_scout_web/templates/block/_tile.html.eex:50 #: lib/block_scout_web/templates/chain/_block.html.eex:24 #: lib/block_scout_web/views/internal_transaction_view.ex:28 msgid "Reward" @@ -1966,12 +2013,12 @@ msgid "Show only those I have stake in" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:102 +#: lib/block_scout_web/templates/block/overview.html.eex:104 msgid "Size" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:101 +#: lib/block_scout_web/templates/block/overview.html.eex:103 msgid "Size of the block in bytes." msgstr "" @@ -2094,7 +2141,7 @@ msgid "Static Call" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:78 +#: lib/block_scout_web/templates/transaction/overview.html.eex:85 msgid "Status" msgstr "" @@ -2151,7 +2198,7 @@ msgid "The Number of Delegators in the Pool" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:110 +#: lib/block_scout_web/templates/block/overview.html.eex:112 msgid "The SHA256 hash of the block." msgstr "" @@ -2161,7 +2208,7 @@ msgid "The amount can be claimed after the current epoch finishes." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:43 +#: lib/block_scout_web/templates/block/overview.html.eex:45 msgid "The block height of a particular block is defined as the number of blocks preceding it in the blockchain." msgstr "" @@ -2181,7 +2228,7 @@ msgid "The first amount is the validator’s own stake, the second is the total msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:126 +#: lib/block_scout_web/templates/block/overview.html.eex:128 msgid "The hash of the block from which this block was generated." msgstr "" @@ -2191,7 +2238,7 @@ msgid "The number of delegators providing stake to the pool. Click on the number msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:71 +#: lib/block_scout_web/templates/block/overview.html.eex:73 msgid "The number of transactions in the block." msgstr "" @@ -2207,7 +2254,7 @@ msgid "The rest addresses are delegators of its pool." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:102 +#: lib/block_scout_web/templates/transaction/overview.html.eex:109 msgid "The revert reason of the transaction." msgstr "" @@ -2218,7 +2265,7 @@ msgid "The staking epochs for which the reward could be claimed (read-only field msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:77 +#: lib/block_scout_web/templates/transaction/overview.html.eex:84 msgid "The status of the transaction: Confirmed or Unconfirmed." msgstr "" @@ -2228,7 +2275,7 @@ msgid "The table refreshed block(s) ago." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:165 +#: lib/block_scout_web/templates/block/overview.html.eex:167 msgid "The total gas amount used in the block and its percentage of gas filled in the block." msgstr "" @@ -2382,13 +2429,13 @@ msgid "This pool is banned until block #%{banned_until} (%{estimated_unban_day}) msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:41 +#: lib/block_scout_web/templates/transaction/overview.html.eex:48 msgid "This transaction is pending confirmation." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:63 -#: lib/block_scout_web/templates/transaction/overview.html.eex:133 +#: lib/block_scout_web/templates/block/overview.html.eex:65 +#: lib/block_scout_web/templates/transaction/overview.html.eex:140 msgid "Timestamp" msgstr "" @@ -2396,7 +2443,7 @@ msgstr "" #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:36 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:34 #: lib/block_scout_web/templates/address_transaction/index.html.eex:32 -#: lib/block_scout_web/templates/transaction/overview.html.eex:179 +#: lib/block_scout_web/templates/transaction/overview.html.eex:186 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_token_transfer_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 @@ -2493,22 +2540,22 @@ msgid "Tokens" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:252 +#: lib/block_scout_web/templates/transaction/overview.html.eex:259 msgid "Tokens Burnt" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:268 +#: lib/block_scout_web/templates/transaction/overview.html.eex:275 msgid "Tokens Created" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:235 +#: lib/block_scout_web/templates/transaction/overview.html.eex:242 msgid "Tokens Minted" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:219 +#: lib/block_scout_web/templates/transaction/overview.html.eex:226 msgid "Tokens Transferred" msgstr "" @@ -2529,7 +2576,7 @@ msgid "Topics" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:157 +#: lib/block_scout_web/templates/block/overview.html.eex:159 msgid "Total Difficulty" msgstr "" @@ -2544,17 +2591,17 @@ msgid "Total blocks" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:156 +#: lib/block_scout_web/templates/block/overview.html.eex:158 msgid "Total difficulty of the chain until this block." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:174 +#: lib/block_scout_web/templates/block/overview.html.eex:176 msgid "Total gas limit provided by all transactions in the block." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:298 +#: lib/block_scout_web/templates/transaction/overview.html.eex:304 msgid "Total transaction fee." msgstr "" @@ -2585,17 +2632,22 @@ msgid "Transaction %{transaction}, %{subnetwork} %{transaction}" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:32 +#: lib/block_scout_web/templates/transaction/overview.html.eex:379 +msgid "Transaction Burned Fee" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:39 msgid "Transaction Details" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:299 +#: lib/block_scout_web/templates/transaction/overview.html.eex:305 msgid "Transaction Fee" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:48 +#: lib/block_scout_web/templates/transaction/overview.html.eex:55 msgid "Transaction Hash" msgstr "" @@ -2606,14 +2658,24 @@ msgid "Transaction Inputs" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:342 +#: lib/block_scout_web/templates/transaction/overview.html.eex:329 +msgid "Transaction Type" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:398 msgid "Transaction number from the sending address. Each transaction sent from an address increments the nonce by 1." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:328 +msgid "Transaction type, introduced in EIP-2718." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:7 #: lib/block_scout_web/templates/address_transaction/index.html.eex:17 -#: lib/block_scout_web/templates/block/overview.html.eex:72 +#: lib/block_scout_web/templates/block/overview.html.eex:74 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/chain/show.html.eex:236 #: lib/block_scout_web/templates/layout/_topnav.html.eex:41 @@ -2661,7 +2723,7 @@ msgid "Type" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:368 +#: lib/block_scout_web/templates/transaction/overview.html.eex:424 msgid "UTF-8" msgstr "" @@ -2672,12 +2734,12 @@ msgid "Unable to find any pools you could claim a reward from." msgstr "" #, elixir-format -#: lib/block_scout_web/views/block_view.ex:74 +#: lib/block_scout_web/views/block_view.ex:75 msgid "Uncle Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/block/overview.html.eex:209 +#: lib/block_scout_web/templates/block/overview.html.eex:240 #: lib/block_scout_web/templates/layout/_topnav.html.eex:29 msgid "Uncles" msgstr "" @@ -2693,7 +2755,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:47 +#: lib/block_scout_web/templates/transaction/overview.html.eex:54 msgid "Unique character string (TxID) assigned to every verified transaction." msgstr "" @@ -2719,6 +2781,21 @@ msgstr "" msgid "Use the search box to find a hosted network, or select from the list of available networks below." msgstr "" +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:358 +msgid "User defined maximum fee (tip) per unit of gas paid to validator for transaction prioritization." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:368 +msgid "User-defined tip sent to validator for transaction priority/inclusion." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:214 +msgid "User-defined tips sent to validator for transaction priority/inclusion." +msgstr "" + #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:45 msgid "Validated" @@ -2755,12 +2832,12 @@ msgid "Validator pools can be banned for misbehavior (such as not revealing secr msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:283 +#: lib/block_scout_web/templates/transaction/overview.html.eex:290 msgid "Value" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:282 +#: lib/block_scout_web/templates/transaction/overview.html.eex:289 msgid "Value sent in the native token (and USD) if applicable." msgstr "" @@ -3011,7 +3088,7 @@ msgid "candidate" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:190 +#: lib/block_scout_web/templates/transaction/overview.html.eex:197 msgid "created" msgstr "" @@ -3089,3 +3166,8 @@ msgstr "" #: lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex:18 msgid "validator" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:205 +msgid "xDai burned from transactions included in the block (Base fee (per unit of gas) * Gas Used)." +msgstr "" diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block.ex index cabb82e4f4..57f5e50f1d 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block.ex @@ -28,7 +28,8 @@ defmodule EthereumJSONRPC.Block do timestamp: DateTime.t(), total_difficulty: non_neg_integer(), transactions_root: EthereumJSONRPC.hash(), - uncles: [EthereumJSONRPC.hash()] + uncles: [EthereumJSONRPC.hash()], + base_fee_per_gas: non_neg_integer() } @typedoc """ @@ -65,6 +66,7 @@ defmodule EthereumJSONRPC.Block do * `uncles`: `t:list/0` of [uncles](https://bitcoin.stackexchange.com/questions/39329/in-ethereum-what-is-an-uncle-block) `t:EthereumJSONRPC.hash/0`. + * `"baseFeePerGas"` - `t:EthereumJSONRPC.quantity/0` of wei to denote amount of fee burned per unit gas used. Introduced in [EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) """ @type t :: %{String.t() => EthereumJSONRPC.data() | EthereumJSONRPC.hash() | EthereumJSONRPC.quantity() | nil} @@ -191,6 +193,96 @@ defmodule EthereumJSONRPC.Block do """ @spec elixir_to_params(elixir) :: params + def elixir_to_params( + %{ + "difficulty" => difficulty, + "extraData" => extra_data, + "gasLimit" => gas_limit, + "gasUsed" => gas_used, + "hash" => hash, + "logsBloom" => logs_bloom, + "miner" => miner_hash, + "number" => number, + "parentHash" => parent_hash, + "receiptsRoot" => receipts_root, + "sha3Uncles" => sha3_uncles, + "size" => size, + "stateRoot" => state_root, + "timestamp" => timestamp, + "totalDifficulty" => total_difficulty, + "transactionsRoot" => transactions_root, + "uncles" => uncles, + "baseFeePerGas" => base_fee_per_gas + } = elixir + ) do + %{ + difficulty: difficulty, + extra_data: extra_data, + gas_limit: gas_limit, + gas_used: gas_used, + hash: hash, + logs_bloom: logs_bloom, + miner_hash: miner_hash, + mix_hash: Map.get(elixir, "mixHash", "0x0"), + nonce: Map.get(elixir, "nonce", 0), + number: number, + parent_hash: parent_hash, + receipts_root: receipts_root, + sha3_uncles: sha3_uncles, + size: size, + state_root: state_root, + timestamp: timestamp, + total_difficulty: total_difficulty, + transactions_root: transactions_root, + uncles: uncles, + base_fee_per_gas: base_fee_per_gas + } + end + + def elixir_to_params( + %{ + "difficulty" => difficulty, + "extraData" => extra_data, + "gasLimit" => gas_limit, + "gasUsed" => gas_used, + "hash" => hash, + "logsBloom" => logs_bloom, + "miner" => miner_hash, + "number" => number, + "parentHash" => parent_hash, + "receiptsRoot" => receipts_root, + "sha3Uncles" => sha3_uncles, + "size" => size, + "stateRoot" => state_root, + "timestamp" => timestamp, + "transactionsRoot" => transactions_root, + "uncles" => uncles, + "baseFeePerGas" => base_fee_per_gas + } = elixir + ) do + %{ + difficulty: difficulty, + extra_data: extra_data, + gas_limit: gas_limit, + gas_used: gas_used, + hash: hash, + logs_bloom: logs_bloom, + miner_hash: miner_hash, + mix_hash: Map.get(elixir, "mixHash", "0x0"), + nonce: Map.get(elixir, "nonce", 0), + number: number, + parent_hash: parent_hash, + receipts_root: receipts_root, + sha3_uncles: sha3_uncles, + size: size, + state_root: state_root, + timestamp: timestamp, + transactions_root: transactions_root, + uncles: uncles, + base_fee_per_gas: base_fee_per_gas + } + end + def elixir_to_params( %{ "difficulty" => difficulty, diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex index 8b400d6595..37e0b35c89 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex @@ -40,7 +40,10 @@ defmodule EthereumJSONRPC.Transaction do * `"transactionIndex"` - `t:EthereumJSONRPC.quantity/0` for the index of the transaction in the block. `nil` when transaction is pending. * `"v"` - `t:EthereumJSONRPC.quantity/0` for the V field of the signature. - * `"value"` - `t:EthereumJSONRPC.quantity/0` of wei transferred + * `"value"` - `t:EthereumJSONRPC.quantity/0` of wei transferred. + * `"maxPriorityFeePerGas"` - `t:EthereumJSONRPC.quantity/0` of wei to denote max priority fee per unit of gas used. Introduced in [EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) + * `"maxFeePerGas"` - `t:EthereumJSONRPC.quantity/0` of wei to denote max fee per unit of gas used. Introduced in [EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) + * `"type"` - `t:EthereumJSONRPC.quantity/0` denotes transaction type. Introduced in [EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) """ @type t :: %{ String.t() => @@ -62,7 +65,10 @@ defmodule EthereumJSONRPC.Transaction do to_address_hash: EthereumJSONRPC.address(), v: non_neg_integer(), value: non_neg_integer(), - transaction_index: non_neg_integer() + transaction_index: non_neg_integer(), + max_priority_fee_per_gas: non_neg_integer(), + max_fee_per_gas: non_neg_integer(), + type: non_neg_integer() } @doc """ @@ -150,6 +156,100 @@ defmodule EthereumJSONRPC.Transaction do elixir_to_params(%{transaction | "input" => "0x"}) end + def elixir_to_params( + %{ + "blockHash" => block_hash, + "blockNumber" => block_number, + "from" => from_address_hash, + "gas" => gas, + "gasPrice" => gas_price, + "hash" => hash, + "input" => input, + "nonce" => nonce, + "r" => r, + "s" => s, + "to" => to_address_hash, + "transactionIndex" => index, + "v" => v, + "value" => value, + "type" => type, + "maxPriorityFeePerGas" => max_priority_fee_per_gas, + "maxFeePerGas" => max_fee_per_gas + } = transaction + ) do + result = %{ + block_hash: block_hash, + block_number: block_number, + from_address_hash: from_address_hash, + gas: gas, + gas_price: gas_price, + hash: hash, + index: index, + input: input, + nonce: nonce, + r: r, + s: s, + to_address_hash: to_address_hash, + v: v, + value: value, + transaction_index: index, + type: type, + max_priority_fee_per_gas: max_priority_fee_per_gas, + max_fee_per_gas: max_fee_per_gas + } + + if transaction["creates"] do + Map.put(result, :created_contract_address_hash, transaction["creates"]) + else + result + end + end + + def elixir_to_params( + %{ + "blockHash" => block_hash, + "blockNumber" => block_number, + "from" => from_address_hash, + "gas" => gas, + "gasPrice" => gas_price, + "hash" => hash, + "input" => input, + "nonce" => nonce, + "r" => r, + "s" => s, + "to" => to_address_hash, + "transactionIndex" => index, + "v" => v, + "value" => value, + "type" => type + } = transaction + ) do + result = %{ + block_hash: block_hash, + block_number: block_number, + from_address_hash: from_address_hash, + gas: gas, + gas_price: gas_price, + hash: hash, + index: index, + input: input, + nonce: nonce, + r: r, + s: s, + to_address_hash: to_address_hash, + v: v, + value: value, + transaction_index: index, + type: type + } + + if transaction["creates"] do + Map.put(result, :created_contract_address_hash, transaction["creates"]) + else + result + end + end + def elixir_to_params( %{ "blockHash" => block_hash, @@ -340,7 +440,9 @@ defmodule EthereumJSONRPC.Transaction do defp entry_to_elixir({"data", value}), do: {"input", value} - defp entry_to_elixir({key, quantity}) when key in ~w(gas gasPrice nonce r s standardV v value) and quantity != nil do + defp entry_to_elixir({key, quantity}) + when key in ~w(gas gasPrice nonce r s standardV v value type maxPriorityFeePerGas maxFeePerGas) and + quantity != nil do {key, quantity_to_integer(quantity)} end diff --git a/apps/explorer/config/config.exs b/apps/explorer/config/config.exs index f9684e0308..2abf32ba5f 100644 --- a/apps/explorer/config/config.exs +++ b/apps/explorer/config/config.exs @@ -21,7 +21,8 @@ config :explorer, if(System.get_env("DISABLE_WEBAPP") != "true", do: Explorer.Chain.Events.SimpleSender, else: Explorer.Chain.Events.DBSender - ) + ), + enabled_1559_support: System.get_env("ENABLE_1559_SUPPORT") == "true" config :explorer, Explorer.Counters.AverageBlockTime, enabled: true, @@ -106,6 +107,14 @@ config :explorer, Explorer.Counters.AddressTransactionsCounter, enabled: true, enable_consolidation: true +config :explorer, Explorer.Counters.BlockBurnedFeeCounter, + enabled: true, + enable_consolidation: true + +config :explorer, Explorer.Counters.BlockPriorityFeeCounter, + enabled: true, + enable_consolidation: true + bridge_market_cap_update_interval = if System.get_env("BRIDGE_MARKET_CAP_UPDATE_INTERVAL") do case Integer.parse(System.get_env("BRIDGE_MARKET_CAP_UPDATE_INTERVAL")) do diff --git a/apps/explorer/lib/explorer/application.ex b/apps/explorer/lib/explorer/application.ex index bb4429ae7b..b6ee12a58e 100644 --- a/apps/explorer/lib/explorer/application.ex +++ b/apps/explorer/lib/explorer/application.ex @@ -88,6 +88,8 @@ defmodule Explorer.Application do configure(Explorer.Counters.AddressTokenUsdSum), configure(Explorer.Counters.TokenHoldersCounter), configure(Explorer.Counters.TokenTransfersCounter), + configure(Explorer.Counters.BlockBurnedFeeCounter), + configure(Explorer.Counters.BlockPriorityFeeCounter), configure(Explorer.Counters.AverageBlockTime), configure(Explorer.Counters.Bridge), configure(Explorer.Validator.MetadataProcessor), diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 3a9807552a..bd44a70a5b 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -723,6 +723,52 @@ defmodule Explorer.Chain do |> Repo.all() end + @doc """ + Finds sum of gas_used for new (EIP-1559) txs belongs to block + """ + @spec block_to_gas_used_by_1559_txs(Hash.Full.t()) :: non_neg_integer() + def block_to_gas_used_by_1559_txs(block_hash) do + query = + from( + tx in Transaction, + where: tx.block_hash == ^block_hash, + where: not is_nil(tx.max_priority_fee_per_gas), + select: sum(tx.gas_used) + ) + + result = Repo.one(query) + if result, do: result, else: 0 + end + + @doc """ + Finds sum of priority fee for new (EIP-1559) txs belongs to block + """ + @spec block_to_priority_fee_of_1559_txs(Hash.Full.t()) :: Decimal.t() + def block_to_priority_fee_of_1559_txs(block_hash) do + block = Repo.get_by(Block, hash: block_hash) + %Wei{value: base_fee_per_gas} = block.base_fee_per_gas + + query = + from( + tx in Transaction, + where: tx.block_hash == ^block_hash, + where: not is_nil(tx.max_priority_fee_per_gas), + select: + sum( + fragment( + "Case When ? < ? Then ? Else ? End", + tx.max_fee_per_gas - ^base_fee_per_gas, + tx.max_priority_fee_per_gas, + (tx.max_fee_per_gas - ^base_fee_per_gas) * tx.gas_used, + tx.max_priority_fee_per_gas * tx.gas_used + ) + ) + ) + + result = Repo.one(query) + if result, do: result, else: 0 + end + @doc """ Counts the number of `t:Explorer.Chain.Transaction.t/0` in the `block`. """ diff --git a/apps/explorer/lib/explorer/chain/block.ex b/apps/explorer/lib/explorer/chain/block.ex index e47dd6648a..a2b91e9a45 100644 --- a/apps/explorer/lib/explorer/chain/block.ex +++ b/apps/explorer/lib/explorer/chain/block.ex @@ -7,10 +7,10 @@ defmodule Explorer.Chain.Block do use Explorer.Schema - alias Explorer.Chain.{Address, Gas, Hash, PendingBlockOperation, Transaction} + alias Explorer.Chain.{Address, Gas, Hash, PendingBlockOperation, Transaction, Wei} alias Explorer.Chain.Block.{Reward, SecondDegreeRelation} - @optional_attrs ~w(size refetch_needed total_difficulty difficulty)a + @optional_attrs ~w(size refetch_needed total_difficulty difficulty base_fee_per_gas)a @required_attrs ~w(consensus gas_limit gas_used hash miner_hash nonce number parent_hash timestamp)a @@ -46,6 +46,7 @@ defmodule Explorer.Chain.Block do * `timestamp` - When the block was collated * `total_difficulty` - the total `difficulty` of the chain until this block. * `transactions` - the `t:Explorer.Chain.Transaction.t/0` in this block. + * `base_fee_per_gas` - Minimum fee required per unit of gas. Fee adjusts based on network congestion. """ @type t :: %__MODULE__{ consensus: boolean(), @@ -62,7 +63,8 @@ defmodule Explorer.Chain.Block do timestamp: DateTime.t(), total_difficulty: difficulty(), transactions: %Ecto.Association.NotLoaded{} | [Transaction.t()], - refetch_needed: boolean() + refetch_needed: boolean(), + base_fee_per_gas: Wei.t() } @primary_key {:hash, Hash.Full, autogenerate: false} @@ -77,6 +79,7 @@ defmodule Explorer.Chain.Block do field(:timestamp, :utc_datetime_usec) field(:total_difficulty, :decimal) field(:refetch_needed, :boolean) + field(:base_fee_per_gas, Wei) timestamps() diff --git a/apps/explorer/lib/explorer/chain/transaction.ex b/apps/explorer/lib/explorer/chain/transaction.ex index f4ae5f52cc..bd8ca71267 100644 --- a/apps/explorer/lib/explorer/chain/transaction.ex +++ b/apps/explorer/lib/explorer/chain/transaction.ex @@ -29,12 +29,14 @@ defmodule Explorer.Chain.Transaction do alias Explorer.Chain.Transaction.{Fork, Status} - @optional_attrs ~w(block_hash block_number created_contract_address_hash cumulative_gas_used earliest_processing_start + @optional_attrs ~w(max_priority_fee_per_gas max_fee_per_gas block_hash block_number created_contract_address_hash cumulative_gas_used earliest_processing_start error gas_used index created_contract_code_indexed_at status to_address_hash revert_reason)a @required_attrs ~w(from_address_hash gas gas_price hash input nonce r s v value)a + @required_attrs_for_1559 ~w(type)a + @typedoc """ X coordinate module n in [Elliptic Curve Digital Signature Algorithm](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm) @@ -132,6 +134,9 @@ defmodule Explorer.Chain.Transaction do * `v` - The V field of the signature. * `value` - wei transferred from `from_address` to `to_address` * `revert_reason` - revert reason of transaction + * `max_priority_fee_per_gas` - User defined maximum fee (tip) per unit of gas paid to validator for transaction prioritization. + * `max_fee_per_gas` - Maximum total amount per unit of gas a user is willing to pay for a transaction, including base fee and priority fee. + * `type` - New transaction type identifier introduced in EIP 2718 (Berlin HF) """ @type t :: %__MODULE__{ block: %Ecto.Association.NotLoaded{} | Block.t() | nil, @@ -163,7 +168,10 @@ defmodule Explorer.Chain.Transaction do uncles: %Ecto.Association.NotLoaded{} | [Block.t()], v: v(), value: Wei.t(), - revert_reason: String.t() + revert_reason: String.t(), + max_priority_fee_per_gas: wei_per_gas | nil, + max_fee_per_gas: wei_per_gas | nil, + type: non_neg_integer() | nil } @derive {Poison.Encoder, @@ -225,6 +233,9 @@ defmodule Explorer.Chain.Transaction do field(:v, :decimal) field(:value, Wei) field(:revert_reason, :string) + field(:max_priority_fee_per_gas, Wei) + field(:max_fee_per_gas, Wei) + field(:type, :integer) # A transient field for deriving old block hash during transaction upserts. # Used to force refetch of a block in case a transaction is re-collated @@ -398,9 +409,18 @@ defmodule Explorer.Chain.Transaction do """ def changeset(%__MODULE__{} = transaction, attrs \\ %{}) do + enabled_1559 = Application.get_env(:explorer, :enabled_1559_support) + + required_attrs = if enabled_1559, do: @required_attrs ++ @required_attrs_for_1559, else: @required_attrs + + attrs_to_cast = + if enabled_1559, + do: @required_attrs ++ @required_attrs_for_1559 ++ @optional_attrs, + else: @required_attrs ++ @optional_attrs + transaction - |> cast(attrs, @required_attrs ++ @optional_attrs) - |> validate_required(@required_attrs) + |> cast(attrs, attrs_to_cast) + |> validate_required(required_attrs) |> validate_collated() |> validate_error() |> validate_status() diff --git a/apps/explorer/lib/explorer/chain/wei.ex b/apps/explorer/lib/explorer/chain/wei.ex index 24ab048ca0..71b68a6029 100644 --- a/apps/explorer/lib/explorer/chain/wei.ex +++ b/apps/explorer/lib/explorer/chain/wei.ex @@ -182,6 +182,12 @@ defmodule Explorer.Chain.Wei do |> from(:wei) end + def mult(%Wei{value: value}, %Decimal{} = multiplier) do + value + |> Decimal.mult(multiplier) + |> from(:wei) + end + @doc """ Converts `Decimal` representations of various wei denominations (wei, Gwei, ether) to a wei base unit. diff --git a/apps/explorer/lib/explorer/counters/block_burned_fee_counter.ex b/apps/explorer/lib/explorer/counters/block_burned_fee_counter.ex new file mode 100644 index 0000000000..eee5a97f15 --- /dev/null +++ b/apps/explorer/lib/explorer/counters/block_burned_fee_counter.ex @@ -0,0 +1,95 @@ +defmodule Explorer.Counters.BlockBurnedFeeCounter do + @moduledoc """ + Caches Block Burned Fee counter. + """ + use GenServer + + alias Explorer.Chain + + @cache_name :block_burned_fee_counter + + @ets_opts [ + :set, + :named_table, + :public, + read_concurrency: true + ] + + config = Application.get_env(:explorer, Explorer.Counters.BlockBurnedFeeCounter) + @enable_consolidation Keyword.get(config, :enable_consolidation) + + @spec start_link(term()) :: GenServer.on_start() + def start_link(_) do + GenServer.start_link(__MODULE__, :ok, name: __MODULE__) + end + + @impl true + def init(_args) do + create_cache_table() + + {:ok, %{consolidate?: enable_consolidation?()}, {:continue, :ok}} + end + + @impl true + def handle_continue(:ok, %{consolidate?: true} = state) do + {:noreply, state} + end + + @impl true + def handle_continue(:ok, state) do + {:noreply, state} + end + + @impl true + def handle_info(:consolidate, state) do + {:noreply, state} + end + + def fetch(block_hash) do + if does_not_exist?(block_hash) do + update_cache(block_hash) + end + + block_hash_string = get_block_hash_string(block_hash) + fetch_from_cache("#{block_hash_string}") + end + + def cache_name, do: @cache_name + + defp does_not_exist?(block_hash) do + block_hash_string = get_block_hash_string(block_hash) + :ets.lookup(@cache_name, "#{block_hash_string}") == [] + end + + defp update_cache(block_hash) do + block_hash_string = get_block_hash_string(block_hash) + new_data = Chain.block_to_gas_used_by_1559_txs(block_hash) + put_into_cache("#{block_hash_string}", new_data) + end + + defp fetch_from_cache(key) do + case :ets.lookup(@cache_name, key) do + [{_, value}] -> + value + + [] -> + 0 + end + end + + defp put_into_cache(key, value) do + :ets.insert(@cache_name, {key, value}) + end + + defp get_block_hash_string(block_hash) do + Base.encode16(block_hash.bytes, case: :lower) + end + + def create_cache_table do + if :ets.whereis(@cache_name) == :undefined do + :ets.new(@cache_name, @ets_opts) + end + end + + def enable_consolidation?, do: @enable_consolidation +end diff --git a/apps/explorer/lib/explorer/counters/block_priority_fee_counter.ex b/apps/explorer/lib/explorer/counters/block_priority_fee_counter.ex new file mode 100644 index 0000000000..ad0c5d48d9 --- /dev/null +++ b/apps/explorer/lib/explorer/counters/block_priority_fee_counter.ex @@ -0,0 +1,95 @@ +defmodule Explorer.Counters.BlockPriorityFeeCounter do + @moduledoc """ + Caches Block Burned Fee counter. + """ + use GenServer + + alias Explorer.Chain + + @cache_name :block_priority_fee_counter + + @ets_opts [ + :set, + :named_table, + :public, + read_concurrency: true + ] + + config = Application.get_env(:explorer, Explorer.Counters.BlockPriorityFeeCounter) + @enable_consolidation Keyword.get(config, :enable_consolidation) + + @spec start_link(term()) :: GenServer.on_start() + def start_link(_) do + GenServer.start_link(__MODULE__, :ok, name: __MODULE__) + end + + @impl true + def init(_args) do + create_cache_table() + + {:ok, %{consolidate?: enable_consolidation?()}, {:continue, :ok}} + end + + @impl true + def handle_continue(:ok, %{consolidate?: true} = state) do + {:noreply, state} + end + + @impl true + def handle_continue(:ok, state) do + {:noreply, state} + end + + @impl true + def handle_info(:consolidate, state) do + {:noreply, state} + end + + def fetch(block_hash) do + if does_not_exist?(block_hash) do + update_cache(block_hash) + end + + block_hash_string = get_block_hash_string(block_hash) + fetch_from_cache("#{block_hash_string}") + end + + def cache_name, do: @cache_name + + defp does_not_exist?(block_hash) do + block_hash_string = get_block_hash_string(block_hash) + :ets.lookup(@cache_name, "#{block_hash_string}") == [] + end + + defp update_cache(block_hash) do + block_hash_string = get_block_hash_string(block_hash) + new_data = Chain.block_to_priority_fee_of_1559_txs(block_hash) + put_into_cache("#{block_hash_string}", new_data) + end + + defp fetch_from_cache(key) do + case :ets.lookup(@cache_name, key) do + [{_, value}] -> + value + + [] -> + 0 + end + end + + defp put_into_cache(key, value) do + :ets.insert(@cache_name, {key, value}) + end + + defp get_block_hash_string(block_hash) do + Base.encode16(block_hash.bytes, case: :lower) + end + + def create_cache_table do + if :ets.whereis(@cache_name) == :undefined do + :ets.new(@cache_name, @ets_opts) + end + end + + def enable_consolidation?, do: @enable_consolidation +end diff --git a/apps/explorer/priv/repo/migrations/20210811140837_add_1559_support.exs b/apps/explorer/priv/repo/migrations/20210811140837_add_1559_support.exs new file mode 100644 index 0000000000..b83f65fc08 --- /dev/null +++ b/apps/explorer/priv/repo/migrations/20210811140837_add_1559_support.exs @@ -0,0 +1,15 @@ +defmodule Explorer.Repo.Migrations.Add1559Support do + use Ecto.Migration + + def change do + alter table(:transactions) do + add(:max_priority_fee_per_gas, :numeric, precision: 100, null: true) + add(:max_fee_per_gas, :numeric, precision: 100, null: true) + add(:type, :integer, null: true) + end + + alter table(:blocks) do + add(:base_fee_per_gas, :numeric, precision: 100, null: true) + end + end +end