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

Make deployment scripts more flexible #54

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

wawrzek
Copy link

@wawrzek wawrzek commented May 9, 2024

Move config files into a chain specific subfolder of the config-files folder. This enables easy testing with non-chain specific deployments, but adjusting the CHAINID variable in the Makefile.

For the same reason, I also moved one of the key, the one used to top the operator up with Ether, into a variable.

Why? I deploy the AVS into non-anvil chain, quite a few values are hardcoded in config files. The change is probably a minimal change to enables such test, and it does not affect current method of deployment.

Wawrzyniec 'Wawrzek' Niewodniczański added 2 commits May 9, 2024 18:58
Move config files into a chain specific directory and adjust makefile
- docker-compose.yml
- integration-tests
- deposit script
- comments in the code
@samlaf
Copy link
Collaborator

samlaf commented May 14, 2024

@wawrzek LGTM, let me merge the other PR that fixed the docker compose up test, and then you can rebase on top and we'll merge your changes.

EDIT: just merged. Can you rebase and fix the conflicts? Hopefully it won't be too painful. :D

@wawrzek
Copy link
Author

wawrzek commented May 14, 2024

@samlaf thanks for the message. I noticed that you merged the other branch, so I merged it into my PR. AFAIK it's still fine.

samlaf
samlaf previously approved these changes May 15, 2024
Copy link
Collaborator

@samlaf samlaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Not a big fan of having CHAINID defined in the Makefile b/c there's no way to overwrite it with CHAINID=1 make ... for eg. I'm guessing you're changing CHAINID manually in the makefile when you want to target another chain?

We could do something like set

ifndef CHAINID
$(error CHAINID is not set)
endif

but then that's globally enforced for all commands in the makefile, which can get annoying. I typically move all make commands to a bash script and use set -o nounset to crash if a variable is not defined. But that's a lot of work here, so let's just run with this for now.

@@ -14,4 +14,4 @@ CHAINID=$(cast chain-id)
DEPLOYMENT_OUTPUT_FILE=./contracts/script/output/${CHAINID}/credible_squaring_avs_deployment_output.json
STRATEGY_ADDRESS=$(jq -r '.addresses.erc20MockStrategy' $DEPLOYMENT_OUTPUT_FILE)

go run cli/main.go --config config-files/operator.anvil.yaml deposit-into-strategy --strategy-addr ${STRATEGY_ADDRESS} --amount 100
go run cli/main.go --config config-files/${CHAINID}/operator.anvil.yaml deposit-into-strategy --strategy-addr ${STRATEGY_ADDRESS} --amount 100
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can change this to ${CHAINID:?} or use set -o nounset at the top of the file. This way the script will early exit if the variable is not defined.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following works

make CHAINID=32382 start-aggregator

so, there is an easy way to overwrite the CHAINID and other variables. However, I agree that maybe setting the CHAINID in the Makefile is not optimal. I just wanted to make an incremental change. Collect all variables in one place, so they can be handled better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wawrzek could you update this to reflect 2 items:

  1. to use ${CHAINID:?} (in spite of make CHAIND=32382... working)
  2. update the README to highlight that start-aggregator should be run with a CHAINID env var

Otherwise lgtm

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NimaVaziri , I've been looking at changing the behaviour of the make commands and I don't like it. Despite me wanting to use a different chain id I think the change should not make life harder for others, so keep the current behaviour when the CHAINID might be omitted.
I suggest an alternative. Keep current Makefile, but extend documentation by a paragraph describing how to deploy AVS into a network different from the anvil one. The change is in the latest commit.

- add information on how to use CHAINID
wawrzek and others added 3 commits June 14, 2024 16:12
New version:
- prometheus
- grafana

Remove trailing whitespaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants