Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull hotfixes #1765

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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=<devnet|testnet|mainnet>"
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:
Expand All @@ -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
Expand Down
28 changes: 27 additions & 1 deletion alerts/sender_with_alert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion batcher/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion batcher/aligned/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aligned"
version = "0.13.0"
version = "0.14.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion docs/3_guides/1_SDK_how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions docs/3_guides/6_setup_aligned.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,27 @@ 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=<path_to_config_file>
make aggregator_start ENVIRONMENT=devnet CONFIG_FILE=<path_to_config_file>
```

## Operator

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=<path_to_config_file>
make operator_register_and_start ENVIRONMENT=devnet CONFIG_FILE=<path_to_config_file>
```

Different configs for operators can be found in `config-files/config-operator`.
Expand All @@ -111,7 +111,7 @@ make operator_full_registration CONFIG_FILE<path_to_config_file>
and to start it once it has been registered:

```bash
make operator_start CONFIG_FILE=<path_to_config_file>
make operator_start ENVIRONMENT=devnet CONFIG_FILE=<path_to_config_file>
```

</details>
Expand Down
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
24 changes: 18 additions & 6 deletions docs/operator_guides/0_running_an_operator.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
```

Expand All @@ -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.
Expand Down
120 changes: 120 additions & 0 deletions docs/operator_guides/upgrading_guides/v0_14_0.md
Original file line number Diff line number Diff line change
@@ -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 <path/to/aligned/repository>
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 <path/to/aligned/repository>
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 %}
2 changes: 1 addition & 1 deletion explorer/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion explorer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ TRACKER_API_URL=<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
2 changes: 1 addition & 1 deletion operator/pkg/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down