Skip to content

Commit

Permalink
Add registration instructions and make registration deployment (#120)
Browse files Browse the repository at this point in the history
* feat: Add AVS registration bash script

* feat: Add non-fixed registration signature salt

* fix: Fix env key names in register script

* feat: Move salt logic to avsManager

* feat: Add --pull=always to register script container run

* docs: Add registration instructions

* docs: Update sections and sidebar position on setup instructions

* docs: Turn higlight quotes into admonitions

* docs: Improve opt-in process description on note

* chore: Set solc version

* chore: Update deployment

* docs: Add deployment addresses to docs

* docs: Add repository state updating to final setup step

* docs: Add NEAR DA contracts addresses to docs

* docs: Fix broken links on docs
  • Loading branch information
Hyodar authored Apr 23, 2024
1 parent dab0ace commit 47a1dd6
Show file tree
Hide file tree
Showing 19 changed files with 4,473 additions and 1,488 deletions.
2,088 changes: 2,088 additions & 0 deletions contracts/evm/broadcast/SFFLDeployer.s.sol/17000/run-1713896193.json

Large diffs are not rendered by default.

2,121 changes: 1,047 additions & 1,074 deletions contracts/evm/broadcast/SFFLDeployer.s.sol/17000/run-latest.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

341 changes: 174 additions & 167 deletions contracts/evm/broadcast/SFFLDeployerRollup.s.sol/11155420/run-latest.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

327 changes: 165 additions & 162 deletions contracts/evm/broadcast/SFFLDeployerRollup.s.sol/421614/run-latest.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions contracts/evm/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ out = "out"
libs = ["lib"]
fs_permissions = [{ access = "read-write", path = "./"}]

solc_version = "0.8.12"

# This is a low optimizer_runs setting since the `RegistryCoordinator`
# contract size is really high and we must extend it in SFFL. It would be
# important to increase this value in the future, especially in a mainnet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"addresses": {
"deployer": "0x70d266e7089f15a963638Ec358D5975fc8dAfb6E",
"sfflPauserReg": "0xad79Cf487e89a9EFF4D9009941786fe199AC8Cc8",
"sfflProxyAdmin": "0xCe0480ae3129f22427BC357Cf4CcC3ae8BcE7397",
"sfflRegistryRollup": "0x33335e4Be434724cE003B63eAE499Ce7aaee5508",
"sfflRegistryRollupImpl": "0x8Fa979b662c7a881435b89DbAC18cd8054a13254"
"sfflPauserReg": "0xA782B1fc36666964a544a64F5559bf6aA75E73C0",
"sfflProxyAdmin": "0x7D8d41b1b983b720a3970cA5902c5381cB36b098",
"sfflRegistryRollup": "0xc8B72887e184D033595e060A749212509Ec1B6C8",
"sfflRegistryRollupImpl": "0x08aA5922785793A90A472A0a581833e74db8939a"
},
"chainInfo": {
"chainId": 11155420,
"deploymentBlock": 10963385
"deploymentBlock": 11047724
}
}
36 changes: 18 additions & 18 deletions contracts/evm/script/output/17000/sffl_avs_deployment_output.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"addresses": {
"blsApkRegistry": "0x0Fa24eA86e60f8277696bF88A3980a8E07B7e5DA",
"blsApkRegistryImpl": "0xcEAD489B343485a85c6B32F4285c424A8F08d4d4",
"blsApkRegistry": "0xe098E3dcA9f7913662A55ae7eF0B74fa987628f0",
"blsApkRegistryImpl": "0x86234647eBB7701002f1a26027e9645BadEF0010",
"deployer": "0x70d266e7089f15a963638Ec358D5975fc8dAfb6E",
"indexRegistry": "0x73966B7E0408BBa2BB80D3f5d3cdFBfaC0e323A3",
"indexRegistryImpl": "0x27b085229d64f51308Bd1c635E6Ded607f088686",
"operatorSetUpdateRegistry": "0xDb2B0ac0964809bCc041d1d687bCDfe6210a8E25",
"operatorSetUpdateRegistryImpl": "0x2aD256BD5bCB23824fE84aA3Ea0e96d9ce0dA6a2",
"operatorStateRetriever": "0xE965F1469122641E723CdECd70aa8Ca934Ef4722",
"registryCoordinator": "0x692A6ee6eC6f857144d222832fB7Ff44216BC0A7",
"registryCoordinatorImpl": "0x490ab5736BE21446f10742D5289590fF16e0683C",
"sfflPauserReg": "0x0f13080B1985b828066991A73a62e7E071cB6A00",
"sfflProxyAdmin": "0x648EB6B7eB4F6359BB801B277C6c8d9173aDA9CA",
"sfflServiceManager": "0x7cfF489e3134c3919519e8F7E9fbE31120907d6D",
"sfflServiceManagerImpl": "0x36Ac3831d0f2aDe69A995D2dDAdb3589a42ced30",
"sfflTaskManager": "0xf32Ed569277974b5f70fB44b8c8E3cCc2E1061ce",
"sfflTaskManagerImpl": "0xE3E3313EE805F14Bea65586047F50fB3690CBd0E",
"stakeRegistry": "0x8A668BdFB0406e3dEA3b1fb46400c6Cd849b97B8",
"stakeRegistryImpl": "0xc8bCe5E0573D88BE64920EaB2624ee02A3d5C7CA"
"indexRegistry": "0xC34F6B8a00a2D3931371Fe75830260B6bcBf9BDB",
"indexRegistryImpl": "0x92C398BE767A420f29a19A9F73A59D07e6169037",
"operatorSetUpdateRegistry": "0x8D0b27Df027bc5C41855Da352Da4B5B2C406c1F0",
"operatorSetUpdateRegistryImpl": "0xA1585A624E8B7da1c15D16B007FA5a2A4504681D",
"operatorStateRetriever": "0x729273700C0a8717Cf2Dd93Ced664902882d476b",
"registryCoordinator": "0x0069A298e68c09B047E5447b3b762E42114a99a2",
"registryCoordinatorImpl": "0x0edB96Ff10864E4fdC2Ea74bfd6B707d3847Ce3D",
"sfflPauserReg": "0xb644FA287736c3765EF76aD554446329ab7Eb849",
"sfflProxyAdmin": "0x7116696AC76968743ed8b62E32B1a9Da627a815E",
"sfflServiceManager": "0x2344C0FE02Ccd2b32155Ca0ffcb1978a6d96a552",
"sfflServiceManagerImpl": "0x750954a384174dF80446D97eBbCaE6E1A084DE6E",
"sfflTaskManager": "0x00ee5871e23c7f9C1b99D9eDd1Cf022772a604FD",
"sfflTaskManagerImpl": "0xE4942E6a0744C69E9E14263e5366E30A702e137E",
"stakeRegistry": "0x85D95052Dc794aE86d4d445C4c8d52D9a49Fa3e2",
"stakeRegistryImpl": "0xae16156Ad88dd384963E64A0cEe6101F4F69A276"
},
"chainInfo": {
"chainId": 17000,
"deploymentBlock": 1392446
"deploymentBlock": 1405071
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"addresses": {
"deployer": "0x70d266e7089f15a963638Ec358D5975fc8dAfb6E",
"sfflPauserReg": "0xad79Cf487e89a9EFF4D9009941786fe199AC8Cc8",
"sfflProxyAdmin": "0xCe0480ae3129f22427BC357Cf4CcC3ae8BcE7397",
"sfflRegistryRollup": "0x33335e4Be434724cE003B63eAE499Ce7aaee5508",
"sfflRegistryRollupImpl": "0x8Fa979b662c7a881435b89DbAC18cd8054a13254"
"sfflPauserReg": "0xad7E2A061E2eB8c73cF62E43f276d86d27678363",
"sfflProxyAdmin": "0xc4E5F72B362c6ea70317D9f43905182099Db8aeD",
"sfflRegistryRollup": "0x1988c716Acf7d92E5B252E6d72d13095230E4142",
"sfflRegistryRollupImpl": "0x96aD1164F2265e281f5d48207d8f0d3265EDFF4d"
},
"chainInfo": {
"chainId": 421614,
"deploymentBlock": 36095633
"deploymentBlock": 36772684
}
}
53 changes: 53 additions & 0 deletions docs/docs/deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
sidebar_position: 5
---

