From c8279808f019c0d0f95dcf9d6a4aa029579995df Mon Sep 17 00:00:00 2001 From: Urix <43704209+uri-99@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:20:01 -0300 Subject: [PATCH 1/4] fix: fetch operator metadata in mainnet --- Makefile | 4 ++-- .../contract_managers/aligned_layer_service_manager.ex | 2 +- .../contract_managers/batcher_payment_service_manager.ex | 2 +- explorer/lib/explorer/contract_managers/delegation_manager.ex | 2 +- explorer/scripts/fetch_old_operators_strategies_restakes.sh | 1 + .../lib/telemetry_api/contract_managers/delegation_manager.ex | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8af22326ed..668fc73a56 100644 --- a/Makefile +++ b/Makefile @@ -839,9 +839,9 @@ explorer_fetch_old_batches: @cd explorer && \ ./scripts/fetch_old_batches.sh 1728056 1729806 -explorer_fetch_old_operators_strategies_restakes: +explorer_fetch_old_operators_strategies_restakes: # recommended for prod: 19000000 @cd explorer && \ - ./scripts/fetch_old_operators_strategies_restakes.sh 0 + ./scripts/fetch_old_operators_strategies_restakes.sh $(FROM_BLOCK) explorer_create_env: @cd explorer && \ diff --git a/explorer/lib/explorer/contract_managers/aligned_layer_service_manager.ex b/explorer/lib/explorer/contract_managers/aligned_layer_service_manager.ex index bc276bba4b..a3d9d61d92 100644 --- a/explorer/lib/explorer/contract_managers/aligned_layer_service_manager.ex +++ b/explorer/lib/explorer/contract_managers/aligned_layer_service_manager.ex @@ -37,7 +37,7 @@ defmodule AlignedLayerServiceManager do @first_block (case @environment do "devnet" -> 0 "holesky" -> 1_728_056 - "mainnet" -> 20_020_000 + "mainnet" -> 19_000_000 _ -> raise("Invalid environment") end) diff --git a/explorer/lib/explorer/contract_managers/batcher_payment_service_manager.ex b/explorer/lib/explorer/contract_managers/batcher_payment_service_manager.ex index 9dcfe04663..1926310fa2 100644 --- a/explorer/lib/explorer/contract_managers/batcher_payment_service_manager.ex +++ b/explorer/lib/explorer/contract_managers/batcher_payment_service_manager.ex @@ -7,7 +7,7 @@ defmodule BatcherPaymentServiceManager do @first_block (case @environment do "devnet" -> 0 "holesky" -> 1_728_056 - "mainnet" -> 20_020_000 + "mainnet" -> 19_000_000 _ -> raise("Invalid environment") end) diff --git a/explorer/lib/explorer/contract_managers/delegation_manager.ex b/explorer/lib/explorer/contract_managers/delegation_manager.ex index 696f9b4130..0975245ebb 100644 --- a/explorer/lib/explorer/contract_managers/delegation_manager.ex +++ b/explorer/lib/explorer/contract_managers/delegation_manager.ex @@ -6,7 +6,7 @@ defmodule DelegationManager do @first_block (case @environment do "devnet" -> 0 "holesky" -> 1_210_000 - "mainnet" -> 20_020_000 + "mainnet" -> 19_000_000 _ -> raise("Invalid environment") end) diff --git a/explorer/scripts/fetch_old_operators_strategies_restakes.sh b/explorer/scripts/fetch_old_operators_strategies_restakes.sh index eb6c57f05b..e1a6fec724 100755 --- a/explorer/scripts/fetch_old_operators_strategies_restakes.sh +++ b/explorer/scripts/fetch_old_operators_strategies_restakes.sh @@ -14,6 +14,7 @@ export ALIGNED_CONFIG_FILE=$ALIGNED_CONFIG_FILE if [ "$#" -eq 0 ]; then echo "Error, No arguments provided." + echo "Try running the make target with BLOCK_NUMBER=" exit 1 elif [ "$#" -eq 1 ]; then # argument provided, use it diff --git a/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex b/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex index 920c7a8f56..ac336a72cf 100644 --- a/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex +++ b/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex @@ -7,7 +7,7 @@ defmodule TelemetryApi.ContractManagers.DelegationManager do @first_block (case @environment do "devnet" -> 0 "holesky" -> 1_210_000 - "mainnet" -> 20_020_000 + "mainnet" -> 19_000_000 _ -> raise("Invalid environment") end) From 2f419131f2d3f6793e10213719bd0acabc968b91 Mon Sep 17 00:00:00 2001 From: Urix <43704209+uri-99@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:30:49 -0300 Subject: [PATCH 2/4] fix: fetch old batches polish --- Makefile | 2 +- explorer/lib/scripts/fetch_old_batches.ex | 2 +- explorer/scripts/fetch_old_batches.sh | 2 ++ explorer/scripts/fetch_old_operators_strategies_restakes.sh | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 668fc73a56..2e66ec9b44 100644 --- a/Makefile +++ b/Makefile @@ -837,7 +837,7 @@ explorer_recover_db: explorer_run_db explorer_fetch_old_batches: @cd explorer && \ - ./scripts/fetch_old_batches.sh 1728056 1729806 + ./scripts/fetch_old_batches.sh $(FROM_BLOCK) $(TO_BLOCK) explorer_fetch_old_operators_strategies_restakes: # recommended for prod: 19000000 @cd explorer && \ diff --git a/explorer/lib/scripts/fetch_old_batches.ex b/explorer/lib/scripts/fetch_old_batches.ex index f691f732af..2d53fb346c 100644 --- a/explorer/lib/scripts/fetch_old_batches.ex +++ b/explorer/lib/scripts/fetch_old_batches.ex @@ -11,7 +11,7 @@ defmodule Scripts.FetchOldBatches do def fetch_old_events(fromBlock, toBlock) do "Fetching old events, from #{fromBlock} to #{toBlock}" |> Logger.debug() - chunk_size = 32 # do in smaller chunks, if there are too many blocks to process + chunk_size = 500 # do in smaller chunks, if there are too many blocks to process chunkify(fromBlock, toBlock, chunk_size) |> Enum.each(&make_request/1) "✅ Done fetching old events" |> Logger.debug() end diff --git a/explorer/scripts/fetch_old_batches.sh b/explorer/scripts/fetch_old_batches.sh index dac3ddd725..542a4189bc 100755 --- a/explorer/scripts/fetch_old_batches.sh +++ b/explorer/scripts/fetch_old_batches.sh @@ -14,6 +14,7 @@ export ALIGNED_CONFIG_FILE=$ALIGNED_CONFIG_FILE if [ "$#" -eq 0 ]; then echo "Error, No arguments provided." + echo "Try running the make target with FROM_BLOCK= TO_BLOCK=" exit 1 elif [ "$#" -eq 2 ]; then # Two arguments provided, use them @@ -21,6 +22,7 @@ elif [ "$#" -eq 2 ]; then TO=$2 else echo "Please provide 2 arguments." + echo "Try running the make target with FROM_BLOCK= TO_BLOCK=" exit 1 fi diff --git a/explorer/scripts/fetch_old_operators_strategies_restakes.sh b/explorer/scripts/fetch_old_operators_strategies_restakes.sh index e1a6fec724..0706306ffd 100755 --- a/explorer/scripts/fetch_old_operators_strategies_restakes.sh +++ b/explorer/scripts/fetch_old_operators_strategies_restakes.sh @@ -14,7 +14,7 @@ export ALIGNED_CONFIG_FILE=$ALIGNED_CONFIG_FILE if [ "$#" -eq 0 ]; then echo "Error, No arguments provided." - echo "Try running the make target with BLOCK_NUMBER=" + echo "Try running the make target with FROM_BLOCK=" exit 1 elif [ "$#" -eq 1 ]; then # argument provided, use it From b3741cdde819db58aa41914c890a9194ed85182b Mon Sep 17 00:00:00 2001 From: Urix <43704209+uri-99@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:02:23 -0300 Subject: [PATCH 3/4] revert: fix of telemetry --- .../lib/telemetry_api/contract_managers/delegation_manager.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex b/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex index ac336a72cf..920c7a8f56 100644 --- a/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex +++ b/telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex @@ -7,7 +7,7 @@ defmodule TelemetryApi.ContractManagers.DelegationManager do @first_block (case @environment do "devnet" -> 0 "holesky" -> 1_210_000 - "mainnet" -> 19_000_000 + "mainnet" -> 20_020_000 _ -> raise("Invalid environment") end) From 9763d8b794f58d78dfd6798053a08a7e9259a956 Mon Sep 17 00:00:00 2001 From: Urix <43704209+uri-99@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:10:40 -0300 Subject: [PATCH 4/4] fix: add eof \n --- explorer/scripts/fetch_old_batches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explorer/scripts/fetch_old_batches.sh b/explorer/scripts/fetch_old_batches.sh index 542a4189bc..4c32c236ee 100755 --- a/explorer/scripts/fetch_old_batches.sh +++ b/explorer/scripts/fetch_old_batches.sh @@ -31,4 +31,4 @@ echo "Running fetch_old_batches.sh from block: $FROM to block: $TO" mix compile --force #force recompile to get the latest .env values -iex --sname fetch_old_batches --remsh explorer@$ELIXIR_HOSTNAME -S mix run -e "Scripts.FetchOldBatches.run($FROM, $TO)" \ No newline at end of file +iex --sname fetch_old_batches --remsh explorer@$ELIXIR_HOSTNAME -S mix run -e "Scripts.FetchOldBatches.run($FROM, $TO)"