diff --git a/Makefile b/Makefile index fe08cb244..567780174 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 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/alerts/sender_with_alert.sh b/alerts/sender_with_alert.sh index 64d372627..d01ddddb7 100755 --- a/alerts/sender_with_alert.sh +++ b/alerts/sender_with_alert.sh @@ -93,8 +93,15 @@ do ## Generate Proof nonce=$(aligned get-user-nonce --batcher_url $BATCHER_URL --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 @@ -114,6 +121,25 @@ 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 f04cb8c63..e807ea129 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/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/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/SUMMARY.md b/docs/SUMMARY.md index 93b11f279..c7ab30b7d 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -40,6 +40,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 ccbd316a4..cc37d5497 100644 --- a/explorer/.env.dev +++ b/explorer/.env.dev @@ -27,4 +27,4 @@ MAX_BATCH_SIZE=268435456 # 256 MiB BATCH_TTL_MINUTES=5 # 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 073315751..79eea42c8 100644 --- a/explorer/.env.example +++ b/explorer/.env.example @@ -25,4 +25,4 @@ TRACKER_API_URL= BATCH_TTL_MINUTES=5 # 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") }