Skip to content

Commit

Permalink
Merge branch 'master' into upgrade_to_eigen_sdk_0.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasArrachea committed Oct 18, 2024
2 parents fae8ffd + a25020d commit 8a36b73
Show file tree
Hide file tree
Showing 13 changed files with 280 additions and 604 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/contracts-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ jobs:
- name: Run tests
run: forge test -vvv
working-directory: ./contracts


- name: Enforce Formatting
run: forge fmt --check
working-directory: ./contracts
36 changes: 36 additions & 0 deletions .github/workflows/daily-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Daily Build And Test Dev

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
check:
strategy:
fail-fast: true
defaults:
run:
working-directory: ./contracts

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
46 changes: 46 additions & 0 deletions .github/workflows/storage-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check Storage Layout
on:
pull_request:
branches:
- master
jobs:
check_storage:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: "Generate and prepare the contract artifacts"
run: |
cd contracts && mkdir pr
for file in $(find src -name '*.sol'); do
contract_name=$(basename "$file" .sol)
forge inspect "$contract_name" storage --pretty > pr/"$contract_name".md
done
- name: Checkout Base Branch
env:
BASE: ${{ github.event.pull_request.base.sha }}
run: |
git fetch origin $BASE
git checkout $BASE
- name: "Generate and prepare the contract artifacts"
run: |
cd contracts && mkdir base
for file in $(find src -name '*.sol'); do
contract_name=$(basename "$file" .sol)
forge inspect "$contract_name" storage --pretty > base/"$contract_name".md
done
- name: Compare outputs
run: |
if ! diff --unified contracts/pr contracts/base; then
# Note: We are only creating a warning because storage changes might be intentional but should be looked into
# reach out to steven if you see a warning on this workflow and need help validating if it is expected or not
echo "::warning::Differences found between PR and base storage layouts"
fi
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ You will also need to [install docker](https://docs.docker.com/get-docker/), and
```
make build-contracts
```
You will also need to [install abigen](https://geth.ethereum.org/docs/tools/abigen) if you want to make changes to the smart contracts and then generate the go bindings
```
make bindings
```

## Running via make

Expand Down Expand Up @@ -114,4 +118,4 @@ When running on anvil, a typical log for the operator is
[2024-04-09 18:25:10.679 PDT] INFO (logging/zap_logger.go:49) Signed task response header accepted by aggregator. {"reply":false}
```

The error `task 2 not initialized or already completed` is expected behavior. This is because the aggregator needs to setup its data structures before it can accept responses. But on a local anvil setup, the operator had time to receive the websocket event for the new task, square the number, sign the response, and send it to the aggregator process before the aggregator has finalized its setup. Hence, the operator retries sending the response 2 seconds later and it is accepted.
The error `task 2 not initialized or already completed` is expected behavior. This is because the aggregator needs to setup its data structures before it can accept responses. But on a local anvil setup, the operator had time to receive the websocket event for the new task, square the number, sign the response, and send it to the aggregator process before the aggregator has finalized its setup. Hence, the operator retries sending the response 2 seconds later and it is accepted.
13 changes: 11 additions & 2 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = "src"
out = "out"
libs = ["lib"]
fs_permissions = [{ access = "read-write", path = "./"}]
fs_permissions = [{ access = "read-write", path = "./" }]

remappings = [
"@eigenlayer/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/",
Expand All @@ -12,7 +12,7 @@ remappings = [
"@openzeppelin/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts/",
"@openzeppelin-upgrades/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/",
"forge-std/=lib/forge-std/src/",
"ds-test/=lib/forge-std/lib/ds-test/src/"
"ds-test/=lib/forge-std/lib/ds-test/src/",
]

gas_reports = ["*"]
Expand All @@ -28,4 +28,13 @@ via_ir = false
# Override the Solidity version (this overrides `auto_detect_solc`)
solc_version = '0.8.12'

[fmt]
bracket_spacing = false
int_types = "long"
line_length = 100
multiline_func_header = "params_first"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
2 changes: 1 addition & 1 deletion contracts/lib/eigenlayer-middleware
Submodule eigenlayer-middleware updated 48 files
+29 −3 LICENSE
+2 −2 docs/README.md
+1 −1 docs/ServiceManagerBase.md
+1 −1 docs/experimental/AVS-Guide.md
+1 −0 foundry.toml
+1 −1 lib/eigenlayer-contracts
+8 −4 src/BLSApkRegistry.sol
+116 −62 src/BLSSignatureChecker.sol
+14 −21 src/EjectionManager.sol
+5 −1 src/IndexRegistry.sol
+33 −0 src/OperatorStateRetriever.sol
+52 −9 src/RegistryCoordinator.sol
+6 −1 src/RegistryCoordinatorStorage.sol
+85 −49 src/ServiceManagerBase.sol
+53 −0 src/ServiceManagerBaseStorage.sol
+22 −10 src/StakeRegistry.sol
+24 −3 src/interfaces/IECDSAStakeRegistryEventsAndErrors.sol
+3 −3 src/interfaces/IEjectionManager.sol
+12 −11 src/interfaces/IServiceManager.sol
+2 −3 src/interfaces/IServiceManagerUI.sol
+283 −0 src/unaudited/ECDSAServiceManagerBase.sol
+204 −75 src/unaudited/ECDSAStakeRegistry.sol
+10 −3 src/unaudited/ECDSAStakeRegistryStorage.sol
+14 −10 src/unaudited/examples/ECDSAStakeRegistryPermissioned.sol
+23 −20 test/events/IServiceManagerBaseEvents.sol
+6 −6 test/integration/CoreRegistration.t.sol
+83 −100 test/integration/IntegrationDeployer.t.sol
+4 −2 test/integration/User.t.sol
+0 −20 test/integration/mocks/BeaconChainOracleMock.t.sol
+16 −15 test/integration/utils/Sort.t.sol
+1 −3 test/mocks/DelegationMock.sol
+22 −0 test/mocks/ECDSAServiceManagerMock.sol
+14 −0 test/mocks/ECDSAStakeRegistryMock.sol
+0 −125 test/mocks/PaymentCoordinatorMock.sol
+80 −0 test/mocks/RewardsCoordinatorMock.sol
+9 −4 test/mocks/ServiceManagerMock.sol
+368 −146 test/unit/BLSApkRegistryUnit.t.sol
+186 −0 test/unit/ECDSAServiceManager.t.sol
+60 −14 test/unit/ECDSAStakeRegistryEqualWeightUnit.t.sol
+48 −16 test/unit/ECDSAStakeRegistryPermissionedUnit.t.sol
+472 −105 test/unit/ECDSAStakeRegistryUnit.t.sol
+23 −42 test/unit/EjectionManagerUnit.t.sol
+266 −110 test/unit/OperatorStateRetrieverUnit.t.sol
+56 −0 test/unit/RegistryCoordinatorUnit.t.sol
+283 −257 test/unit/ServiceManagerBase.t.sol
+1 −1 test/unit/ServiceManagerRouter.t.sol
+820 −411 test/unit/StakeRegistryUnit.t.sol
+123 −99 test/utils/MockAVSDeployer.sol
Loading

0 comments on commit 8a36b73

Please sign in to comment.