Skip to content

Commit a49bfe5

Browse files
authored
Merge branch 'testnet' into hotfix/reply_channel
2 parents e6eeeb8 + ea6188f commit a49bfe5

File tree

12 files changed

+224
-18
lines changed

12 files changed

+224
-18
lines changed

Makefile

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ CONFIG_FILE?=config-files/config.yaml
77
export OPERATOR_ADDRESS ?= $(shell yq -r '.operator.address' $(CONFIG_FILE))
88
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
99

10-
OPERATOR_VERSION=v0.13.0
10+
OPERATOR_VERSION=v0.14.0
11+
EIGEN_SDK_GO_VERSION_TESTNET=v0.2.0-beta.1
12+
EIGEN_SDK_GO_VERSION_MAINNET=v0.1.13
1113

1214
ifeq ($(OS),Linux)
1315
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
@@ -30,6 +32,16 @@ ifeq ($(OS),Darwin)
3032
BUILD_OPERATOR = $(MAKE) build_operator_macos
3133
endif
3234

35+
ifeq ($(ENVIRONMENT), devnet)
36+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_devnet
37+
else ifeq ($(ENVIRONMENT), testnet)
38+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_testnet
39+
else ifeq ($(ENVIRONMENT), mainnet)
40+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_mainnet
41+
else
42+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_error
43+
endif
44+
3345

3446
FFI_FOR_RELEASE ?= true
3547

@@ -140,7 +152,13 @@ anvil_start_with_block_time_with_more_prefunded_accounts:
140152

141153
_AGGREGATOR_:
142154

155+
build_aggregator:
156+
$(GET_SDK_VERSION)
157+
@echo "Building aggregator"
158+
@go build -o ./build/aligned-aggregator ./aggregator/cmd/main.go
159+
143160
aggregator_start:
161+
$(GET_SDK_VERSION)
144162
@echo "Starting Aggregator..."
145163
@go run aggregator/cmd/main.go --config $(AGG_CONFIG_FILE) \
146164
2>&1 | zap-pretty
@@ -156,15 +174,31 @@ test_go_retries:
156174
__OPERATOR__:
157175

158176
operator_start:
177+
$(GET_SDK_VERSION)
159178
@echo "Starting Operator..."
160179
go run operator/cmd/main.go start --config $(CONFIG_FILE) \
161180
2>&1 | zap-pretty
162181

182+
operator_set_eigen_sdk_go_version_testnet:
183+
@echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_TESTNET)"
184+
go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_TESTNET)
185+
186+
operator_set_eigen_sdk_go_version_devnet: operator_set_eigen_sdk_go_version_mainnet
187+
188+
operator_set_eigen_sdk_go_version_mainnet:
189+
@echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_MAINNET)"
190+
go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_MAINNET)
191+
192+
operator_set_eigen_sdk_go_version_error:
193+
@echo "Error setting Eigen SDK version, missing ENVIRONMENT. Possible values for ENVIRONMENT=<devnet|testnet|mainnet>"
194+
exit 1
195+
163196
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
164197

165198
operator_register_and_start: operator_full_registration operator_start
166199

167200
build_operator: deps
201+
$(GET_SDK_VERSION)
168202
$(BUILD_OPERATOR)
169203

170204
build_operator_macos:
@@ -178,6 +212,7 @@ build_operator_linux:
178212
@echo "Operator built into /operator/build/aligned-operator"
179213

180214
update_operator:
215+
$(GET_SDK_VERSION)
181216
@echo "Updating Operator..."
182217
@./scripts/fetch_latest_release.sh
183218
@make build_operator

aggregator/pkg/server.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package pkg
33
import (
44
"context"
55
"encoding/hex"
6+
"errors"
67
"fmt"
78
"net/http"
89
"net/rpc"
@@ -48,6 +49,17 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
4849
"SenderAddress", "0x"+hex.EncodeToString(signedTaskResponse.SenderAddress[:]),
4950
"BatchIdentifierHash", "0x"+hex.EncodeToString(signedTaskResponse.BatchIdentifierHash[:]),
5051
"operatorId", hex.EncodeToString(signedTaskResponse.OperatorId[:]))
52+
53+
if signedTaskResponse.BlsSignature.G1Point == nil {
54+
agg.logger.Warn("invalid operator response with nil signature",
55+
"BatchMerkleRoot", "0x"+hex.EncodeToString(signedTaskResponse.BatchMerkleRoot[:]),
56+
"SenderAddress", "0x"+hex.EncodeToString(signedTaskResponse.SenderAddress[:]),
57+
"BatchIdentifierHash", "0x"+hex.EncodeToString(signedTaskResponse.BatchIdentifierHash[:]),
58+
"operatorId", hex.EncodeToString(signedTaskResponse.OperatorId[:]))
59+
*reply = 1
60+
return errors.New("invalid response: nil signature")
61+
}
62+
5163
taskIndex := uint32(0)
5264

