Skip to content

Commit

Permalink
Merge pull request #3 from gasp-xyz/feature/bumb-eigenware
Browse files Browse the repository at this point in the history
bump-eigenware
  • Loading branch information
iStrike7 authored Sep 27, 2024
2 parents 5f7ce8c + 65e3628 commit 8566e71
Show file tree
Hide file tree
Showing 189 changed files with 22,877 additions and 8,192 deletions.
19 changes: 6 additions & 13 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
Fixes # .

### Motivation
<!--
Does this solve a bug? Enable a new use-case? Improve an existing behavior? Concrete examples are helpful here.
-->
### What Changed?
<!-- Describe the changes made in this pull request -->

### Solution
<!--
What is the solution here from a high level. What are the key technical decisions and why were they made?
-->

### Open questions
<!--
(optional) Any open questions or feedback on design desired?
-->
### Reviewer Checklist
- [ ] Code is well-documented
- [ ] Code adheres to Go [naming conventions](https://go.dev/doc/effective_go#names)
- [ ] Code deprecates any old functionality before removing it
8 changes: 4 additions & 4 deletions .github/actions/test-coverage/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Checkout wiki
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{github.repository}}.wiki
token: ${{ github.token }}
path: ./.github/wiki/

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{inputs.go-version}}

Expand All @@ -55,4 +55,4 @@ runs:
git remote set-url --push origin https://${{ github.token }}@github.com/Layr-Labs/eigensdk-go.wiki.git
test ${{inputs.amend}} == "true" && \
git commit --amend --no-edit && git push --force-with-lease || \
git commit -m "Update coverage" && git push https://${{ github.token }}@github.com/Layr-Labs/eigensdk-go.wiki.git
git commit -m "Update coverage" && git push https://${{ github.token }}@github.com/Layr-Labs/eigensdk-go.wiki.git
33 changes: 33 additions & 0 deletions .github/workflows/check-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: check that make fmt was run
on:
push:
branches:
- dev
pull_request:

permissions:
contents: read

jobs:
check-make-fmt:
name: check make fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install go1.21
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Run make fmt
run: make fmt

- name: Check if make fmt generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make fmt generated changes that should be committed. Please run 'make fmt' and commit the changes."
git diff
git status
exit 1
fi
32 changes: 32 additions & 0 deletions .github/workflows/check-mocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: check mocks up-to-date
on:
push:
branches:
- dev
pull_request:

permissions:
contents: read

jobs:
make-mocks:
name: make mocks and check for diffs
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

- name: install go1.21
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: run make mocks and check for diffs
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
15 changes: 9 additions & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ name: lint
on:
push:
branches:
- master
- dev
pull_request:

jobs:
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4

- name: install go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout 3m
args: --timeout 3m
10 changes: 4 additions & 6 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@ name: test-coverage

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ dev ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Update coverage badge
uses: ./.github/actions/test-coverage
with:
chart: true
amend: true
amend: true
8 changes: 4 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ name: unit-tests
on:
push:
branches:
- master
- dev
pull_request:

jobs:
Test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Test
run: make tests
run: make tests
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "contracts/lib/eigenlayer-middleware"]
path = contracts/lib/eigenlayer-middleware
url = git@github.com:Layr-Labs/eigenlayer-middleware.git
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = git@github.com:foundry-rs/forge-std
32 changes: 29 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,35 @@ Licensor: Layr Labs, Inc.
Licensed Work: EigenSDK Go
The Licensed Work is (c) 2023 Layr Labs, Inc.

Additional Use Grant: None.
Additional Use Grant:

