Skip to content

Commit

Permalink
Merge 399c50c into f0d9115
Browse files Browse the repository at this point in the history
  • Loading branch information
JuArce authored Dec 5, 2024
2 parents f0d9115 + 399c50c commit 27fe5d7
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,11 @@ 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:
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 && \
Expand Down
2 changes: 1 addition & 1 deletion aligned.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "Aligned",
"website": "https://alignedlayer.com",
"description": "Aligned Layer is a verification layer for zero-knowledge proofs using Eigen Layer. Our mission is to accelerate the adoption of zero-knowledge and validity proofs on Ethereum",
"logo": "https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/logo.png",
"logo": "https://raw.githubusercontent.com/yetanotherco/aligned_layer/testnet/logo.png",
"twitter": "https://twitter.com/alignedlayer"
}
4 changes: 3 additions & 1 deletion batcher/aligned-sdk/src/core/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ pub enum Network {
Devnet,
Holesky,
HoleskyStage,
Mainnet,
}

impl FromStr for Network {
Expand All @@ -411,8 +412,9 @@ impl FromStr for Network {
"holesky" => Ok(Network::Holesky),
"holesky-stage" => Ok(Network::HoleskyStage),
"devnet" => Ok(Network::Devnet),
"mainnet" => Ok(Network::Mainnet),
_ => Err(
"Invalid network, possible values are: \"holesky\", \"holesky-stage\", \"devnet\""
"Invalid network, possible values are: \"holesky\", \"holesky-stage\", \"devnet\", \"mainnet\""
.to_string(),
),
}
Expand Down
2 changes: 2 additions & 0 deletions batcher/aligned-sdk/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ pub fn get_payment_service_address(network: Network) -> ethers::types::H160 {
Network::HoleskyStage => {
H160::from_str("0x7577Ec4ccC1E6C529162ec8019A49C13F6DAd98b").unwrap()
}
Network::Mainnet => H160::from_str("0xb0567184A52cB40956df6333510d6eF35B89C8de").unwrap(),
}
}

Expand All @@ -288,6 +289,7 @@ pub fn get_aligned_service_manager_address(network: Network) -> ethers::types::H
Network::HoleskyStage => {
H160::from_str("0x9C5231FC88059C086Ea95712d105A2026048c39B").unwrap()
}
Network::Mainnet => H160::from_str("0xeF2A435e5EE44B2041100EF8cbC8ae035166606c").unwrap(),
}
}

Expand Down
2 changes: 2 additions & 0 deletions batcher/aligned-task-sender/src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ pub enum NetworkArg {
Devnet,
Holesky,
HoleskyStage,
Mainnet,
}

impl From<NetworkArg> for Network {
Expand All @@ -163,6 +164,7 @@ impl From<NetworkArg> for Network {
NetworkArg::Devnet => Network::Devnet,
NetworkArg::Holesky => Network::Holesky,
NetworkArg::HoleskyStage => Network::HoleskyStage,
NetworkArg::Mainnet => Network::Mainnet,
}
}
}
2 changes: 2 additions & 0 deletions batcher/aligned/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ enum NetworkArg {
Devnet,
Holesky,
HoleskyStage,
Mainnet,
}

