Skip to content

Commit

Permalink
Merge pull request #12 from Hydrogen-Labs/anzen-working-branch
Browse files Browse the repository at this point in the history
smol improvements
  • Loading branch information
diyahir authored Sep 26, 2024
2 parents 54e36dd + 5159919 commit 1465067
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 25 deletions.
2 changes: 1 addition & 1 deletion config-files/holesky/sample.aggregator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ eth_rpc_url: your_eth_holesky_rpc_url
eth_ws_url: your_eth_holesky_ws_url

# address which the aggregator listens on for operator signed messages
aggregator_server_ip_port_address: localhost:8090
aggregator_server_ip_port_address: 0.0.0.0:8090
# use 0.0.0.0:8090 if you want to expose the aggregator to the network
31 changes: 19 additions & 12 deletions contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
## Architecture
## Smart Contract Architecture

```mermaid
graph TD
F[Anzen Operators] -->|Oracle Consensus| A[Anzen Task Manager]
G[Anzen Aggregator] -->|Initializes Tasks| A
A -->|Operator Consensus| B((Safety Factor Oracle))
B --> |Adjusts Emissions| D((AVS Reserves))
C[AVS Reserves Factory] --> |Creates Reserves Manager| D
B --> |Adjusts Emissions| D1((AVS1 Reserves))
B --> |Adjusts Emissions| D2((AVS2 Reserves))
B --> |Adjusts Emissions| D3((AVS3 Reserves))
C[AVS Reserves Factory] --> |Creates Reserves Manager| D1
C --> |Creates Reserves Manager| D2
C --> |Creates Reserves Manager| D3
C --> |Register AVS| B
subgraph AVS Controlled Contracts
D --> |Sends Payment| E((AVS Reward Manager))
subgraph AVS1 Controlled Contracts
D1 --> |Sends Payment| E1((AVS1 Reward Manager))
end
subgraph AVS2 Controlled Contracts
D2 --> |Sends Payment| E2((AVS2 Reward Manager))
end
subgraph AVS3 Controlled Contracts
D3 --> |Sends Payment| E3((AVS3 Reward Manager))
end
```

### Build
Expand Down Expand Up @@ -47,13 +60,7 @@ $ anvil
### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
$ make deploy-anzen-contracts-to-anvil-and-save-state
```

### Help
Expand Down
36 changes: 25 additions & 11 deletions docs/holesky-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,35 @@ Follow the Eigenlayer guide to create keys [here](https://docs.eigenlayer.xyz/ei

### Create config files

You only need to set up the operator.yaml file for the operator. If you want to set up an aggregator you will need to set up the aggregator.yaml file as well, but this is not required to join the AVS.

```bash
cd config-files/holesky
cp sample.aggregator.yaml aggregator.yaml
cp sample.operator.yaml operator.yaml
```

Optional:

```bash
cp sample.aggregator.yaml aggregator.yaml
```

Edit the aggregator.yaml and operator.yaml files with your variables:

[aggregator.yaml](../config-files/holesky/aggregator.yaml)

[operator.yaml](../config-files/holesky/operator.yaml)

### Start the Holesky AVS using Make
### Start the Holesky AVS using Docker

```bash
make start-aggregator-holesky
```
#### Operator

in a separate terminal

```bash
make start-operator-holesky
docker compose -f operator.docker-compose.yml up
```

### Start the Holesky AVS using Docker

#### Aggregator

Configure the aggregator environment variables with the aggregator private key
Expand All @@ -72,16 +75,27 @@ cp sample.aggregator.env .env
docker compose -f aggregator.docker-compose.yml up
```

#### Operator
### Start the Holesky AVS using Make

in a separate terminal
```bash
make start-operator-holesky
```

Optional:

```bash
docker compose -f operator.docker-compose.yml up
make start-aggregator-holesky
```

## Troubleshooting

First, you should check for any updates to the operator image

```bash
docker pull ghcr.io/hydrogen-labs/anzen-avs/aggregator/cmd/main.go:latest
docker pull ghcr.io/hydrogen-labs/anzen-avs/operator/cmd/main.go:latest
```

#### RPC Issues

Ensure that your RPC client let's you create websocket subscriptions.
Expand Down
2 changes: 1 addition & 1 deletion operator.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ services:
- config-files/holesky/operator.yaml
- --anzen-deployment
- contracts/script/output/17000/anzen_avs_deployment_output.json
network_mode: "bridge"
network_mode: "host"

1 change: 1 addition & 0 deletions safety-factor/safety_factor_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (s *SafetyFactorService) IsSafetyFactorInfoStale(moduleID int32) (bool, err
// TODO let this be configurable

// Check if the safety factor has deviated
// TODO: check if the deviation is within the threshold
isDeviated := latestSafetyFactorOffChainInfo.SF.Cmp(currentSafetyFactorOnChainInfo.SafetyFactor) != 0

// Check if the safety factor is stale by one minute
Expand Down

0 comments on commit 1465067

Please sign in to comment.