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

Anzen working branch #11

Merged
merged 5 commits into from
Sep 4, 2024
Merged
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
11 changes: 6 additions & 5 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:
- master
pull_request:

jobs:
jobs:
Test:
name: Integration Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"

# we use forge right now as part of integration test, so need to install it first
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand All @@ -24,6 +24,7 @@ jobs:
- name: Install forge dependencies
run: forge install
working-directory: ./contracts

- name: Create ENV file
run: cp sample.aggregator.env .env
- name: Test
run: make tests-integration
run: make tests-integration
8 changes: 5 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
- master
pull_request:

jobs:
jobs:
Test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"
- name: Set up environment variables
run: cp sample.aggregator.env .env
- name: Test
run: make tests-unit
run: make tests-unit
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This imports the environment variables from the .env file
include .env
export $(shell sed 's/=.*//' .env)
############################# HELP MESSAGE #############################
# Make sure the help command stays first, so that it's printed by default when `make` is called without arguments
.PHONY: help tests
Expand Down Expand Up @@ -84,7 +87,7 @@ start-aggregator: ##
start-aggregator-holesky:
go run aggregator/cmd/main.go --config config-files/holesky/aggregator.yaml \
--anzen-deployment ${HOLESKY_FILES_DIR}/anzen_avs_deployment_output.json \
--ecdsa-private-key ${AGGREGATOR_ECDSA_PRIV_KEY} \
--ecdsa-private-key ${ECDSA_PRIVATE_KEY} \
2>&1 | zap-pretty


Expand Down
2 changes: 2 additions & 0 deletions aggregator.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ services:
- ${ECDSA_PRIVATE_KEY}
env_file:
- .env
network_mode: "bridge"

1 change: 1 addition & 0 deletions config-files/holesky/sample.aggregator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ 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
# use 0.0.0.0:8090 if you want to expose the aggregator to the network
17 changes: 17 additions & 0 deletions operator.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3"

services:
operator:
image: ghcr.io/hydrogen-labs/anzen-avs/operator/cmd/main.go:latest
container_name: anzen-operator
volumes:
- ./:/anzen/
working_dir: /anzen
restart: always
command:
- --config
- config-files/holesky/operator.yaml
- --anzen-deployment
- contracts/script/output/17000/anzen_avs_deployment_output.json
network_mode: "bridge"

2 changes: 1 addition & 1 deletion operator/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {
app.Flags = []cli.Flag{config.ConfigFileFlag, config.AnzenDeploymentFileFlag}
app.Name = "anzen-operator"
app.Usage = "Anzen Operator"
app.Description = "Service that reads numbers onchain, squares, signs, and sends them to the aggregator."
app.Description = "Service that reads AVS economic secuirty metrics posted onchain, verifies, signs, and sends them to the aggregator."

app.Action = operatorMain
err := app.Run(os.Args)
Expand Down
1 change: 1 addition & 0 deletions operator/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (o *Operator) RegisterOperatorWithAvs(
// TODO: make these configurable
quorumNumbers := eigenSdkTypes.QuorumNums{eigenSdkTypes.QuorumNum(0)}
socket := "Not Needed"
// Salt this salt if reused will cause this operation to fail
operatorToAvsRegistrationSigSalt := [32]byte{125}
curBlockNum, err := o.ethClient.BlockNumber(context.Background())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion sample.aggregator.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ECDSA_PRIVATE_KEY=your_private_key_here
ECDSA_PRIVATE_KEY="0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"
Loading