From 8c719fb0803a058dbf196ddeae6a2cd0251b8be2 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Mon, 14 Oct 2024 13:15:46 -0300 Subject: [PATCH] Fixed a random error on startup, specially happening on holesky --- lib/lambda_ethereum_consensus/beacon/checkpoint_sync.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lambda_ethereum_consensus/beacon/checkpoint_sync.ex b/lib/lambda_ethereum_consensus/beacon/checkpoint_sync.ex index 0e27b2c3f..3a782d4b3 100644 --- a/lib/lambda_ethereum_consensus/beacon/checkpoint_sync.ex +++ b/lib/lambda_ethereum_consensus/beacon/checkpoint_sync.ex @@ -19,7 +19,7 @@ defmodule LambdaEthereumConsensus.Beacon.CheckpointSync do def get_finalized_block_and_state(url, genesis_validators_root) do tasks = [Task.async(__MODULE__, :get_state, [url]), Task.async(__MODULE__, :get_block, [url])] - case Task.await_many(tasks, 60_000) do + case Task.await_many(tasks, 90_000) do [{:ok, state}, {:ok, block}] -> if state.genesis_validators_root == genesis_validators_root do check_match(url, state, block) @@ -92,8 +92,8 @@ defmodule LambdaEthereumConsensus.Beacon.CheckpointSync do defp get_json_from_url(base_url, path) do full_url = concat_url(base_url, path) - with {:ok, response} <- get(full_url) do - {:ok, response.body |> Map.fetch!("data") |> parse_json()} + with {:ok, %{body: %{"data" => data}}} <- get(full_url) do + {:ok, parse_json(data)} end end