-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into fix_bls_aggregation_multiple_quorums
- Loading branch information
Showing
75 changed files
with
17,970 additions
and
8,211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Bindings | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
pull_request: | ||
merge_group: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
generate_bindings: | ||
name: Generate bindings | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- 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: Show abigen version | ||
run: abigen --version | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: v0.3.0 | ||
|
||
- name: Run make bindings | ||
run: make bindings | ||
|
||
check_bindings: | ||
name: Check bindings are up-to-date | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
# This step is needed to know if the contracts were changed. | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
contracts: | ||
- 'contracts/lib/**' | ||
- 'contracts/src/**' | ||
bindings: | ||
- 'contracts/bindings/**' | ||
# This step runs only if some contract changed. | ||
# It checks whether the bindings directory have changed. | ||
# If there are no changes, then the bindings are outdated | ||
# and therefore this step will fail. | ||
- name: Check the bindings are up-to-date | ||
if: steps.filter.outputs.contracts == 'true' | ||
run: | | ||
BINDINGS_UPDATED=${{ steps.filter.outputs.bindings }} | ||
if [[ "$BINDINGS_UPDATED" == "false" ]]; then | ||
echo "The bindings are outdated"; | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Pull Request Workflow" | ||
on: | ||
merge_group: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
|
||
env: | ||
PR_URL: https://github.com/Layr-Labs/eigensdk-go/pull/${{ github.event.number }} | ||
|
||
jobs: | ||
# Enforces the update of a changelog file on every pull request | ||
# The update in the changelog can be skipped if the pull request | ||
# includes the `changelog-ignore` label. | ||
changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check CHANGELOG.md is updated | ||
uses: dangoslen/changelog-enforcer@v3 | ||
with: | ||
skipLabels: changelog-ignore | ||
|
||
- name: Check the PR URL is included in CHANGELOG.md | ||
if: contains(github.event.pull_request.labels.*.name, 'changelog-ignore') == false | ||
run: git diff CHANGELOG.md | grep $PR_URL CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Check anvil state | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
generate-anvil-state: | ||
name: generate anvil state | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: stable | ||
|
||
- name: Generate anvil state | ||
run: make deploy-contracts-to-anvil-and-save-state | ||
|
||
check-anvil-state: | ||
name: Check anvil dump is up-to-date | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# This step is needed to know if the contracts were changed. | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
contracts: | ||
- 'contracts/lib/**' | ||
- 'contracts/script/**' | ||
- 'contracts/src/**' | ||
anvil_state: | ||
- 'contracts/anvil/contracts-deployed-anvil-state.json' | ||
# This step runs only if some contract changed. | ||
# It checks whether the anvil state has changed. | ||
# If there are no changes, then the anvil state is outdated | ||
# and therefore this step will fail. | ||
- name: Check the anvil state is up-to-date | ||
if: steps.filter.outputs.contracts == 'true' | ||
run: | | ||
ANVIL_STATE_UPDATED=${{ steps.filter.outputs.anvil_state }} | ||
if [[ "$ANVIL_STATE_UPDATED" == "false" ]]; then | ||
echo "The anvil state is outdated"; | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Contracts CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [ '**' ] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./contracts | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: stable | ||
|
||
- name: Show Forge version | ||
run: forge --version | ||
|
||
- name: Run Forge fmt | ||
run: forge fmt --check | ||
|
||
- name: Run Forge build | ||
run: forge build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
Each version will have a separate `Breaking Changes` section as well. To describe in how to upgrade from one version to another if needed | ||
|
||
## [Unreleased] | ||
### Added | ||
### Changed | ||
* fix: change requested pr url in changelog's workflow by @maximopalopoli in <https://github.com/Layr-Labs/eigensdk-go/pull/575> | ||
|
||
### Breaking changes | ||
|
||
* refactor: encapsulate parameters into `TaskSignature` in [#487](https://github.com/Layr-Labs/eigensdk-go/pull/487) | ||
|
||
* Introduced `TaskSignature` struct to encapsulate parameters related to task signatures: | ||
* Updated `ProcessNewSignature` to accept a `TaskSignature` struct instead of multiple parameters. | ||
|
||
```go | ||
// BEFORE | ||
blsAggServ.ProcessNewSignature( | ||
context.Background(), | ||
taskIndex, | ||
taskResponse, | ||
blsSigOp1, | ||
testOperator1.OperatorId, | ||
) | ||
|
||
// AFTER | ||
taskSignature := NewTaskSignature(taskIndex, taskResponse, blsSig, testOperator1.OperatorId) | ||
|
||
blsAggServ.ProcessNewSignature( | ||
context.Background(), | ||
taskSignature, | ||
) | ||
``` | ||
|
||
* refactor: update interface on `bls aggregation` in [#485](https://github.com/Layr-Labs/eigensdk-go/pull/485). | ||
* Introduces a new struct `TaskMetadata` with a constructor `NewTaskMetadata` to initialize a new task and a method `WithWindowDuration` to set the window duration. | ||
* Refactors `InitializeNewTask` and `singleTaskAggregatorGoroutineFunc` to accept a `TaskMetadata` struct instead of multiple parameters. | ||
|
||
```go | ||
// BEFORE | ||
blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) | ||
blsAggServ.InitializeNewTask( | ||
taskIndex, | ||
blockNum, | ||
quorumNumbers, | ||
quorumThresholdPercentages, | ||
tasksTimeToExpiry, | ||
) | ||
// AFTER | ||
blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) | ||
metadata := NewTaskMetadata(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) | ||
blsAggServ.InitializeNewTask(metadata) | ||
``` | ||
|
||
* Removes `InitializeNewTaskWithWindow` since `windowDuration` can now be set in `TaskMetadata`. | ||
|
||
```go | ||
// BEFORE | ||
blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) | ||
err = blsAggServ.InitializeNewTaskWithWindow( | ||
taskIndex, | ||
blockNum, | ||
quorumNumbers, | ||
quorumThresholdPercentages, | ||
timeToExpiry, | ||
windowDuration, | ||
) | ||
// AFTER | ||
blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) | ||
metadata := NewTaskMetadata( | ||
taskIndex, | ||
blockNum, | ||
quorumNumbers, | ||
quorumThresholdPercentages, | ||
tasksTimeToExpiry, | ||
).WithWindowDuration(windowDuration) | ||
blsAggServ.InitializeNewTask(metadata) | ||
``` | ||
|
||
### Removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.