# Deployments

## Testnet

:::info

While the opt-in process for NEAR SFFL is currently underway - see
[Registration](./operator/registration) - the testnet is not completely
operational just yet.

:::

### Ethereum Holesky

| Name | Proxy | Implementation |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| SFFLServiceManager | [`0x2344C0FE02Ccd2b32155Ca0ffcb1978a6d96a552`](https://holesky.etherscan.io/address/0x2344C0FE02Ccd2b32155Ca0ffcb1978a6d96a552) | [`0x750954a384174dF80446D97eBbCaE6E1A084DE6E`](https://holesky.etherscan.io/address/0x750954a384174dF80446D97eBbCaE6E1A084DE6E) |
| SFFLTaskManager | [`0x00ee5871e23c7f9C1b99D9eDd1Cf022772a604FD`](https://holesky.etherscan.io/address/0x00ee5871e23c7f9C1b99D9eDd1Cf022772a604FD) | [`0xE4942E6a0744C69E9E14263e5366E30A702e137E`](https://holesky.etherscan.io/address/0xE4942E6a0744C69E9E14263e5366E30A702e137E) |
| SFFLRegistryCoordinator | [`0x0069A298e68c09B047E5447b3b762E42114a99a2`](https://holesky.etherscan.io/address/0x0069A298e68c09B047E5447b3b762E42114a99a2) | [`0x0edB96Ff10864E4fdC2Ea74bfd6B707d3847Ce3D`](https://holesky.etherscan.io/address/0x0edB96Ff10864E4fdC2Ea74bfd6B707d3847Ce3D) |
| SFFLOperatorSetUpdateRegistry | [`0x8D0b27Df027bc5C41855Da352Da4B5B2C406c1F0`](https://holesky.etherscan.io/address/0x8D0b27Df027bc5C41855Da352Da4B5B2C406c1F0) | [`0xA1585A624E8B7da1c15D16B007FA5a2A4504681D`](https://holesky.etherscan.io/address/0xA1585A624E8B7da1c15D16B007FA5a2A4504681D) |
| BLSApkRegistry | [`0xe098E3dcA9f7913662A55ae7eF0B74fa987628f0`](https://holesky.etherscan.io/address/0xe098E3dcA9f7913662A55ae7eF0B74fa987628f0) | [`0x86234647eBB7701002f1a26027e9645BadEF0010`](https://holesky.etherscan.io/address/0x86234647eBB7701002f1a26027e9645BadEF0010) |
| IndexRegistry | [`0xC34F6B8a00a2D3931371Fe75830260B6bcBf9BDB`](https://holesky.etherscan.io/address/0xC34F6B8a00a2D3931371Fe75830260B6bcBf9BDB) | [`0x92C398BE767A420f29a19A9F73A59D07e6169037`](https://holesky.etherscan.io/address/0x92C398BE767A420f29a19A9F73A59D07e6169037) |
| StakeRegistry | [`0x85D95052Dc794aE86d4d445C4c8d52D9a49Fa3e2`](https://holesky.etherscan.io/address/0x85D95052Dc794aE86d4d445C4c8d52D9a49Fa3e2) | [`0xae16156Ad88dd384963E64A0cEe6101F4F69A276`](https://holesky.etherscan.io/address/0xae16156Ad88dd384963E64A0cEe6101F4F69A276) |
| OperatorStateRetriever | - | [`0x729273700C0a8717Cf2Dd93Ced664902882d476b`](https://holesky.etherscan.io/address/0x729273700C0a8717Cf2Dd93Ced664902882d476b) |
| PauserRegistry | - | [`0xb644FA287736c3765EF76aD554446329ab7Eb849`](https://holesky.etherscan.io/address/0xb644FA287736c3765EF76aD554446329ab7Eb849) |
| ProxyAdmin | - | [`0x7116696AC76968743ed8b62E32B1a9Da627a815E`](https://holesky.etherscan.io/address/0x7116696AC76968743ed8b62E32B1a9Da627a815E) |

### Arbitrum Sepolia

| Name | Proxy | Implementation |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| SFFLRegistryRollup | [`0x1988c716Acf7d92E5B252E6d72d13095230E4142`](https://sepolia.arbiscan.io/address/0x1988c716Acf7d92E5B252E6d72d13095230E4142) | [`0x96aD1164F2265e281f5d48207d8f0d3265EDFF4d`](https://sepolia.arbiscan.io/address/0x96aD1164F2265e281f5d48207d8f0d3265EDFF4d) |
| ProxyAdmin | - | [`0xc4E5F72B362c6ea70317D9f43905182099Db8aeD`](https://sepolia.arbiscan.io/address/0xc4E5F72B362c6ea70317D9f43905182099Db8aeD) |
| PauserRegistry | - | [`0xad7E2A061E2eB8c73cF62E43f276d86d27678363`](https://sepolia.arbiscan.io/address/0xad7E2A061E2eB8c73cF62E43f276d86d27678363) |

### Optimism Sepolia

| Name | Proxy | Implementation |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| SFFLRegistryRollup | [`0xc8B72887e184D033595e060A749212509Ec1B6C8`](https://sepolia-optimism.etherscan.io/address/0xc8B72887e184D033595e060A749212509Ec1B6C8) | [`0x08aA5922785793A90A472A0a581833e74db8939a`](https://sepolia-optimism.etherscan.io/address/0x08aA5922785793A90A472A0a581833e74db8939a) |
| ProxyAdmin | - | [`0x7D8d41b1b983b720a3970cA5902c5381cB36b098`](https://sepolia-optimism.etherscan.io/address/0x7D8d41b1b983b720a3970cA5902c5381cB36b098) |
| PauserRegistry | - | [`0xA782B1fc36666964a544a64F5559bf6aA75E73C0`](https://sepolia-optimism.etherscan.io/address/0xA782B1fc36666964a544a64F5559bf6aA75E73C0) |

### NEAR Testnet

| Network | NEAR DA Contract |
| ---------------- | -------------------------------------------------------------------------------------------------- |
| Arbitrum Sepolia | [`sfrelayer421614-1.testnet`](https://testnet.nearblocks.io/address/sfrelayer421614-1.testnet) |
| Optimism Sepolia | [`sfrelayer11155420-1.testnet`](https://testnet.nearblocks.io/address/sfrelayer11155420-1.testnet) |
137 changes: 137 additions & 0 deletions docs/docs/operator/registration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
sidebar_position: 1
---

# Registration

Here we'll go step-by-step on how to opt-in into NEAR SFFL. It's a quick and
easy process that will allow you to start contributing to the network once the
testnet starts functioning.

## Hardware Requirements

The opt-in process is not hardware-intensive - you should be able to do it with
little to no specific requirements. If you wish to use the same setup to run
the operator in the future, you can follow the hardware requirements on
[Setup](./setup).

## Steps

:::note

At this initial testnet stage, operators need to be whitelisted. If you are
interested and have not already been whitelisted, please contact the SFFL
team!

:::

### Step 1: Complete EigenLayer Operator Registration

Complete the EigenLayer CLI installation and registration [here](https://docs.eigenlayer.xyz/operator-guides/operator-installation).

### Step 2: Install Docker

Install [Docker Engine on Linux](https://docs.docker.com/engine/install/ubuntu/).

### Step 3: Prepare Local SFFL files

Clone the SFFL repository and execute the following.

```
git clone https://github.com/NethermindEth/near-sffl.git
cd near-sffl/setup/operator
cp .env.example .env
```

### Step 4: Copy your EigenLayer operator keys to the setup directory

```
cp <path-to-your-operator-ecdsa-key> ./config/keys/ecdsa.json
cp <path-to-your-operator-bls-key> ./config/keys/bls.json
```

### Step 5: Update your `.env` file

You should have something similar to this in your `.env`:
```bash
# Tagged release for SFFL containers
SFFL_RELEASE=latest

# NEAR chain ID
NEAR_CHAIN_ID=testnet

# NEAR home and keys directories
NEAR_HOME_DIR=~/.near
NEAR_KEYS_DIR=~/.near-credentials

# Operator BLS and ECDSA key passwords (from config/keys files)
OPERATOR_BLS_KEY_PASSWORD=fDUMDLmBROwlzzPXyIcy
OPERATOR_ECDSA_KEY_PASSWORD=EnJuncq01CiVk9UbuBYl
```

For registering, set your EigenLayer ECDSA and BLS key passwords in the
`OPERATOR_ECDSA_KEY_PASSWORD` and `OPERATOR_BLS_KEY_PASSWORD` fields.

### Step 6: Update your configuration files

Now, in `setup/operator/config/operator.yaml`, set your `operator_address`
and double-check the contract addresses.

```yaml
# Production flag for logging - false for printing debug logs
production: false

# Operator ECDSA address
operator_address: 0xD5A0359da7B310917d7760385516B2426E86ab7f

# AVS contract addresses
avs_registry_coordinator_address: 0x0069A298e68c09B047E5447b3b762E42114a99a2
operator_state_retriever_address: 0x8D0b27Df027bc5C41855Da352Da4B5B2C406c1F0

# AVS network RPCs
# *Important*: The WS RPC must allow event subscriptions. As Public Node
# doesn't support it, you should use a different RPC provider.
eth_rpc_url: https://ethereum-holesky-rpc.publicnode.com
eth_ws_url: wss://ethereum-holesky-rpc.publicnode.com # You should change this!

# EigenLayer ECDSA and BLS private key paths
ecdsa_private_key_store_path: /near-sffl/config/keys/ecdsa.json
bls_private_key_store_path: /near-sffl/config/keys/bls.json

# Aggregator server IP and port
aggregator_server_ip_port_address: near-sffl-aggregator:8090

# Operator EigenLayer metrics server IP and port
eigen_metrics_ip_port_address: 0.0.0.0:9090
enable_metrics: true
node_api_ip_port_address: 0.0.0.0:9010
enable_node_api: true

# Whether to try and register the operator in the AVS and in EL on startup.
# It will not re-register the operator if already registered.
# If unset, the operator will not be registered on startup! You'll need to
# manually register the operator - not recommended
register_operator_on_startup: true

# RMQ address and indexer rollup IDs
near_da_indexer_rmq_ip_port_address: amqp://rmq:5672
near_da_indexer_rollup_ids: [421614, 11155420]

# Rollup RPCs
rollup_ids_to_rpc_urls:
421614: wss://arbitrum-sepolia-rpc.publicnode.com
11155420: wss://optimism-sepolia-rpc.publicnode.com

# Token strategy address
# Mock strategy to deposit when registering (only used for testing)
token_strategy_addr: 0x0000000000000000000000000000000000000000
```
You'll need to refer to the [Setup](./setup) again before running the node for
other important fields.
### Step 6: Run the registration script
Now, simply run `./register.sh`! This will fetch our latest operator plugin
container and run it with the `--operation-type opt-in` flag. It will
opt-in your operator into SFFL.
54 changes: 38 additions & 16 deletions docs/docs/operator/setup.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
---
sidebar_position: 3
sidebar_position: 2
---

# Operator Setup
# Setup

## Introduction
:::info

While the opt-in process for NEAR SFFL is currently underway - see
[Registration](./registration) - the testnet is not completely operational
just yet, so it's currently not required that operators run a node. Keep an
eye out for updates!

:::

This guide will walk you through the steps required to set up your operator
node on the NEAR SFFL testnet. The testnet serves as a sandbox environment
Expand Down Expand Up @@ -38,11 +45,15 @@ lscpu | grep -P '(?=.*avx )(?=.*sse4.2 )(?=.*cx16 )(?=.*popcnt )' > /dev/null \
|| echo "Not supported"
```

## Registration
## Steps

:::note

> At this initial testnet stage, operators need to be whitelisted. If you are
> interested and have not already been whitelisted, please contact the SFFL
> team!
At this initial testnet stage, operators need to be whitelisted. If you are
interested and have not already been whitelisted, please contact the SFFL
team!

:::

### Step 1: Complete EigenLayer Operator Registration

Expand Down Expand Up @@ -109,8 +120,8 @@ production: false
operator_address: 0xD5A0359da7B310917d7760385516B2426E86ab7f

# AVS contract addresses
avs_registry_coordinator_address: 0x692A6ee6eC6f857144d222832fB7Ff44216BC0A7
operator_state_retriever_address: 0xDb2B0ac0964809bCc041d1d687bCDfe6210a8E25
avs_registry_coordinator_address: 0x0069A298e68c09B047E5447b3b762E42114a99a2
operator_state_retriever_address: 0x8D0b27Df027bc5C41855Da352Da4B5B2C406c1F0

# AVS network RPCs
# *Important*: The WS RPC must allow event subscriptions. As Public Node
Expand All @@ -119,16 +130,16 @@ eth_rpc_url: https://ethereum-holesky-rpc.publicnode.com
eth_ws_url: wss://ethereum-holesky-rpc.publicnode.com # You should change this!

# EigenLayer ECDSA and BLS private key paths
ecdsa_private_key_store_path: keys/ecdsa.json
bls_private_key_store_path: keys/bls.json
ecdsa_private_key_store_path: /near-sffl/config/keys/ecdsa.json
bls_private_key_store_path: /near-sffl/config/keys/bls.json

# Aggregator server IP and port
aggregator_server_ip_port_address: near-sffl-aggregator:8090

# Operator EigenLayer metrics server IP and port
eigen_metrics_ip_port_address: near-sffl-operator:9090
eigen_metrics_ip_port_address: 0.0.0.0:9090
enable_metrics: true
node_api_ip_port_address: near-sffl-operator:9010
node_api_ip_port_address: 0.0.0.0:9010
enable_node_api: true

# Whether to try and register the operator in the AVS and in EL on startup.
Expand Down Expand Up @@ -201,12 +212,23 @@ NEAR.

### Step 7: Run your operator

> **Important:** This step is only available once the testnet deployment is
> made.
:::info

This step is only available once the testnet deployment is completely made.

:::

This is the final step!

Stop the previous execution with `Ctrl+C`. Then, run the following:
Stop the previous execution with `Ctrl+C`. Then, update your repository state:
```
git stash
git pull
git stash pop
```

After that, double-check your `.env` and `config/operator.yaml` files, then
simply run:
```
source .env
docker compose --profile indexer --profile operator pull
Expand Down
Loading

0 comments on commit 47a1dd6

Please sign in to comment.