Skip to content

Commit

Permalink
add avs template
Browse files Browse the repository at this point in the history
  • Loading branch information
krisoshea-eth committed Jun 3, 2024
1 parent 640e3cc commit 2dc9bdf
Show file tree
Hide file tree
Showing 103 changed files with 17,002 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ko-publish-aggregator-and-operator

on:
push:
branches: ['master']
# we can also trigger manually in case needed
workflow_dispatch:

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
# Need this to be allowed to publish image to registry
# see https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
packages: write
contents: read
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.21.x'
- uses: actions/checkout@v2

- uses: ko-build/[email protected]
# We build both the aggregator and the operator in the same job
# we could separate them, but anyways they share core/ so it would get messy
# See https://ko.build/configuration/#naming-images to understand --preserve-import-paths
- run: KO_DOCKER_REPO=ghcr.io/layr-labs/incredible-squaring ko build aggregator/cmd/main.go --preserve-import-paths
- run: KO_DOCKER_REPO=ghcr.io/layr-labs/incredible-squaring ko build operator/cmd/main.go --preserve-import-paths
27 changes: 27 additions & 0 deletions temp-incredible-squaring-avs/.github/workflows/contracts-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: contracts-forge-tests

on:
push:
branches:
- master
pull_request:

jobs:
Test:
name: Contracts Forge Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install forge dependencies
run: forge install
working-directory: ./contracts

- name: Run tests
run: forge test -vvv
working-directory: ./contracts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Docker Compose Up Test

on:
push:
branches:
- master
pull_request:

jobs:
docker-compose-test:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Run Docker Compose
run: docker compose up -d

- name: Sleep
run: sleep 60

- name: Check services running
run: |
if docker compose ps -a --filter="status=exited" --services | grep -v anvil-advance-chain-script | xargs grep -q; then
echo "Some services are not running"
exit 1
fi
# TODO: we should also add https://docs.docker.com/reference/dockerfile/#healthcheck to the aggregator and operator docker images
# then we could check on their health status (maybe the processes are still running, but they are logging a lot of errors and we want to catch that)
# - name: Check services health
# run: |
# if docker-compose -f docker-compose.yml ps -q | xargs docker inspect -f '{{ .State.Health.Status }}' | grep -v healthy; then
# echo "Some services are not healthy"
# exit 1
# fi
52 changes: 52 additions & 0 deletions temp-incredible-squaring-avs/.github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: docker-publish
on:
push:
branches:
- master
workflow_dispatch:

env:
REGISTRY: ghcr.io

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# Run this job only on push to master branch
if: github.event_name != 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
driver-opts: >-
image=moby/buildkit:master
- name: Cache main image layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build And Push Image
- name: Build Docker image
run: docker compose -f docker-compose-build.yaml build
- name: Push Docker image
run: docker compose -f docker-compose-build.yaml push
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: integration-tests

on:
push:
branches:
- master
pull_request:

jobs:
Test:
name: Integration Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
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
with:
version: nightly
- name: Install forge dependencies
run: forge install
working-directory: ./contracts

- name: Test
run: make tests-integration
19 changes: 19 additions & 0 deletions temp-incredible-squaring-avs/.github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: unit-tests

on:
push:
branches:
- master
pull_request:

jobs:
Test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Test
run: make tests-unit
28 changes: 28 additions & 0 deletions temp-incredible-squaring-avs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
coverage.html

# log files
logs.txt

# just for example
id_rsa
6 changes: 6 additions & 0 deletions temp-incredible-squaring-avs/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/eigenlayer-middleware"]
path = contracts/lib/eigenlayer-middleware
url = https://github.com/Layr-Labs/eigenlayer-middleware
3 changes: 3 additions & 0 deletions temp-incredible-squaring-avs/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"solidity.compileUsingRemoteVersion": "v0.8.12+commit.f00d7308"
}
98 changes: 98 additions & 0 deletions temp-incredible-squaring-avs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
Business Source License 1.1

License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.

-----------------------------------------------------------------------------

Parameters

Licensor: Layr Labs, Inc.

Licensed Work: Incredible Squaring Avs
The Licensed Work is (c) 2023 Layr Labs, Inc.

Additional Use Grant: None.

Change Date: 2025-10-25 (October 25th, 2025)

Change License: MIT

-----------------------------------------------------------------------------

Terms

The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.

Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.

If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.

You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.

This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.

MariaDB hereby grants you permission to use this License’s text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.

-----------------------------------------------------------------------------

Covenants of Licensor

In consideration of the right to use this License’s text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:

1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where "compatible" means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.

2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text "None".

3. To specify a Change Date.

4. Not to modify this License in any other way.

-----------------------------------------------------------------------------

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.
Loading

0 comments on commit 2dc9bdf

Please sign in to comment.