5365
// The Aggregator may receive the Task Identifier after the operators.

alerts/sender_with_alert.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,15 @@ do
9393

9494
## Generate Proof
9595
nonce=$(aligned get-user-nonce --batcher_url $BATCHER_URL --user_addr $SENDER_ADDRESS 2>&1 | awk '{print $9}')
96+
echo $nonce
97+
if ! [[ "$nonce" =~ ^[0-9]+$ ]]; then
98+
echo "Failed getting user nonce, retrying in 10 seconds"
99+
sleep 10
100+
continue
101+
fi
102+
96103
x=$((nonce + 1)) # So we don't have any issues with nonce = 0
97-
echo "Generating proof $x != 0"
104+
echo "Generating proof $x != 0, nonce: $nonce"
98105
go run ./scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go $x
99106

100107
## Send Proof
@@ -114,6 +121,25 @@ do
114121
2>&1)
115122

116123
echo "$submit"
124+
125+
submit_errors=$(echo "$submit" | grep -oE 'ERROR[^]]*]([^[]*)' | sed 's/^[^]]*]//;s/[[:space:]]*$//')
126+
127+
# Loop through each error found and print with the custom message
128+
is_error=0
129+
while IFS= read -r error; do
130+
if [[ -n "$error" ]]; then
131+
slack_error_message="Error submitting proof to $NETWORK: $error"
132+
send_slack_message "$slack_error_message"
133+
is_error=1
134+
fi
135+
done <<< "$submit_errors"
136+
137+
if [ $is_error -eq 1 ]; then
138+
echo "Error submitting proofs to $NETWORK, retrying in 60 seconds"
139+
send_slack_message "Error submitting proofs to $NETWORK, retrying in 60 seconds"
140+
sleep 60
141+
continue
142+
fi
117143

118144
echo "Waiting $VERIFICATION_WAIT_TIME seconds for verification"
119145
sleep $VERIFICATION_WAIT_TIME

batcher/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

batcher/aligned/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aligned"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
edition = "2021"
55

66
[dependencies]

docs/3_guides/1_SDK_how_to.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To use this SDK in your Rust project, add the following to your `Cargo.toml`:
1212

1313
```toml
1414
[dependencies]
15-
aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.13.0" }
15+
aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.14.0" }
1616
```
1717