impl From<NetworkArg> for Network {
Expand All @@ -231,6 +232,7 @@ impl From<NetworkArg> for Network {
NetworkArg::Devnet => Network::Devnet,
NetworkArg::Holesky => Network::Holesky,
NetworkArg::HoleskyStage => Network::HoleskyStage,
NetworkArg::Mainnet => Network::Mainnet,
}
}
}
Expand Down
54 changes: 51 additions & 3 deletions contracts/script/deploy/config/mainnet/aligned.mainnet.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chainInfo": {
"chainId": 17000
"chainId": 1
},
"permissions" : {
"aggregator": "<aggregator_address>",
Expand All @@ -18,8 +18,56 @@
"strategyWeights": [
[
{
"0_strategy": "TBD",
"1_multiplier": 1e+18
"0_strategy": "0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0",
"1_multiplier": 1000000000000000000
},
{
"0_strategy": "0x93c4b944D05dfe6df7645A86cd2206016c51564D",
"1_multiplier": 1030077629425962827
},
{
"0_strategy": "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2",
"1_multiplier": 1102456657360376283
},
{
"0_strategy": "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc",
"1_multiplier": 1067949170243902475
},
{
"0_strategy": "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d",
"1_multiplier": 1026158078493781538
},
{
"0_strategy": "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff",
"1_multiplier": 1152393415227598758
},
{
"0_strategy": "0xa4C637e0F704745D182e4D38cAb7E7485321d059",
"1_multiplier": 1011855761455017859
},
{
"0_strategy": "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02",
"1_multiplier": 1012495275290785447
},
{
"0_strategy": "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6",
"1_multiplier": 1055446649335815388
},
{
"0_strategy": "0x7CA911E83dabf90C90dD3De5411a10F1A6112184",
"1_multiplier": 1035345726488000000
},
{
"0_strategy": "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6",
"1_multiplier": 1081259809521793439
},
{
"0_strategy": "0xAe60d8180437b5C34bB956822ac2710972584473",
"1_multiplier": 1044315639811926396
},
{
"0_strategy": "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2",
"1_multiplier": 1028802524926876401
}
]
],
Expand Down
13 changes: 11 additions & 2 deletions core/chainio/avs_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
// Set the nonce, as we might have to replace the transaction with a higher gas price
txNonce := big.NewInt(int64(simTx.Nonce()))
txOpts.Nonce = txNonce
txOpts.GasPrice = simTx.GasPrice()
txOpts.GasPrice = nil
txOpts.NoSend = false
i := 0

Expand All @@ -113,7 +113,16 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
if err != nil {
return nil, err
}
previousTxGasPrice := txOpts.GasPrice

// if txOpts.GasPrice wasn't previously set use the fetched gasPrice
// this should happen on the first iteration only
var previousTxGasPrice *big.Int
if txOpts.GasPrice == nil {
previousTxGasPrice = gasPrice
} else {
previousTxGasPrice = txOpts.GasPrice
}

// in order to avoid replacement transaction underpriced
// the bumped gas price has to be at least 10% higher than the previous one.
minimumGasPriceBump := utils.CalculateGasPriceBumpBasedOnRetry(previousTxGasPrice, 10, 0, gasBumpPercentageLimit, 0)
Expand Down
37 changes: 36 additions & 1 deletion docs/3_guides/7_contract_addresses.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
# Aligned contract addresses

## Holesky deployments
## Mainnet Deployments

| Contract | Address |
|----------------------------|-----------------------------------------------------------------------------------------------------------------------|
| AlignedLayerServiceManager | [0xeF2A435e5EE44B2041100EF8cbC8ae035166606c](https://etherscan.io/address/0xeF2A435e5EE44B2041100EF8cbC8ae035166606c) |
| BlsApkRegistry | [0x3CcfB7e6e8fe2A8d941a8Ce4C69A944a770E8228](https://etherscan.io/address/0x3CcfB7e6e8fe2A8d941a8Ce4C69A944a770E8228) |
| IndexRegistry | [0x9Bf1275e18eC8FA3cA7f9bffF1b0DF3e14C6E134](https://etherscan.io/address/0x9Bf1275e18eC8FA3cA7f9bffF1b0DF3e14C6E134) |
| OperatorStateRetriever | [0x6e0046205cAfA503F6b7465195A6C63C47d214f1](https://etherscan.io/address/0x6e0046205cAfA503F6b7465195A6C63C47d214f1) |
| RegistryCoordinator | [0xA8CC0749b4409c3c47012323E625aEcBA92f64b9](https://etherscan.io/address/0xA8CC0749b4409c3c47012323E625aEcBA92f64b9) |
| StakeRegistry | [0x45F5290a3630Cd6dc277B6f92227526121ca7c22](https://etherscan.io/address/0x45F5290a3630Cd6dc277B6f92227526121ca7c22) |
| BatcherPaymentService | [0xb0567184A52cB40956df6333510d6eF35B89C8de](https://etherscan.io/address/0xb0567184A52cB40956df6333510d6eF35B89C8de) |

### Strategies

Below is the list of supported strategies available on Aligned Mainnet:

| Name | Address |
|------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| [Beacon Chain ETH](https://app.eigenlayer.xyz/restake/ETH) | [0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0](https://etherscan.io/address/0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0) |
| [stETH](https://app.eigenlayer.xyz/restake/stETH) | [0x93c4b944D05dfe6df7645A86cd2206016c51564D](https://etherscan.io/address/0x93c4b944D05dfe6df7645A86cd2206016c51564D) |
| [rETH](https://app.eigenlayer.xyz/restake/rETH) | [0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2](https://etherscan.io/address/0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2) |
| [cbETH](https://app.eigenlayer.xyz/restake/cbETH) | [0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc](https://etherscan.io/address/0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc) |
| [ETHx](https://app.eigenlayer.xyz/restake/ETHx) | [0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d](https://etherscan.io/address/0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d) |
| [ankrETH](https://app.eigenlayer.xyz/restake/ankrETH) | [0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff](https://etherscan.io/address/0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff) |
| [oETH](https://app.eigenlayer.xyz/restake/oETH) | [0xa4C637e0F704745D182e4D38cAb7E7485321d059](https://etherscan.io/address/0xa4C637e0F704745D182e4D38cAb7E7485321d059) |
| [osETH](https://app.eigenlayer.xyz/restake/osETH) | [0x57ba429517c3473B6d34CA9aCd56c0e735b94c02](https://etherscan.io/address/0x57ba429517c3473B6d34CA9aCd56c0e735b94c02) |
| [swETH](https://app.eigenlayer.xyz/restake/swETH) | [0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6](https://etherscan.io/address/0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6) |
| [wBETH](https://app.eigenlayer.xyz/restake/wBETH) | [0x7CA911E83dabf90C90dD3De5411a10F1A6112184](https://etherscan.io/address/0x7CA911E83dabf90C90dD3De5411a10F1A6112184) |
| [sfrxETH](https://app.eigenlayer.xyz/restake/sfrxETH) | [0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6](https://etherscan.io/address/0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6) |
| [lsETH](https://app.eigenlayer.xyz/restake/lsETH) | [0xAe60d8180437b5C34bB956822ac2710972584473](https://etherscan.io/address/0xAe60d8180437b5C34bB956822ac2710972584473) |
| [mETH](https://app.eigenlayer.xyz/restake/mETH) | [0x298aFB19A105D59E74658C4C334Ff360BadE6dd2](https://etherscan.io/address/0x298aFB19A105D59E74658C4C334Ff360BadE6dd2) |

For additional details, refer to the [official EigenLayer documentation](https://github.com/Layr-Labs/eigenlayer-contracts/tree/mainnet?tab=readme-ov-file#strategies).


## Holesky Deployments

| Contract | Address |
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------|
Expand Down
4 changes: 4 additions & 0 deletions docs/operator_guides/0_running_an_operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Minimum hardware requirements:
| **Bandwidth** | 1 Gbps |
| **Storage** | 256 GB disk space |

## Supported Strategies

The list of supported strategies can be found [here](../3_guides/7_contract_addresses.md).

## Step 1 - Clone the repo

To start with, clone the Aligned repository and move inside it
Expand Down
4 changes: 4 additions & 0 deletions docs/operator_guides/1_operator_FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ To get whitelisted,
you need to fill out the form available [here](https://docs.google.com/forms/d/e/1FAIpQLSdH9sgfTz4v33lAvwj6BvYJGAeIshQia3FXz36PFfF-WQAWEQ/viewform)
and wait for the Aligned team to approve your request.

### What Strategies Tokens are supported in Mainnet?

The list of supported strategies can be found [here](../3_guides/7_contract_addresses.md).

### What RPC should I use?

We suggest you use your own nodes for better performance and reliability. Note that the node must support HTTP and WebSockets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion explorer/lib/scripts/fetch_old_batches.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion explorer/scripts/fetch_old_batches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ 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=<n> TO_BLOCK=<m>"
exit 1
elif [ "$#" -eq 2 ]; then
# Two arguments provided, use them
FROM=$1
TO=$2
else
echo "Please provide 2 arguments."
echo "Try running the make target with FROM_BLOCK=<n> TO_BLOCK=<m>"
exit 1
fi

Expand All @@ -29,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)"
iex --sname fetch_old_batches --remsh explorer@$ELIXIR_HOSTNAME -S mix run -e "Scripts.FetchOldBatches.run($FROM, $TO)"
Original file line number Diff line number Diff line change
Expand Up @@ -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=<n>"
exit 1
elif [ "$#" -eq 1 ]; then
# argument provided, use it
Expand Down
Binary file modified logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -40,12 +40,17 @@ defmodule TelemetryApi.ContractManagers.DelegationManager do
DelegationManager.EventFilters.operator_metadata_uri_updated(operator_address)
|> Ethers.get_logs(fromBlock: @first_block)
|> case do
{:ok, []} ->
Logger.warning("Url not found using first_block=#{@first_block}")
{:error, "Url not found using first_block=#{@first_block}"}

{:ok, data} ->
# The head (hd) is the most recent entry
url = List.last(data).data |> hd()
{:ok, url}

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

other ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,15 @@ defmodule TelemetryApiWeb.OperatorController do
render(conn, :show, operator: operator)
end
end

def index_public(conn, _params) do
operators = Operators.list_operators()
render(conn, :index_public, operators: operators)
end

def show_public(conn, %{"id" => address}) do
with {:ok, %Operator{} = operator} <- Operators.get_operator(%{address: address}) do
render(conn, :show_public, operator: operator)
end
end
end
24 changes: 24 additions & 0 deletions telemetry_api/lib/telemetry_api_web/controllers/operator_json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,28 @@ defmodule TelemetryApiWeb.OperatorJSON do
eth_ws_url_fallback: operator.eth_ws_url_fallback
}
end

@doc """
Renders a list of operators with only public data.
"""
def index_public(%{operators: operators}) do
for(operator <- operators, do: data_public(operator))
end

@doc """
Renders a single operator with only public data.
"""
def show_public(%{operator: operator}) do
data_public(operator)
end

defp data_public(%Operator{} = operator) do
%{
address: operator.address,
id: operator.id,
stake: operator.stake,
name: operator.name,
version: operator.version
}
end
end
4 changes: 2 additions & 2 deletions telemetry_api/lib/telemetry_api_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ defmodule TelemetryApiWeb.Router do
scope "/versions", TelemetryApiWeb do
pipe_through :api

get "/", OperatorController, :index
get "/:id", OperatorController, :show
get "/", OperatorController, :index_public
get "/:id", OperatorController, :show_public
post "/", OperatorController, :create_or_update
end

Expand Down

0 comments on commit 27fe5d7

Please sign in to comment.