Skip to content

Commit 5d3282e

Browse files
committed
feat: update middleware submodule
1 parent 8ab0376 commit 5d3282e

File tree

5 files changed

+100
-19
lines changed

5 files changed

+100
-19
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,20 @@ operator_whitelist_devnet:
233233
@echo "Operator address: $(OPERATOR_ADDRESS)"
234234
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)
235235

236-
operator_remove_devnet:
236+
operator_remove_from_whitelist_devnet:
237237
@echo "Removing operator"
238238
$(eval OPERATOR_ADDRESS = $(shell yq -r '.operator.address' $(CONFIG_FILE)))
239239
@echo "Operator address: $(OPERATOR_ADDRESS)"
240-
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/remove_operator.sh $(OPERATOR_ADDRESS)
240+
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/remove_from_whitelist_operator.sh $(OPERATOR_ADDRESS)
241241

242242
operator_whitelist:
243243
@echo "Whitelisting operator $(OPERATOR_ADDRESS)"
244244
@. contracts/scripts/.env && . contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)
245245

246+
operator_remove_from_whitelist:
247+
@echo "Removing operator $(OPERATOR_ADDRESS)"
248+
@. contracts/scripts/.env && . contracts/scripts/remove_from_whitelist_operator.sh $(OPERATOR_ADDRESS)
249+
246250
operator_deposit_into_mock_strategy:
247251
@echo "Depositing into mock strategy"
248252
$(eval STRATEGY_ADDRESS = $(shell jq -r '.addresses.strategies.MOCK' contracts/script/output/devnet/eigenlayer_deployment_output.json))

contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

contracts/scripts/whitelist_operator.sh renamed to contracts/scripts/operator_remove_from_whitelist.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ cd "$parent_path"
99
cd ../
1010

1111
# Check if the number of arguments is correct
12-
if [ "$#" -ne 1 ]; then
13-
echo "Usage: add_operator_to_whitelist.sh <OPERATOR_ADDRESS>"
12+
if [ "$#" -lt 1 ]; then
13+
echo "Usage: operator_remove_from_whitelist.sh <OPERATOR_ADDRESS>"
14+
echo "or"
15+
echo "Usage: operator_remove_from_whitelist.sh <OPERATOR_ADDRESS_1> <OPERATOR_ADDRESS_2> ... <OPERATOR_ADDRESS_N>"
1416
exit 1
1517
fi
1618

@@ -37,9 +39,19 @@ if [ -z "$PRIVATE_KEY" ]; then
3739
exit 1
3840
fi
3941

40-
# Call the add function on the contract
41-
cast send \
42-
--rpc-url=$RPC_URL \
43-
--private-key=$PRIVATE_KEY \
44-
$REGISTRY_COORDINATOR 'add(address)' \
45-
$OPERATOR_ADDRESS
42+
if [ "$#" -gt 1 ]; then
43+
OPERATORS=$(echo "$@" | sed 's/ /,/g') # separate the operators with a comma
44+
echo "Adding many operators to whitelist: $@"
45+
cast send \
46+
--rpc-url=$RPC_URL \
47+
--private-key=$PRIVATE_KEY \
48+
$REGISTRY_COORDINATOR 'remove_multiple(address[])' \
49+
"[$OPERATORS]"
50+
else
51+
echo "Adding operator to whitelist: $OPERATOR_ADDRESS"
52+
cast send \
53+
--rpc-url=$RPC_URL \
54+
--private-key=$PRIVATE_KEY \
55+
$REGISTRY_COORDINATOR 'remove(address)' \
56+
$OPERATOR_ADDRESS
57+
fi
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ cd "$parent_path"
99
cd ../
1010

1111
# Check if the number of arguments is correct
12-
if [ "$#" -ne 1 ]; then
13-
echo "Usage: add_operator_to_whitelist.sh <OPERATOR_ADDRESS>"
12+
if [ "$#" -lt 1 ]; then
13+
echo "Usage: operator_whitelist.sh <OPERATOR_ADDRESS>"
14+
echo "or"
15+
echo "Usage: operator_whitelist.sh <OPERATOR_ADDRESS_1> <OPERATOR_ADDRESS_2> ... <OPERATOR_ADDRESS_N>"
1416
exit 1
1517
fi
1618

@@ -37,9 +39,19 @@ if [ -z "$PRIVATE_KEY" ]; then
3739
exit 1
3840
fi
3941

40-
# Call the add function on the contract
41-
cast send \
42-
--rpc-url=$RPC_URL \
43-
--private-key=$PRIVATE_KEY \
44-
$REGISTRY_COORDINATOR 'remove(address)' \
45-
$OPERATOR_ADDRESS
42+
if [ "$#" -gt 1 ]; then
43+
OPERATORS=$(echo "$@" | sed 's/ /,/g') # separate the operators with a comma
44+
echo "Adding many operators to whitelist: $@"
45+
cast send \
46+
--rpc-url=$RPC_URL \
47+
--private-key=$PRIVATE_KEY \
48+
$REGISTRY_COORDINATOR 'add_multiple(address[])' \
49+
"[$OPERATORS]"
50+
else
51+
echo "Adding operator to whitelist: $OPERATOR_ADDRESS"
52+
cast send \
53+
--rpc-url=$RPC_URL \
54+
--private-key=$PRIVATE_KEY \
55+
$REGISTRY_COORDINATOR 'add(address)' \
56+
$OPERATOR_ADDRESS
57+
fi

docs/0_internal/whitelist.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Whitelist
2+
3+
Whitelisting is a functionality added by the Aligned dev team to the `eigenlayer-middleware` contracts.
4+
5+
This functionality is added in `contracts/lib/eigenlayer-middleware/src/Whitelist.sol`, and its functionality ends up present in the `RegistryCoordinator` contract.
6+
7+
The reason behind this functionality is to control which Operators can operate in Aligned, making necessary for the team to manually whitelist an Operator before it can join the network.
8+
9+
## Interacting with whitelisting
10+
11+
### Adding an Operator
12+
13+
There are 2 ways of adding Operators to the whitelist.
14+
15+
To add only 1 Operator:
16+
```
17+
make operator_whitelist OPERATOR_ADDRESS=<operator_address>
18+
```
19+
20+
To add a list of Operators:
21+
```
22+
export contracts/scripts/.env
23+
contracts/scripts/operator_whitelist.sh <operator_address_1> <operator_address_2> ... <operator_address_n>
24+
```
25+
26+
### Removing an Operator
27+
28+
There are 2 ways of removing Operators from the whitelist.
29+
30+
To remove only 1 Operator:
31+
```
32+
make operator_remove_from_whitelist OPERATOR_ADDRESS=<operator_address>
33+
```
34+
35+
To remove a list of Operators:
36+
```
37+
export contracts/scripts/.env
38+
contracts/scripts/operator_remove_from_whitelist.sh <operator_address_1> <operator_address_2> ... <operator_address_n>
39+
```
40+
41+
### Querying the state of an Operator
42+
43+
To view the whitelist state of an Operator you can:
44+
45+
```
46+
cast call <aligned_registry_coordinator_address> "isWhitelisted(address)(bool)" <operator_address>
47+
```
48+
49+
or in Etherscan:
50+
51+
1. Locate the Aligned `registryCoordinator` contract address, in `aligned_deployment_output.json`
52+
2. `Read as Proxy` in Etherscan
53+
3. Find the `isWhitelisted` function, and put the Operator's address as the parameter

0 commit comments

Comments
 (0)