1818
To find the latest release tag go to [releases](https://github.com/yetanotherco/aligned_layer/releases) and copy the

docs/3_guides/6_setup_aligned.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,27 @@ make bindings
7474
To start the [Aggregator](../2_architecture/components/5_aggregator.md):
7575

7676
```bash
77-
make aggregator_start
77+
make aggregator_start ENVIRONMENT=devnet
7878
```
7979

8080
or with a custom config:
8181

8282
```bash
83-
make aggregator_start CONFIG_FILE=<path_to_config_file>
83+
make aggregator_start ENVIRONMENT=devnet CONFIG_FILE=<path_to_config_file>
8484
```
8585

8686
## Operator
8787

8888
To setup an [Operator](../2_architecture/components/4_operator.md) run:
8989

9090
```bash
91-
make operator_register_and_start
91+
make operator_register_and_start ENVIRONMENT=devnet
9292
```
9393

9494
or with a custom config:
9595

9696
```bash
97-
make operator_register_and_start CONFIG_FILE=<path_to_config_file>
97+
make operator_register_and_start ENVIRONMENT=devnet CONFIG_FILE=<path_to_config_file>
9898
```
9999

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

113113
```bash
114-
make operator_start CONFIG_FILE=<path_to_config_file>
114+
make operator_start ENVIRONMENT=devnet CONFIG_FILE=<path_to_config_file>
115115
```
116116

117117
</details>

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* [Operator FAQ](operator_guides/1_operator_FAQ.md)
4141
* [Troubleshooting](operator_guides/2_troubleshooting.md)
4242
* Upgrading Guides
43+
* [Upgrading to v0.14.0](operator_guides/upgrading_guides/v0_14_0.md)
4344
* [Upgrading to v0.10.2](operator_guides/upgrading_guides/v0_10_2.md)
4445
* [Upgrading to v0.9.2](operator_guides/upgrading_guides/v0_9_2.md)
4546

docs/operator_guides/0_running_an_operator.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Register as an Aligned operator in testnet
22

33
> **CURRENT VERSION:**
4-
> Aligned Operator [v0.13.0](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.13.0)
4+
> Aligned Operator [v0.14.0](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.14.0)
55
66
> **IMPORTANT:**
77
> 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
3030
To start with, clone the Aligned repository and move inside it
3131

3232
```bash
33-
git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.13.0
33+
git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.14.0
3434
cd aligned_layer
3535
```
3636

@@ -54,18 +54,30 @@ make install_foundry
5454
foundryup
5555
```
5656

57-
To build the operator binary, run:
57+
To build the operator binary for **Testnet**, run:
5858

5959
```bash
60-
make build_operator
60+
make build_operator ENVIRONMENT=testnet
61+
```
62+
63+
To build the operator binary for **Mainnet**, run:
64+
65+
```bash
66+
make build_operator ENVIRONMENT=mainnet
6167
```
6268

6369
### Upgrading the Operator
6470

65-
If you want to upgrade the operator, run:
71+
If you want to upgrade the operator in **Testnet**, run:
72+
73+
```bash
74+
make update_operator ENVIRONMENT=testnet
75+
```
76+
77+
If you want to upgrade the operator in **Mainnet**, run:
6678

6779
```bash
68-
make update_operator
80+
make update_operator ENVIRONMENT=mainnet
6981
```
7082

7183
This will recreate the binaries. You can then proceed to restart the operator.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Upgrading to V0.14.0
2+
3+
This guide will walk you through the process of upgrading your Aligned Operator to v0.14.0.
4+
5+
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.
6+
7+
The EigenSDK version [v0.1.13](https://github.com/Layr-Labs/eigensdk-go/releases/tag/v0.1.13) is compatible with Mainnet.
8+
9+
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.
10+
11+
## Changes
12+
13+
This version includes the following changes:
14+
15+
* hotfix: eigensdk on Operator and Aggregator boot in [#1740](https://github.com/yetanotherco/aligned_layer/pull/1740)
16+
17+
## How to upgrade
18+
19+
Depending on the network you are running, you will need to upgrade the EigenSDK version on your operator.
20+
21+
For Mainnet this upgrade is optional, but for Holesky Testnet it is mandatory.
22+
23+
### Mainnet Operator
24+
25+
This upgrade is OPTIONAL for Mainnet operators. But, if you want to upgrade, you can follow the steps below:
26+
27+
#### Step 1 - Pull the latest changes
28+
29+
```shell
30+
cd <path/to/aligned/repository>
31+
git fetch origin
32+
git checkout v0.14.0
33+
```
34+
35+
#### Step 2 - Update the Operator
36+
37+
```shell
38+
make build_operator ENVIRONMENT=mainnet
39+
```
40+
41+
This will install the version v0.1.13 of the EigenSDK, and then it will recompile the binaries.
42+
43+
#### Step 3 - Check the Operator Version
44+
45+
To see the operator version, run:
46+
47+
```shell
48+
./operator/build/aligned-operator --version
49+
```
50+
51+
This will display the current version of the operator binary. The output should be:
52+
53+
```
54+
Aligned Layer Node Operator version v0.14.0
55+
```
56+
57+
#### Step 4 - Restart the Operator
58+
59+
Restart the operator based on your system configuration.
60+
61+
### Testnet Operator
62+
63+
This upgrade is MANDATORY for Testnet operators. Follow the steps below to upgrade your operator:
64+
65+
#### Step 1 - Pull the latest changes
66+
67+
```shell
68+
cd <path/to/aligned/repository>
69+
git fetch origin
70+
git checkout v0.14.0
71+
```
72+
73+
#### Step 2 - Update the Operator
74+
75+
```shell
76+
make build_operator ENVIRONMENT=testnet
77+
```
78+
79+
This will install the version v0.2.0-beta.1 of the EigenSDK, and then it will recompile the binaries.
80+
81+
#### Step 3 - Check the Operator Version
82+
83+
To see the operator version, run:
84+
85+
```shell
86+
./operator/build/aligned-operator --version
87+
```
88+
89+
This will display the current version of the operator binary. The output should be:
90+
91+
```
92+
Aligned Layer Node Operator version v0.14.0
93+
```
94+
95+
#### Step 4 - Restart the Operator
96+
97+
Restart the operator based on your system configuration.
98+
99+
### Troubleshooting
100+
101+
#### Operator not registered on Aligned
102+
103+
If your operator is not registered on Aligned, or it was ejected from the network, you can follow the registration process again.
104+
105+
- Mainnet:
106+
107+
```bash
108+
make operator_register_with_aligned_layer CONFIG_FILE=./config-files/config-operator-mainnet.yaml
109+
```
110+
111+
- Holesky:
112+
113+
```bash
114+
make operator_register_with_aligned_layer CONFIG_FILE=./config-files/config-operator-holesky.yaml
115+
```
116+
117+
{% hint style="danger" %}
118+
If you are going to run the server in this machine,
119+
delete the operator key
120+
{% endhint %}

0 commit comments

Comments
 (0)