Skip to content

Commit 2c5c33a

Browse files
authored
Merge branch 'testnet' into 1566-docs-add-list-of-supported-strategies-and-contract-addresses
2 parents 1a0e754 + 3144c96 commit 2c5c33a

File tree

9 files changed

+28
-11
lines changed

9 files changed

+28
-11
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,11 +838,11 @@ explorer_recover_db: explorer_run_db
838838

839839
explorer_fetch_old_batches:
840840
@cd explorer && \
841-
./scripts/fetch_old_batches.sh 1728056 1729806
841+
./scripts/fetch_old_batches.sh $(FROM_BLOCK) $(TO_BLOCK)
842842

843-
explorer_fetch_old_operators_strategies_restakes:
843+
explorer_fetch_old_operators_strategies_restakes: # recommended for prod: 19000000
844844
@cd explorer && \
845-
./scripts/fetch_old_operators_strategies_restakes.sh 0
845+
./scripts/fetch_old_operators_strategies_restakes.sh $(FROM_BLOCK)
846846

847847
explorer_create_env:
848848
@cd explorer && \

core/chainio/avs_writer.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
100100
// Set the nonce, as we might have to replace the transaction with a higher gas price
101101
txNonce := big.NewInt(int64(simTx.Nonce()))
102102
txOpts.Nonce = txNonce
103-
txOpts.GasPrice = simTx.GasPrice()
103+
txOpts.GasPrice = nil
104104
txOpts.NoSend = false
105105
i := 0
106106

@@ -113,7 +113,16 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
113113
if err != nil {
114114
return nil, err
115115
}
116-
previousTxGasPrice := txOpts.GasPrice
116+
117+
// if txOpts.GasPrice wasn't previously set use the fetched gasPrice
118+
// this should happen on the first iteration only
119+
var previousTxGasPrice *big.Int
120+
if txOpts.GasPrice == nil {
121+
previousTxGasPrice = gasPrice
122+
} else {
123+
previousTxGasPrice = txOpts.GasPrice
124+
}
125+
117126
// in order to avoid replacement transaction underpriced
118127
// the bumped gas price has to be at least 10% higher than the previous one.
119128
minimumGasPriceBump := utils.CalculateGasPriceBumpBasedOnRetry(previousTxGasPrice, 10, 0, gasBumpPercentageLimit, 0)

explorer/lib/explorer/contract_managers/aligned_layer_service_manager.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defmodule AlignedLayerServiceManager do
3737
@first_block (case @environment do
3838
"devnet" -> 0
3939
"holesky" -> 1_728_056
40-
"mainnet" -> 20_020_000
40+
"mainnet" -> 19_000_000
4141
_ -> raise("Invalid environment")
4242
end)
4343

explorer/lib/explorer/contract_managers/batcher_payment_service_manager.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule BatcherPaymentServiceManager do
77
@first_block (case @environment do
88
"devnet" -> 0
99
"holesky" -> 1_728_056
10-
"mainnet" -> 20_020_000
10+
"mainnet" -> 19_000_000
1111
_ -> raise("Invalid environment")
1212
end)
1313

explorer/lib/explorer/contract_managers/delegation_manager.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule DelegationManager do
66
@first_block (case @environment do
77
"devnet" -> 0
88
"holesky" -> 1_210_000
9-
"mainnet" -> 20_020_000
9+
"mainnet" -> 19_000_000
1010
_ -> raise("Invalid environment")
1111
end)
1212

explorer/lib/scripts/fetch_old_batches.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule Scripts.FetchOldBatches do
1111

1212
def fetch_old_events(fromBlock, toBlock) do
1313
"Fetching old events, from #{fromBlock} to #{toBlock}" |> Logger.debug()
14-
chunk_size = 32 # do in smaller chunks, if there are too many blocks to process
14+
chunk_size = 500 # do in smaller chunks, if there are too many blocks to process
1515
chunkify(fromBlock, toBlock, chunk_size) |> Enum.each(&make_request/1)
1616
"✅ Done fetching old events" |> Logger.debug()
1717
end

explorer/scripts/fetch_old_batches.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ export ALIGNED_CONFIG_FILE=$ALIGNED_CONFIG_FILE
1414

1515
if [ "$#" -eq 0 ]; then
1616
echo "Error, No arguments provided."
17+
echo "Try running the make target with FROM_BLOCK=<n> TO_BLOCK=<m>"
1718
exit 1
1819
elif [ "$#" -eq 2 ]; then
1920
# Two arguments provided, use them
2021
FROM=$1
2122
TO=$2
2223
else
2324
echo "Please provide 2 arguments."
25+
echo "Try running the make target with FROM_BLOCK=<n> TO_BLOCK=<m>"
2426
exit 1
2527
fi
2628

@@ -29,4 +31,4 @@ echo "Running fetch_old_batches.sh from block: $FROM to block: $TO"
2931

3032
mix compile --force #force recompile to get the latest .env values
3133

32-
iex --sname fetch_old_batches --remsh explorer@$ELIXIR_HOSTNAME -S mix run -e "Scripts.FetchOldBatches.run($FROM, $TO)"
34+
iex --sname fetch_old_batches --remsh explorer@$ELIXIR_HOSTNAME -S mix run -e "Scripts.FetchOldBatches.run($FROM, $TO)"

explorer/scripts/fetch_old_operators_strategies_restakes.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export ALIGNED_CONFIG_FILE=$ALIGNED_CONFIG_FILE
1414

1515
if [ "$#" -eq 0 ]; then
1616
echo "Error, No arguments provided."
17+
echo "Try running the make target with FROM_BLOCK=<n>"
1718
exit 1
1819
elif [ "$#" -eq 1 ]; then
1920
# argument provided, use it

telemetry_api/lib/telemetry_api/contract_managers/delegation_manager.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule TelemetryApi.ContractManagers.DelegationManager do
77
@first_block (case @environment do
88
"devnet" -> 0
99
"holesky" -> 1_210_000
10-
"mainnet" -> 20_020_000
10+
"mainnet" -> 19_000_000
1111
_ -> raise("Invalid environment")
1212
end)
1313

@@ -40,12 +40,17 @@ defmodule TelemetryApi.ContractManagers.DelegationManager do
4040
DelegationManager.EventFilters.operator_metadata_uri_updated(operator_address)
4141
|> Ethers.get_logs(fromBlock: @first_block)
4242
|> case do
43+
{:ok, []} ->
44+
Logger.warning("Url not found using first_block=#{@first_block}")
45+
{:error, "Url not found using first_block=#{@first_block}"}
46+
4347
{:ok, data} ->
4448
# The head (hd) is the most recent entry
4549
url = List.last(data).data |> hd()
4650
{:ok, url}
4751

4852
{:error, reason} ->
53+
Logger.warning("Error while fetching url: #{inspect(reason)}")
4954
{:error, reason}
5055

5156
other ->

0 commit comments

Comments
 (0)