diff --git a/.github/workflows/foundry-gas-diff.yml b/.github/workflows/foundry-gas-diff.yml index 74337d711..be3529421 100644 --- a/.github/workflows/foundry-gas-diff.yml +++ b/.github/workflows/foundry-gas-diff.yml @@ -35,7 +35,7 @@ jobs: FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }} - name: Compare gas reports - uses: Rubilmax/foundry-gas-diff@v3.16 + uses: Rubilmax/foundry-gas-diff@v3.21 with: summaryQuantile: 0.9 # only display the 10% most significant gas diffs in the summary (defaults to 20%) sortCriteria: avg,max # sort diff rows by criteria diff --git a/Makefile b/Makefile index b2c632d3b..c539bbf60 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,9 @@ CONFIG_FILE?=config-files/config.yaml export OPERATOR_ADDRESS ?= $(shell yq -r '.operator.address' $(CONFIG_FILE)) AGG_CONFIG_FILE?=config-files/config-aggregator.yaml -OPERATOR_VERSION=v0.13.0 +OPERATOR_VERSION=v0.14.0 +EIGEN_SDK_GO_VERSION_TESTNET=v0.2.0-beta.1 +EIGEN_SDK_GO_VERSION_MAINNET=v0.1.13 ifeq ($(OS),Linux) BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux @@ -30,6 +32,16 @@ ifeq ($(OS),Darwin) BUILD_OPERATOR = $(MAKE) build_operator_macos endif +ifeq ($(ENVIRONMENT), devnet) + GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_devnet +else ifeq ($(ENVIRONMENT), testnet) + GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_testnet +else ifeq ($(ENVIRONMENT), mainnet) + GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_mainnet +else + GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_error +endif + FFI_FOR_RELEASE ?= true @@ -140,7 +152,13 @@ anvil_start_with_block_time_with_more_prefunded_accounts: _AGGREGATOR_: +build_aggregator: + $(GET_SDK_VERSION) + @echo "Building aggregator" + @go build -o ./build/aligned-aggregator ./aggregator/cmd/main.go + aggregator_start: + $(GET_SDK_VERSION) @echo "Starting Aggregator..." @go run aggregator/cmd/main.go --config $(AGG_CONFIG_FILE) \ 2>&1 | zap-pretty @@ -156,15 +174,31 @@ test_go_retries: __OPERATOR__: operator_start: + $(GET_SDK_VERSION) @echo "Starting Operator..." go run operator/cmd/main.go start --config $(CONFIG_FILE) \ 2>&1 | zap-pretty +operator_set_eigen_sdk_go_version_testnet: + @echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_TESTNET)" + go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_TESTNET) + +operator_set_eigen_sdk_go_version_devnet: operator_set_eigen_sdk_go_version_mainnet + +operator_set_eigen_sdk_go_version_mainnet: + @echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_MAINNET)" + go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_MAINNET) + +operator_set_eigen_sdk_go_version_error: + @echo "Error setting Eigen SDK version, missing ENVIRONMENT. Possible values for ENVIRONMENT=" + exit 1 + operator_full_registration: operator_get_eth operator_register_with_eigen_layer operator_mint_mock_tokens operator_deposit_into_mock_strategy operator_whitelist_devnet operator_register_with_aligned_layer -operator_register_and_start: operator_full_registration operator_start +operator_register_and_start: $(GET_SDK_VERSION) operator_full_registration operator_start build_operator: deps + $(GET_SDK_VERSION) $(BUILD_OPERATOR) build_operator_macos: @@ -178,6 +212,7 @@ build_operator_linux: @echo "Operator built into /operator/build/aligned-operator" update_operator: + $(GET_SDK_VERSION) @echo "Updating Operator..." @./scripts/fetch_latest_release.sh @make build_operator diff --git a/aggregator/pkg/server.go b/aggregator/pkg/server.go index 4ec6488d0..9138e188d 100644 --- a/aggregator/pkg/server.go +++ b/aggregator/pkg/server.go @@ -3,6 +3,7 @@ package pkg import ( "context" "encoding/hex" + "errors" "fmt" "net/http" "net/rpc" @@ -48,6 +49,17 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t "SenderAddress", "0x"+hex.EncodeToString(signedTaskResponse.SenderAddress[:]), "BatchIdentifierHash", "0x"+hex.EncodeToString(signedTaskResponse.BatchIdentifierHash[:]), "operatorId", hex.EncodeToString(signedTaskResponse.OperatorId[:])) + + if signedTaskResponse.BlsSignature.G1Point == nil { + agg.logger.Warn("invalid operator response with nil signature", + "BatchMerkleRoot", "0x"+hex.EncodeToString(signedTaskResponse.BatchMerkleRoot[:]), + "SenderAddress", "0x"+hex.EncodeToString(signedTaskResponse.SenderAddress[:]), + "BatchIdentifierHash", "0x"+hex.EncodeToString(signedTaskResponse.BatchIdentifierHash[:]), + "operatorId", hex.EncodeToString(signedTaskResponse.OperatorId[:])) + *reply = 1 + return errors.New("invalid response: nil signature") + } + taskIndex := uint32(0) // The Aggregator may receive the Task Identifier after the operators. diff --git a/alerts/balance_alerts.sh b/alerts/balance_alerts.sh index 9f8229a79..2c43438d6 100755 --- a/alerts/balance_alerts.sh +++ b/alerts/balance_alerts.sh @@ -38,7 +38,7 @@ do fi balance_alert=true else - message="🟩 INFO: Wallet $WALLET_ADDRESS balance ($balance_eth ETH) is above $BALANCE_THRESHOLD ETH" + message="🟩 INFO: $WALLET_NAME ($NETWORK) Wallet $WALLET_ADDRESS balance ($balance_eth ETH) is above $BALANCE_THRESHOLD ETH" printf "$message\n" if [ "$balance_alert" = true ]; then send_slack_message "$message" diff --git a/alerts/contract_alerts.sh b/alerts/contract_alerts.sh index 3ca90d264..2106b767a 100755 --- a/alerts/contract_alerts.sh +++ b/alerts/contract_alerts.sh @@ -41,7 +41,8 @@ do if [ -z "$new_batch_logs" ]; then printf "No new batches logs found\n" if [ "$no_new_batches_alert" = false ]; then - message="🚨 ALERT: No new batches in Service Manager since block $from_block" + message="🚨 $NETWORK ALERT: No new batches in Service Manager since block $from_block" + printf "$message\n" send_slack_message "$message" send_telegram_message "$message" send_pagerduty_alert "$message" @@ -50,7 +51,8 @@ do else printf "New batches logs found\n" if [ "$no_new_batches_alert" = true ]; then - message="🟩 INFO: Batches creation resumed in Service Manager since block $from_block" + message="🟩 $NETWORK INFO: Batches creation resumed in Service Manager since block $from_block" + printf "$message\n" send_slack_message "$message" send_telegram_message "$message" fi @@ -61,7 +63,8 @@ do if [ -z "$verified_batch_logs" ]; then printf "No verified batches logs found\n" if [ "$no_verified_batches_alert" = false ]; then - message="🚨 ALERT: No verified batches in Service Manager since block $from_block" + message="🚨 $NETWORK ALERT: No verified batches in Service Manager since block $from_block" + printf "$message\n" send_slack_message "$message" send_telegram_message "$message" send_pagerduty_alert "$message" @@ -70,7 +73,8 @@ do else printf "Verified batches logs found\n" if [ "$no_verified_batches_alert" = true ]; then - message="🟩 INFO: Batches verification resumed in Service Manager since block $from_block" + message="🟩 $NETWORK INFO: Batches verification resumed in Service Manager since block $from_block" + printf "$message\n" send_slack_message "$message" send_telegram_message "$message" fi diff --git a/alerts/sender_with_alert.sh b/alerts/sender_with_alert.sh index 9af03efea..1e8bcd5df 100755 --- a/alerts/sender_with_alert.sh +++ b/alerts/sender_with_alert.sh @@ -92,8 +92,15 @@ do ## Generate Proof nonce=$(aligned get-user-nonce --network $NETWORK --user_addr $SENDER_ADDRESS 2>&1 | awk '{print $9}') + echo $nonce + if ! [[ "$nonce" =~ ^[0-9]+$ ]]; then + echo "Failed getting user nonce, retrying in 10 seconds" + sleep 10 + continue + fi + x=$((nonce + 1)) # So we don't have any issues with nonce = 0 - echo "Generating proof $x != 0" + echo "Generating proof $x != 0, nonce: $nonce" go run ./scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go $x ## Send Proof @@ -112,7 +119,26 @@ do 2>&1) echo "$submit" - + + submit_errors=$(echo "$submit" | grep -oE 'ERROR[^]]*]([^[]*)' | sed 's/^[^]]*]//;s/[[:space:]]*$//') + + # Loop through each error found and print with the custom message + is_error=0 + while IFS= read -r error; do + if [[ -n "$error" ]]; then + slack_error_message="Error submitting proof to $NETWORK: $error" + send_slack_message "$slack_error_message" + is_error=1 + fi + done <<< "$submit_errors" + + if [ $is_error -eq 1 ]; then + echo "Error submitting proofs to $NETWORK, retrying in 60 seconds" + send_slack_message "Error submitting proofs to $NETWORK, retrying in 60 seconds" + sleep 60 + continue + fi + echo "Waiting $VERIFICATION_WAIT_TIME seconds for verification" sleep $VERIFICATION_WAIT_TIME diff --git a/batcher/Cargo.lock b/batcher/Cargo.lock index 49945db21..6727d76be 100644 --- a/batcher/Cargo.lock +++ b/batcher/Cargo.lock @@ -72,7 +72,7 @@ dependencies = [ [[package]] name = "aligned" -version = "0.13.0" +version = "0.14.0" dependencies = [ "aligned-sdk", "clap", diff --git a/batcher/aligned-batcher/src/lib.rs b/batcher/aligned-batcher/src/lib.rs index 7fa09d539..9c25d8f69 100644 --- a/batcher/aligned-batcher/src/lib.rs +++ b/batcher/aligned-batcher/src/lib.rs @@ -26,9 +26,9 @@ use std::time::Duration; use aligned_sdk::core::constants::{ ADDITIONAL_SUBMISSION_GAS_COST_PER_PROOF, BATCHER_SUBMISSION_BASE_GAS_COST, BUMP_BACKOFF_FACTOR, BUMP_MAX_RETRIES, BUMP_MAX_RETRY_DELAY, BUMP_MIN_RETRY_DELAY, - CONNECTION_TIMEOUT, DEFAULT_MAX_FEE_PER_PROOF, ETHEREUM_CALL_BACKOFF_FACTOR, - ETHEREUM_CALL_MAX_RETRIES, ETHEREUM_CALL_MAX_RETRY_DELAY, ETHEREUM_CALL_MIN_RETRY_DELAY, - GAS_PRICE_PERCENTAGE_MULTIPLIER, PERCENTAGE_DIVIDER, + CBOR_ARRAY_MAX_OVERHEAD, CONNECTION_TIMEOUT, DEFAULT_MAX_FEE_PER_PROOF, + ETHEREUM_CALL_BACKOFF_FACTOR, ETHEREUM_CALL_MAX_RETRIES, ETHEREUM_CALL_MAX_RETRY_DELAY, + ETHEREUM_CALL_MIN_RETRY_DELAY, GAS_PRICE_PERCENTAGE_MULTIPLIER, PERCENTAGE_DIVIDER, RESPOND_TO_TASK_FEE_LIMIT_PERCENTAGE_MULTIPLIER, }; use aligned_sdk::core::types::{ @@ -115,6 +115,16 @@ impl Batcher { let s3_client = s3::create_client(upload_endpoint).await; let config = ConfigFromYaml::new(config_file); + // Ensure max_batch_bytes_size can at least hold one proof of max_proof_size, + // including the overhead introduced by serialization + assert!( + config.batcher.max_proof_size + CBOR_ARRAY_MAX_OVERHEAD + <= config.batcher.max_batch_byte_size, + "max_batch_bytes_size ({}) not big enough for one max_proof_size ({}) proof", + config.batcher.max_batch_byte_size, + config.batcher.max_proof_size + ); + let deployment_output = ContractDeploymentOutput::new(config.aligned_layer_deployment_config_file_path); diff --git a/batcher/aligned-batcher/src/types/batch_queue.rs b/batcher/aligned-batcher/src/types/batch_queue.rs index a32957a54..5c2056ead 100644 --- a/batcher/aligned-batcher/src/types/batch_queue.rs +++ b/batcher/aligned-batcher/src/types/batch_queue.rs @@ -1,6 +1,9 @@ use aligned_sdk::{ communication::serialization::cbor_serialize, - core::types::{NoncedVerificationData, VerificationDataCommitment}, + core::{ + constants::CBOR_ARRAY_MAX_OVERHEAD, + types::{NoncedVerificationData, VerificationDataCommitment}, + }, }; use ethers::types::{Address, Signature, U256}; use priority_queue::PriorityQueue; @@ -132,7 +135,10 @@ pub(crate) fn calculate_batch_size(batch_queue: &BatchQueue) -> Result respondToTaskFeeLimit modifier pub const DEFAULT_AGGREGATOR_FEE_PERCENTAGE_MULTIPLIER: u128 = 125; // feeForAggregator modifier diff --git a/batcher/aligned/Cargo.toml b/batcher/aligned/Cargo.toml index 8b55824cd..eff4fe492 100644 --- a/batcher/aligned/Cargo.toml +++ b/batcher/aligned/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aligned" -version = "0.13.0" +version = "0.14.0" edition = "2021" [dependencies] diff --git a/batcher/aligned/src/main.rs b/batcher/aligned/src/main.rs index 62e6e0490..08a19a30f 100644 --- a/batcher/aligned/src/main.rs +++ b/batcher/aligned/src/main.rs @@ -14,6 +14,7 @@ use aligned_sdk::core::{ use aligned_sdk::sdk::estimate_fee; use aligned_sdk::sdk::get_chain_id; use aligned_sdk::sdk::get_nonce_from_batcher; +use aligned_sdk::sdk::get_nonce_from_ethereum; use aligned_sdk::sdk::{deposit_to_aligned, get_balance_in_aligned}; use aligned_sdk::sdk::{get_vk_commitment, is_proof_verified, save_response, submit_multiple}; use clap::Args; @@ -25,13 +26,16 @@ use ethers::prelude::*; use ethers::utils::format_ether; use ethers::utils::hex; use ethers::utils::parse_ether; +use futures_util::future; use log::warn; use log::{error, info}; use transaction::eip2718::TypedTransaction; use crate::AlignedCommands::DepositToBatcher; +use crate::AlignedCommands::GetUserAmountOfQueuedProofs; use crate::AlignedCommands::GetUserBalance; use crate::AlignedCommands::GetUserNonce; +use crate::AlignedCommands::GetUserNonceFromEthereum; use crate::AlignedCommands::GetVkCommitment; use crate::AlignedCommands::Submit; use crate::AlignedCommands::VerifyProofOnchain; @@ -59,8 +63,21 @@ pub enum AlignedCommands { DepositToBatcher(DepositToBatcherArgs), #[clap(about = "Get user balance from the batcher", name = "get-user-balance")] GetUserBalance(GetUserBalanceArgs), - #[clap(about = "Get user nonce from the batcher", name = "get-user-nonce")] + #[clap( + about = "Gets user current nonce from the batcher. This is the nonce you should send in your next proof.", + name = "get-user-nonce" + )] GetUserNonce(GetUserNonceArgs), + #[clap( + about = "Gets the user nonce directly from the BatcherPaymentService contract. Useful for validating the on-chain state and check if your transactions are pending in the batcher.", + name = "get-user-nonce-from-ethereum" + )] + GetUserNonceFromEthereum(GetUserNonceFromEthereumArgs), + #[clap( + about = "Gets the number of proofs a user has queued in the Batcher.", + name = "get-user-amount-of-queued-proofs" + )] + GetUserAmountOfQueuedProofs(GetUserAmountOfQueuedProofsArgs), } #[derive(Parser, Debug)] @@ -225,8 +242,46 @@ pub struct GetUserNonceArgs { address: String, } +#[derive(Parser, Debug)] +#[command(version, about, long_about = None)] +pub struct GetUserNonceFromEthereumArgs { + #[arg( + name = "Ethereum RPC provider address", + long = "rpc_url", + default_value = "http://localhost:8545" + )] + eth_rpc_url: String, + #[arg( + name = "The user's Ethereum address", + long = "user_addr", + required = true + )] + address: String, + #[clap(flatten)] + network: NetworkArg, +} + +#[derive(Parser, Debug)] +#[command(version, about, long_about = None)] +pub struct GetUserAmountOfQueuedProofsArgs { + #[arg( + name = "Ethereum RPC provider address", + long = "rpc_url", + default_value = "http://localhost:8545" + )] + eth_rpc_url: String, + #[arg( + name = "The user's Ethereum address", + long = "user_addr", + required = true + )] + address: String, + #[clap(flatten)] + network: NetworkArg, +} + #[derive(Args, Debug)] -#[group(required = true, multiple = false)] +#[group(multiple = false)] pub struct PrivateKeyType { #[arg(name = "path_to_keystore", long = "keystore_path")] keystore_path: Option, @@ -642,6 +697,40 @@ async fn main() -> Result<(), AlignedError> { } } } + GetUserNonceFromEthereum(args) => { + let address = H160::from_str(&args.address).unwrap(); + let network = args.network.into(); + match get_nonce_from_ethereum(&args.eth_rpc_url, address, network).await { + Ok(nonce) => { + info!( + "Nonce for address {} in BatcherPaymentService contract is {}", + address, nonce + ); + } + Err(e) => { + error!("Error while getting nonce: {:?}", e); + return Ok(()); + } + } + } + GetUserAmountOfQueuedProofs(args) => { + let address = H160::from_str(&args.address).unwrap(); + let network: Network = args.network.into(); + let Ok((ethereum_nonce, batcher_nonce)) = future::try_join( + get_nonce_from_ethereum(&args.eth_rpc_url, address, network.clone()), + get_nonce_from_batcher(network, address), + ) + .await + .map_err(|e| error!("Error while getting nonce: {:?}", e)) else { + return Ok(()); + }; + info!( + "User {} has {} proofs in the batcher queue", + address, + batcher_nonce - ethereum_nonce + ); + return Ok(()); + } } Ok(()) diff --git a/docker/aggregator.Dockerfile b/docker/aggregator.Dockerfile index 646554eec..ab31ff605 100644 --- a/docker/aggregator.Dockerfile +++ b/docker/aggregator.Dockerfile @@ -10,6 +10,7 @@ COPY metrics ./metrics COPY contracts/bindings/ ./contracts/bindings RUN go get github.com/ethereum/go-ethereum@latest +RUN go get github.com/gorilla/websocket@v1.5.1 RUN go build -o ./aligned-layer-aggregator aggregator/cmd/main.go FROM debian:bookworm-slim diff --git a/docs/3_guides/1_SDK_how_to.md b/docs/3_guides/1_SDK_how_to.md index 6cdd1fb2b..9a98784cb 100644 --- a/docs/3_guides/1_SDK_how_to.md +++ b/docs/3_guides/1_SDK_how_to.md @@ -12,7 +12,7 @@ To use this SDK in your Rust project, add the following to your `Cargo.toml`: ```toml [dependencies] -aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.13.0" } +aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.14.0" } ``` To find the latest release tag go to [releases](https://github.com/yetanotherco/aligned_layer/releases) and copy the diff --git a/docs/3_guides/6_setup_aligned.md b/docs/3_guides/6_setup_aligned.md index 536deac04..46e112c21 100644 --- a/docs/3_guides/6_setup_aligned.md +++ b/docs/3_guides/6_setup_aligned.md @@ -74,13 +74,13 @@ make bindings To start the [Aggregator](../2_architecture/components/5_aggregator.md): ```bash -make aggregator_start +make aggregator_start ENVIRONMENT=devnet ``` or with a custom config: ```bash -make aggregator_start CONFIG_FILE= +make aggregator_start ENVIRONMENT=devnet CONFIG_FILE= ``` ## Operator @@ -88,13 +88,13 @@ make aggregator_start CONFIG_FILE= To setup an [Operator](../2_architecture/components/4_operator.md) run: ```bash -make operator_register_and_start +make operator_register_and_start ENVIRONMENT=devnet ``` or with a custom config: ```bash -make operator_register_and_start CONFIG_FILE= +make operator_register_and_start ENVIRONMENT=devnet CONFIG_FILE= ``` Different configs for operators can be found in `config-files/config-operator`. @@ -111,7 +111,7 @@ make operator_full_registration CONFIG_FILE and to start it once it has been registered: ```bash -make operator_start CONFIG_FILE= +make operator_start ENVIRONMENT=devnet CONFIG_FILE= ``` diff --git a/docs/3_guides/9_aligned_cli.md b/docs/3_guides/9_aligned_cli.md index e49f80f65..1575431b6 100644 --- a/docs/3_guides/9_aligned_cli.md +++ b/docs/3_guides/9_aligned_cli.md @@ -8,25 +8,28 @@ This document serves as a reference for the commands of the Aligned CLI. 1. Download and install Aligned from the Aligned GitHub repo `https://github.com/yetanotherco/aligned_layer`: -```bash -curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/batcher/aligned/install_aligned.sh | bash -``` + ```bash + curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/batcher/aligned/install_aligned.sh | bash + ``` 2. A source command will be printed in your terminal after installation. Execute that command to update your shell environment. 3. Verify that the installation was successful: -```bash -aligned --version -``` + + ```bash + aligned --version + ``` ## Help: To see the available commands, run: + ```bash aligned --help ``` To see the usage of a command, run: + ```bash aligned [COMMAND] --help ``` @@ -44,6 +47,7 @@ Submit a proof to the Aligned Layer batcher. `submit [OPTIONS] --proving_system --proof ` #### Options: + - `--batcher_url `: Websocket URL for the Aligned Layer batcher - Default: `ws://localhost:8080` - Mainnet: `wss://mainnet.batcher.alignedlayer.com` @@ -85,6 +89,7 @@ Submit a proof to the Aligned Layer batcher. #### Example: + ```bash aligned submit \ --proving_system Risc0 \ @@ -111,6 +116,7 @@ Check if a proof was verified by Aligned on Ethereum. `verify-proof-onchain [OPTIONS] --aligned-verification-data ` #### Options: + - `--aligned-verification-data `: Path to the aligned verification data file. - `--rpc_url `: User's Ethereum RPC provider connection address. - Default: `http://localhost:8545` @@ -127,6 +133,7 @@ Check if a proof was verified by Aligned on Ethereum. - `--batcher_url ` #### Example: + ```bash aligned verify-proof-onchain \ --aligned-verification-data ./aligned_verification_data/ \ @@ -147,6 +154,7 @@ Computes the verification data commitment from the verification data file. `get-vk-commitment [OPTIONS] --verification_key_file --proving_system ` #### Options: + - `--verification_key_file `: Path to the verification key file. - `--proving_system `: Proof system of the verification data file. - Possible values: `GnarkPlonkBls12_381`, `GnarkPlonkBn254`, `Groth16Bn254`, `SP1`, `Risc0` @@ -165,6 +173,7 @@ Deposits Ethereum into the Aligned Layer's `BatcherPaymentService.sol` contract. `deposit-to-batcher [OPTIONS] --keystore_path --amount ` #### Options: + - `--keystore_path `: Path to the local keystore. - `--private_key `: User's wallet private key. - `--rpc_url `: User's Ethereum RPC provider connection address. @@ -183,6 +192,7 @@ Deposits Ethereum into the Aligned Layer's `BatcherPaymentService.sol` contract. - `--batcher_url ` #### Example: + ```bash aligned deposit-to-batcher \ --network holesky \ @@ -205,6 +215,7 @@ Retrieves the user's balance in the Aligned Layer's contract. #### Options: + - One of the following, to specify which Network to interact with: - `--network `: Network name to interact with. - Default: `devnet` @@ -218,9 +229,10 @@ Retrieves the user's balance in the Aligned Layer's contract. - Mainnet: `https://ethereum-rpc.publicnode.com` - Holesky: `https://ethereum-holesky-rpc.publicnode.com` - Also, you can use your own Ethereum RPC providers. -- **`--user_addr`**: User's Ethereum address. +- `--user_addr`: User's Ethereum address. #### Example: + ```bash aligned get-user-balance \ --user_addr \ @@ -232,16 +244,48 @@ aligned get-user-balance \ ### **get-user-nonce** - #### Description: -Retrieves the user's current nonce from the batcher. +Retrieves the user's current nonce from the Batcher. #### Command: `get-user-nonce [OPTIONS] --user_addr ` #### Options: + +- `--user_addr `: User's Ethereum address. +- One of the following, to specify which Network to interact with: + - `--network `: Network name to interact with. + - Default: `devnet` + - Possible values: `devnet`, `holesky`, `mainnet` + - For a custom Network, you must specify the following parameters: + - `--aligned_service_manager ` + - `--batcher_payment_service ` + - `--batcher_url ` + +#### Example: + +```bash +aligned get-user-nonce \ +--user_addr \ +--network holesky +``` + +--- + +### **get-user-nonce-from-ethereum** + +#### Description: + +Retrieves the user's current nonce from the Blockhain, in the Batcher Payment Service Contract. + +#### Command: + +`get-user-nonce-from-ethereum [OPTIONS] --user_addr ` + +#### Options: + - `--user_addr `: User's Ethereum address. - One of the following, to specify which Network to interact with: - `--network `: Network name to interact with. @@ -251,10 +295,54 @@ Retrieves the user's current nonce from the batcher. - `--aligned_service_manager ` - `--batcher_payment_service ` - `--batcher_url ` +- `--rpc_url `: User's Ethereum RPC provider connection address. + - Default: `http://localhost:8545` + - Mainnet: `https://ethereum-rpc.publicnode.com` + - Holesky: `https://ethereum-holesky-rpc.publicnode.com` + - Also, you can use your own Ethereum RPC providers. #### Example: + ```bash -aligned get-user-nonce \ +aligned get-user-nonce-from-ethereum \ --user_addr \ +--network holesky \ +--rpc_url https://ethereum-holesky-rpc.publicnode.com +``` + +--- + +### **get-user-amount-of-queued-proofs** + +#### Description: + +Retrieves the user's amount of queued proofs in the Batcher. + +#### Command: + +`get-user-amount-of-queued-proofs [OPTIONS] --user_addr ` + +#### Options: + +- `--user_addr `: User's Ethereum address. +- `--network `: Network name to interact with. + - Default: `devnet` + - Possible values: `devnet`, `holesky`, `mainnet` +- `--rpc_url `: User's Ethereum RPC provider connection address. + - Default: `http://localhost:8545` + - Mainnet: `https://ethereum-rpc.publicnode.com` + - Holesky: `https://ethereum-holesky-rpc.publicnode.com` + - Also, you can use your own Ethereum RPC providers. +- `--batcher_url `: Websocket URL for the Aligned Layer batcher + - Default: `ws://localhost:8080` + - Mainnet: `wss://mainnet.batcher.alignedlayer.com` + - Holesky: `wss://batcher.alignedlayer.com` + +#### Example: + +```bash +aligned get-user-amount-of-queued-proofs \ +--user_addr \ +--network holesky \ --batcher_url wss://batcher.alignedlayer.com ``` diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 32c61afe3..ef49a049a 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -42,6 +42,7 @@ * [Operator FAQ](operator_guides/1_operator_FAQ.md) * [Troubleshooting](operator_guides/2_troubleshooting.md) * Upgrading Guides + * [Upgrading to v0.14.0](operator_guides/upgrading_guides/v0_14_0.md) * [Upgrading to v0.10.2](operator_guides/upgrading_guides/v0_10_2.md) * [Upgrading to v0.9.2](operator_guides/upgrading_guides/v0_9_2.md) diff --git a/docs/operator_guides/0_running_an_operator.md b/docs/operator_guides/0_running_an_operator.md index b43785663..3a12720de 100644 --- a/docs/operator_guides/0_running_an_operator.md +++ b/docs/operator_guides/0_running_an_operator.md @@ -1,7 +1,7 @@ # Register as an Aligned operator in testnet > **CURRENT VERSION:** -> Aligned Operator [v0.13.0](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.13.0) +> Aligned Operator [v0.14.0](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.14.0) > **IMPORTANT:** > You must be [whitelisted](https://docs.google.com/forms/d/e/1FAIpQLSdH9sgfTz4v33lAvwj6BvYJGAeIshQia3FXz36PFfF-WQAWEQ/viewform) to become an Aligned operator. @@ -30,7 +30,7 @@ The list of supported strategies can be found [here](../3_guides/7_contract_addr To start with, clone the Aligned repository and move inside it ```bash -git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.13.0 +git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.14.0 cd aligned_layer ``` @@ -54,18 +54,30 @@ make install_foundry foundryup ``` -To build the operator binary, run: +To build the operator binary for **Testnet**, run: ```bash -make build_operator +make build_operator ENVIRONMENT=testnet +``` + +To build the operator binary for **Mainnet**, run: + +```bash +make build_operator ENVIRONMENT=mainnet ``` ### Upgrading the Operator -If you want to upgrade the operator, run: +If you want to upgrade the operator in **Testnet**, run: + +```bash +make update_operator ENVIRONMENT=testnet +``` + +If you want to upgrade the operator in **Mainnet**, run: ```bash -make update_operator +make update_operator ENVIRONMENT=mainnet ``` This will recreate the binaries. You can then proceed to restart the operator. diff --git a/docs/operator_guides/upgrading_guides/v0_14_0.md b/docs/operator_guides/upgrading_guides/v0_14_0.md new file mode 100644 index 000000000..301f680bb --- /dev/null +++ b/docs/operator_guides/upgrading_guides/v0_14_0.md @@ -0,0 +1,120 @@ +# Upgrading to V0.14.0 + +This guide will walk you through the process of upgrading your Aligned Operator to v0.14.0. + +Since EigenLayer released Slashing on Holesky Testnet, there are two versions of the [EigenSDK](https://github.com/Layr-Labs/eigensdk-go), one is compatible with Mainnet and the other one is compatible with Holesky Testnet. This guide will help you to upgrade your operator with the correct version of the EigenSDK. + +The EigenSDK version [v0.1.13](https://github.com/Layr-Labs/eigensdk-go/releases/tag/v0.1.13) is compatible with Mainnet. + +The EigenSDK version [v0.2.0-beta.1](https://github.com/Layr-Labs/eigensdk-go/releases/tag/v0.2.0-beta.1) is compatible with Holesky Testnet. + +## Changes + +This version includes the following changes: + +* hotfix: eigensdk on Operator and Aggregator boot in [#1740](https://github.com/yetanotherco/aligned_layer/pull/1740) + +## How to upgrade + +Depending on the network you are running, you will need to upgrade the EigenSDK version on your operator. + +For Mainnet this upgrade is optional, but for Holesky Testnet it is mandatory. + +### Mainnet Operator + +This upgrade is OPTIONAL for Mainnet operators. But, if you want to upgrade, you can follow the steps below: + +#### Step 1 - Pull the latest changes + +```shell +cd +git fetch origin +git checkout v0.14.0 +``` + +#### Step 2 - Update the Operator + +```shell +make build_operator ENVIRONMENT=mainnet +``` + +This will install the version v0.1.13 of the EigenSDK, and then it will recompile the binaries. + +#### Step 3 - Check the Operator Version + +To see the operator version, run: + +```shell +./operator/build/aligned-operator --version +``` + +This will display the current version of the operator binary. The output should be: + +``` +Aligned Layer Node Operator version v0.14.0 +``` + +#### Step 4 - Restart the Operator + +Restart the operator based on your system configuration. + +### Testnet Operator + +This upgrade is MANDATORY for Testnet operators. Follow the steps below to upgrade your operator: + +#### Step 1 - Pull the latest changes + +```shell +cd +git fetch origin +git checkout v0.14.0 +``` + +#### Step 2 - Update the Operator + +```shell +make build_operator ENVIRONMENT=testnet +``` + +This will install the version v0.2.0-beta.1 of the EigenSDK, and then it will recompile the binaries. + +#### Step 3 - Check the Operator Version + +To see the operator version, run: + +```shell +./operator/build/aligned-operator --version +``` + +This will display the current version of the operator binary. The output should be: + +``` +Aligned Layer Node Operator version v0.14.0 +``` + +#### Step 4 - Restart the Operator + +Restart the operator based on your system configuration. + +### Troubleshooting + +#### Operator not registered on Aligned + +If your operator is not registered on Aligned, or it was ejected from the network, you can follow the registration process again. + +- Mainnet: + +```bash +make operator_register_with_aligned_layer CONFIG_FILE=./config-files/config-operator-mainnet.yaml +``` + +- Holesky: + +```bash +make operator_register_with_aligned_layer CONFIG_FILE=./config-files/config-operator-holesky.yaml +``` + +{% hint style="danger" %} +If you are going to run the server in this machine, +delete the operator key +{% endhint %} diff --git a/explorer/.env.dev b/explorer/.env.dev index 7a68786d4..b0b7b201b 100644 --- a/explorer/.env.dev +++ b/explorer/.env.dev @@ -30,4 +30,4 @@ BATCH_TTL_MINUTES=5 SCHEDULED_BATCH_INTERVAL_MINUTES=10 # Latest aligned release that operators should be running -LATEST_RELEASE=v0.13.0 +LATEST_RELEASE=v0.14.0 diff --git a/explorer/.env.example b/explorer/.env.example index d18089798..a2a327b83 100644 --- a/explorer/.env.example +++ b/explorer/.env.example @@ -28,4 +28,4 @@ BATCH_TTL_MINUTES=5 SCHEDULED_BATCH_INTERVAL_MINUTES=360 # Latest aligned release that operators should be running -LATEST_RELEASE=v0.13.0 +LATEST_RELEASE=v0.14.0 diff --git a/operator/pkg/operator.go b/operator/pkg/operator.go index d4c36355c..af4c5d42a 100644 --- a/operator/pkg/operator.go +++ b/operator/pkg/operator.go @@ -239,7 +239,7 @@ func (o *Operator) Start(ctx context.Context) error { } case err := <-subV3: o.Logger.Infof("Error in websocket subscription", "err", err) - subV2, err = o.SubscribeToNewTasksV3() + subV3, err = o.SubscribeToNewTasksV3() if err != nil { o.Logger.Fatal("Could not subscribe to new tasks V3") }