Skip to content

Commit c5a45ac

Browse files
committed
feat: proof aggregation service address in home
1 parent 2b718f2 commit c5a45ac

2 files changed

Lines changed: 35 additions & 7 deletions

File tree

explorer/lib/explorer_web/components/contracts.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ defmodule ContractsComponent do
3131
contract_name: "OperatorStateRetriever",
3232
address: addresses["operatorStateRetriever"]
3333
},
34+
%{
35+
contract_name: "AlignedProofAggregationService",
36+
address: addresses["alignedProofAggregationService"]
37+
},
3438
%{
3539
contract_name: "RegistryCoordinator",
3640
address: addresses["registryCoordinator"]

explorer/lib/explorer_web/live/utils.ex

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,19 @@ defmodule ExplorerWeb.Helpers do
156156
end
157157

158158
def get_aligned_contracts_addresses() do
159+
Map.merge(get_batcher_service_addresses(), get_proof_aggregation_addresses())
160+
end
161+
162+
defp get_proof_aggregation_addresses() do
163+
proof_agg_config_file = System.get_env("ALIGNED_PROOF_AGG_CONFIG_FILE")
164+
{_, config_json_string} = File.read(proof_agg_config_file)
165+
proof_agg_service_addresses = Jason.decode!(config_json_string) |> Map.get("addresses")
166+
end
167+
168+
defp get_batcher_service_addresses() do
159169
aligned_config_file = System.get_env("ALIGNED_CONFIG_FILE")
160170
{_, config_json_string} = File.read(aligned_config_file)
161-
Jason.decode!(config_json_string) |> Map.get("addresses")
171+
agg_service_addresses = Jason.decode!(config_json_string) |> Map.get("addresses")
162172
end
163173

164174
def binary_to_hex_string(binary) do
@@ -228,22 +238,36 @@ defmodule Utils do
228238

229239
@batcher_submission_gas_cost Application.compile_env(:explorer, :batcher_submission_gas_cost)
230240
@aggregator_gas_cost Application.compile_env(:explorer, :aggregator_gas_cost)
231-
@aggregator_fee_percentage_multiplier Application.compile_env(:explorer, :aggregator_fee_percentage_multiplier)
241+
@aggregator_fee_percentage_multiplier Application.compile_env(
242+
:explorer,
243+
:aggregator_fee_percentage_multiplier
244+
)
232245
@percentage_divider Application.compile_env(:explorer, :percentage_divider)
233-
@additional_submission_gas_cost_per_proof Application.compile_env(:explorer, :additional_submission_gas_cost_per_proof)
246+
@additional_submission_gas_cost_per_proof Application.compile_env(
247+
:explorer,
248+
:additional_submission_gas_cost_per_proof
249+
)
234250

235251
def scheduled_batch_interval() do
236252
default_value = 10
253+
237254
case System.get_env("SCHEDULED_BATCH_INTERVAL_MINUTES") do
238255
nil ->
239-
Logger.warning("SCHEDULED_BATCH_INTERVAL_MINUTES .env var is not set, using default value: #{default_value}")
256+
Logger.warning(
257+
"SCHEDULED_BATCH_INTERVAL_MINUTES .env var is not set, using default value: #{default_value}"
258+
)
259+
240260
default_value
261+
241262
value ->
242263
try do
243264
String.to_integer(value)
244265
rescue
245266
ArgumentError ->
246-
Logger.warning("Invalid SCHEDULED_BATCH_INTERVAL_MINUTES .env var: #{value}, using default value: #{default_value}")
267+
Logger.warning(
268+
"Invalid SCHEDULED_BATCH_INTERVAL_MINUTES .env var: #{value}, using default value: #{default_value}"
269+
)
270+
247271
default_value
248272
end
249273
end
@@ -457,8 +481,8 @@ defmodule Utils do
457481
def constant_batch_submission_gas_cost() do
458482
trunc(
459483
@aggregator_gas_cost * @aggregator_fee_percentage_multiplier /
460-
@percentage_divider +
461-
@batcher_submission_gas_cost
484+
@percentage_divider +
485+
@batcher_submission_gas_cost
462486
)
463487
end
464488

0 commit comments

Comments
 (0)