From 0d016cb5109c71353b42985e91dec517d3be0e39 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Tue, 25 Jul 2023 14:03:31 -0300 Subject: [PATCH 1/3] Disable local verification --- .../live/pages/block_detail.ex | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/starknet_explorer_web/live/pages/block_detail.ex b/lib/starknet_explorer_web/live/pages/block_detail.ex index 4741f6a8..476085c9 100644 --- a/lib/starknet_explorer_web/live/pages/block_detail.ex +++ b/lib/starknet_explorer_web/live/pages/block_detail.ex @@ -83,7 +83,8 @@ defmodule StarknetExplorerWeb.BlockDetailLive do assigns = [ block: block, view: "overview", - verification: "Pending" + verification: "Pending", + enable_verification: false ] {:ok, assign(socket, assigns)} @@ -104,8 +105,6 @@ defmodule StarknetExplorerWeb.BlockDetailLive do @impl true def handle_event("block-verified", %{"result" => result}, socket) do - IO.inspect(result, label: "Block verification result") - verification = case result do true -> @@ -186,25 +185,27 @@ defmodule StarknetExplorerWeb.BlockDetailLive do # Do not hardcode: # - Total Execeution Resources # - Gas Price - def render_info(assigns = %{block: _block, view: "overview"}) do + def render_info(assigns = %{block: _block, view: "overview", enable_verification: _}) do ~H""" -
-
- Local Verification -
-
-
- - <%= @verification %> - + <%= if @enable_verification do %> +
+
+ Local Verification +
+
+
+ + <%= @verification %> + +
-
+ <% end %>
Block Hash
Date: Tue, 25 Jul 2023 14:03:51 -0300 Subject: [PATCH 2/3] Mix format --- config/runtime.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/runtime.exs b/config/runtime.exs index 8af7b217..6ccbf5b0 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -72,7 +72,7 @@ if config_env() == :prod do check_origin: [ "https://madaraexplorer.com", "https://www.madaraexplorer.com", - "https://madaraexplorer.lambdaclass.com", + "https://madaraexplorer.lambdaclass.com" ], http: [ # Enable IPv6 and bind on all interfaces. From d2feadc34a9c809bea2f69bdfd68afcbe9121e50 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Wed, 26 Jul 2023 12:52:13 -0300 Subject: [PATCH 3/3] Add block verification enable as env variable --- config/runtime.exs | 3 +++ lib/starknet_explorer_web/live/pages/block_detail.ex | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/runtime.exs b/config/runtime.exs index 6ccbf5b0..4b29e317 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -35,6 +35,9 @@ config :ex_aws, secret_access_key: System.get_env("AWS_SECRET_ACCESS_KEY"), region: System.get_env("AWS_REGION") +config :starknet_explorer, + enable_block_verification: System.get_env("ENABLE_BLOCK_VERIFICATION") || false + if config_env() == :prod do database_url = System.get_env("DATABASE_URL") || diff --git a/lib/starknet_explorer_web/live/pages/block_detail.ex b/lib/starknet_explorer_web/live/pages/block_detail.ex index 476085c9..a09504e3 100644 --- a/lib/starknet_explorer_web/live/pages/block_detail.ex +++ b/lib/starknet_explorer_web/live/pages/block_detail.ex @@ -84,7 +84,7 @@ defmodule StarknetExplorerWeb.BlockDetailLive do block: block, view: "overview", verification: "Pending", - enable_verification: false + enable_verification: Application.get_env(:starknet_explorer, :enable_block_verification) ] {:ok, assign(socket, assigns)}