Change Date: 2025-09-29 (September 29th, 2025)
You may additionally use any of the software included in the following repositories
[here](https://docs.google.com/spreadsheets/d/1PlJRow5C0GMqXZlIxRm5CEnkhH-gMV1wIdq1pCfbZco/edit?usp=sharing)
(“Additional Use Grant Software”) for production commercial uses, but only if such
uses are (i) built on or using the EigenLayer Protocol or EigenDA, and (ii) not
Competing Uses.

“Competing Use” means any use of the Additional Use Grant Software in any product,
protocol, application or service that is made available to third parties and that
(i) substitutes for use of EigenLayer Protocol or EigenDA, (ii) offers the same or
substantially similar functionality as the EigenLayer Protocol or EigenDA or
(iii) is built on or using a protocol with substantially similar functionality as
the EigenLayer Protocol.

EigenLayer Protocol means the restaking protocol as further described in the
documentation [here](https://docs.eigenlayer.xyz/), as updated from time to time.

EigenDA means the data availability protocol built on top of the EigenLayer
Protocol as further described in the documentation
[here](https://docs.eigenlayer.xyz/eigenda/overview), as updated from time to time.

Change Dates:

- All commits at or prior to commit 2bab9cc006a52173e4c042ad12d268ad9ef96a15
(i.e. committed to this repository on or before May 9, 2024) have a
change date of 2025-09-29 (September 29th, 2025)
- All commits after 2bab9cc006a52173e4c042ad12d268ad9ef96a15 (i.e. committed to this
repository after May 9, 2024) have a change date of 2027-05-01 (May 1st, 2027)

Change License: MIT

Expand Down Expand Up @@ -95,4 +121,4 @@ Notice

The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
under an Open Source License, as stated in this License.
92 changes: 84 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
############################# HELP MESSAGE #############################
# Make sure the help command stays first, so that it's printed by default when `make` is called without arguments
.PHONY: help bindings mocks tests tests-cover fmt format-lines lint

GO_LINES_IGNORED_DIRS=contracts
GO_PACKAGES=./chainio/... ./crypto/... ./logging/... \
./types/... ./utils/... ./signer/... ./cmd/... \
./signerv2/...
./signerv2/... ./aws/... ./internal/... ./metrics/... \
./nodeapi/... ./cmd/... ./services/... ./testutils/...
GO_FOLDERS=$(shell echo ${GO_PACKAGES} | sed -e "s/\.\///g" | sed -e "s/\/\.\.\.//g")

.PHONY: help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

bindings: ## generates contract bindings
cd contracts && rm -rf bindings/* && ./generate-bindings.sh

.PHONY: mocks
mocks: ## generates mocks
go install go.uber.org/mock/mockgen@v0.4.0
go generate ./...

.PHONY: tests
tests: ## runs all tests
go test ./... -timeout=30s
go test -race ./... -timeout=1m

.PHONY: tests-cover
tests-cover: ## run all tests with test coverge
go test ./... -coverprofile=coverage.out -covermode=atomic -v -count=1
go test -race ./... -coverprofile=coverage.out -covermode=atomic -v -count=1
go tool cover -html=coverage.out -o coverage.html
open coverage.html

godoc-port = 6060
.PHONY: godoc
godoc: ## runs godoc server and opens in browser
@echo "Starting godoc server on port $(godoc-port)..."
@-godoc -http=:$(godoc-port) & echo $$! > godoc.pid
Expand All @@ -38,14 +41,87 @@ godoc: ## runs godoc server and opens in browser
@# The read varname command will keep the make command running (waiting for input) until you press CTRL+C.
@trap 'kill `cat godoc.pid` && rm -f godoc.pid' EXIT; read varname

.PHONY: fmt
fmt: ## formats all go files
go fmt ./...
make format-lines

.PHONY: format-lines
format-lines: ## formats all go files with golines
go install github.com/segmentio/golines@latest
golines -w -m 120 --ignore-generated --shorten-comments --ignored-dirs=${GO_LINES_IGNORED_DIRS} ${GO_FOLDERS}

.PHONY: lint
lint: ## runs all linters
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run ./...
golangci-lint run ./...


___BINDINGS___: ##

core_default := "DelegationManager IRewardsCoordinator ISlasher StrategyManager EigenPod EigenPodManager IStrategy IAVSDirectory"
core_location := "./lib/eigenlayer-middleware/lib/eigenlayer-contracts"
core_bindings_location := "../../../../bindings"

middleware_default := "RegistryCoordinator IndexRegistry OperatorStateRetriever StakeRegistry BLSApkRegistry IBLSSignatureChecker ServiceManagerBase IERC20"
middleware_location := "./lib/eigenlayer-middleware"
middleware_bindings_location := "../../bindings"

sdk_default := "MockAvsServiceManager ContractsRegistry"
sdk_location := "."
sdk_bindings_location := "./bindings"

# To generate bindings for specific contracts, run `make core-bindings contracts="DelegationManager IRewardsCoordinator"`
.PHONY: core-bindings ## generates core contracts bindings
core-bindings: ## generates core bindings
@echo "Starting core bindings generation"
ifneq ($(contracts),)
@echo "Contracts: $(contracts)"
cd contracts && ./generate-bindings.sh $(core_location) $(contracts) $(core_bindings_location)
else
@echo "Contracts: $(core_default)"
cd contracts && ./generate-bindings.sh $(core_location) $(core_default) $(core_bindings_location)
endif

# To generate bindings for specific contracts, run `make middleware-bindings contracts="RegistryCoordinator"`
.PHONY: middleware-bindings ## generates middleware contracts bindings
middleware-bindings: ## generates middleware bindings
@echo "Starting middleware bindings generation"
ifneq ($(contracts),)
@echo "Contracts: $(contracts)"
cd contracts && ./generate-bindings.sh $(middleware_location) $(contracts) $(middleware_bindings_location)
else
@echo "Contracts: $(middleware_default)"
cd contracts && ./generate-bindings.sh $(middleware_location) $(middleware_default) $(middleware_bindings_location)
endif

# To generate bindings for specific contracts, run `make sdk-bindings contracts="MockAvsServiceManager"`
.PHONY: sdk-bindings ## generates sdk contracts bindings
sdk-bindings: ## generates sdk bindings
@echo "Starting sdk bindings generation"
ifneq ($(contracts),)
@echo "Contracts: $(contracts)"
cd contracts && ./generate-bindings.sh $(sdk_location) $(contracts) $(sdk_bindings_location)
else
@echo "Contracts: $(middleware_default)"
cd contracts && ./generate-bindings.sh $(sdk_location) $(sdk_default) $(sdk_bindings_location)
endif

.PHONY: eigenpod-bindings
eigenpod-bindings: ## generates contract bindings for eigenpod
cd chainio/clients/eigenpod && ./generate.sh

.PHONY: bindings
bindings: ## generates all contract bindings
rm -rf bindings/* && make core-bindings middleware-bindings sdk-bindings eigenpod-bindings


___CONTRACTS___: ##

.PHONY: deploy-contracts-to-anvil-and-save-state
deploy-contracts-to-anvil-and-save-state: ##
./contracts/anvil/deploy-contracts-save-anvil-state.sh

.PHONY: start-anvil-with-contracts-deployed
start-anvil-with-contracts-deployed: ##
./contracts/anvil/start-anvil-chain-with-el-and-avs-deployed.sh
Loading

0 comments on commit 8566e71

Please sign in to comment.