From c908c156011c27771384ac7db28b167a142e8dae Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 9 Jun 2024 11:49:20 +0800 Subject: [PATCH 1/6] add workflow to check bindings are up-to-date --- .github/workflows/check-bindings.yml | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/check-bindings.yml diff --git a/.github/workflows/check-bindings.yml b/.github/workflows/check-bindings.yml new file mode 100644 index 00000000..ecb8a0a5 --- /dev/null +++ b/.github/workflows/check-bindings.yml @@ -0,0 +1,52 @@ +name: check bindings up-to-date +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + +jobs: + make-bindings: + name: make bindings + runs-on: ubuntu-latest + steps: + - name: Checkout EigenCert + uses: actions/checkout@v4 + + - name: Install go1.21 + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Add Ethereum PPA + run: sudo add-apt-repository -y ppa:ethereum/ethereum + + - name: Install Abigen + run: sudo apt-get update && sudo apt-get install ethereum + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Run make bindings and check for diffs + run: | + make bindings > output.txt + if [ "$(grep -c -i "fatal" output.txt)" -ge 1 ]; then + printf "Make binding run FAILED\n" + rm output.txt + exit 1 + else + echo "make_bindings_success=true" >> $GITHUB_ENV + rm output.txt + fi + + if [ ! -z "$(git status --porcelain)" ]; then + printf "Current generated bindings not up to date\n" + git diff + git status + exit 1 + fi \ No newline at end of file From b6a3f91ccbdc1ce4ac7052003d4fddcdd9722df2 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 9 Jun 2024 11:49:27 +0800 Subject: [PATCH 2/6] add workflow to check mocks are up-to-date --- .github/workflows/check-mocks.yml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/check-mocks.yml diff --git a/.github/workflows/check-mocks.yml b/.github/workflows/check-mocks.yml new file mode 100644 index 00000000..16bf1f5b --- /dev/null +++ b/.github/workflows/check-mocks.yml @@ -0,0 +1,32 @@ +name: check mocks up-to-date +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + +jobs: + make-mocks: + name: make mocks + runs-on: ubuntu-latest + steps: + - name: checkout EigenCert + uses: actions/checkout@v4 + + - name: install go1.21 + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: run make mocks + run: | + make mocks + if [ ! -z "$(git status --porcelain)" ]; then + printf "Current generated mocks not up to date\n" + git diff + git status + exit 1 + fi \ No newline at end of file From cdd16de16603e328c9b9ab272d5da067689fdd30 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 9 Jun 2024 15:34:03 +0800 Subject: [PATCH 3/6] fix typos --- .github/workflows/check-bindings.yml | 42 ++++++++++++++-------------- .github/workflows/check-mocks.yml | 6 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/check-bindings.yml b/.github/workflows/check-bindings.yml index ecb8a0a5..19034ef6 100644 --- a/.github/workflows/check-bindings.yml +++ b/.github/workflows/check-bindings.yml @@ -10,22 +10,22 @@ permissions: jobs: make-bindings: - name: make bindings + name: make bindings and check for diffs runs-on: ubuntu-latest steps: - - name: Checkout EigenCert + - name: Checkout repo uses: actions/checkout@v4 - name: Install go1.21 uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: "1.21" - name: Add Ethereum PPA run: sudo add-apt-repository -y ppa:ethereum/ethereum - name: Install Abigen - run: sudo apt-get update && sudo apt-get install ethereum + run: sudo apt-get update && sudo apt-get install ethereum - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 @@ -33,20 +33,20 @@ jobs: version: nightly - name: Run make bindings and check for diffs - run: | - make bindings > output.txt - if [ "$(grep -c -i "fatal" output.txt)" -ge 1 ]; then - printf "Make binding run FAILED\n" - rm output.txt - exit 1 - else - echo "make_bindings_success=true" >> $GITHUB_ENV - rm output.txt - fi - - if [ ! -z "$(git status --porcelain)" ]; then - printf "Current generated bindings not up to date\n" - git diff - git status - exit 1 - fi \ No newline at end of file + run: | + make bindings > output.txt + if [ "$(grep -c -i "fatal" output.txt)" -ge 1 ]; then + printf "Make binding run FAILED\n" + rm output.txt + exit 1 + else + echo "make_bindings_success=true" >> $GITHUB_ENV + rm output.txt + fi + + if [ ! -z "$(git status --porcelain)" ]; then + printf "Current generated bindings not up to date\n" + git diff + git status + exit 1 + fi diff --git a/.github/workflows/check-mocks.yml b/.github/workflows/check-mocks.yml index 16bf1f5b..b40754ed 100644 --- a/.github/workflows/check-mocks.yml +++ b/.github/workflows/check-mocks.yml @@ -10,10 +10,10 @@ permissions: jobs: make-mocks: - name: make mocks + name: make mocks and check for diffs runs-on: ubuntu-latest steps: - - name: checkout EigenCert + - name: checkout repo uses: actions/checkout@v4 - name: install go1.21 @@ -21,7 +21,7 @@ jobs: with: go-version: '1.21' - - name: run make mocks + - name: run make mocks and check for diffs run: | make mocks if [ ! -z "$(git status --porcelain)" ]; then From b871b185a59ba514cbd094c8aaffded89a268713 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 9 Jun 2024 15:34:21 +0800 Subject: [PATCH 4/6] fix bug: check-bindings checkout repo recursively --- .github/workflows/check-bindings.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-bindings.yml b/.github/workflows/check-bindings.yml index 19034ef6..a4ccff52 100644 --- a/.github/workflows/check-bindings.yml +++ b/.github/workflows/check-bindings.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + with: + submodules: 'recursive' - name: Install go1.21 uses: actions/setup-go@v5 From 83142a1b0e281414d5d64a1a8d330f148c11f6c0 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 9 Jun 2024 15:48:33 +0800 Subject: [PATCH 5/6] remove git diff line --- .github/workflows/check-bindings.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-bindings.yml b/.github/workflows/check-bindings.yml index a4ccff52..5d1fc2ef 100644 --- a/.github/workflows/check-bindings.yml +++ b/.github/workflows/check-bindings.yml @@ -48,7 +48,8 @@ jobs: if [ ! -z "$(git status --porcelain)" ]; then printf "Current generated bindings not up to date\n" - git diff + # git diff fails by lack of read permission.. not sure why so just commented it out + # git diff git status exit 1 fi From 332001ae064956696acefc671d30d667585250e7 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 9 Jun 2024 16:27:17 +0800 Subject: [PATCH 6/6] fix generate-bindings locally --- contracts/generate-bindings.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/generate-bindings.sh b/contracts/generate-bindings.sh index 6a02696a..bd0c5e34 100755 --- a/contracts/generate-bindings.sh +++ b/contracts/generate-bindings.sh @@ -7,7 +7,7 @@ script_path=$( ) # build abigen-with-interfaces docker image if it doesn't exist -if [[ "$(docker images -q abigen-with-interfaces 2> /dev/null)" == "" ]]; then +if [[ "$(docker images -q abigen-with-interfaces 2>/dev/null)" == "" ]]; then docker build -t abigen-with-interfaces -f abigen-with-interfaces.Dockerfile $script_path fi @@ -47,7 +47,7 @@ cd $EIGENLAYER_CONTRACT_PATH forge build # No idea why but the ordering of the contracts matters, and for some orderings abigen fails... -el_contracts="DelegationManager ISlasher StrategyManager EigenPod EigenPodManager IStrategy IERC20 AVSDirectory" +el_contracts="DelegationManager ISlasher StrategyManager EigenPod EigenPodManager IStrategy AVSDirectory IERC20" for contract in $el_contracts; do create_binding . $contract ../../../../bindings done