Skip to content

refactor: integration tests #1223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
RPC_MAINNET="https://eth.llamarpc.com"
# RPC_MAINNET="https://mainnet.infura.io/v3/API-KEY"
RPC_GOERLI="https://ethereum-goerli.publicnode.com"
RPC_HOLESKY=""
FOUNDRY_PROFILE="mainnet" # "default", "medium", "mainnet", "sepolia", "hoodi", and "holesky" are supported.

# Needed in order to verify contracts.
ETHERSCAN_API_KEY="API-KEY"

# Make sure to update foundry.toml if additional RPCs are added.
RPC_MAINNET="https://eth.llamarpc.com"
RPC_SEPOLIA="https://ethereum-sepolia.publicnode.com"
RPC_HOODI="https://0xrpc.io/hoodi"
RPC_HOLESKY="https://holesky-rpc.publicnode.com"

# Setting `FORK_BLOCK_<CHAIN>` allows integration tests to automatically use the correct block number (use zero for latest block).
FORK_BLOCK_MAINNET="22296566"
FORK_BLOCK_SEPOLIA="8134026"
FORK_BLOCK_HOODI="201941"
FORK_BLOCK_HOLESKY="0"

# Whether to upgrade the contracts before integration testing.
UPGRADE_BEFORE_TEST_MAINNET="false"
UPGRADE_BEFORE_TEST_HOODI="false"
UPGRADE_BEFORE_TEST_SEPOLIA="false"
UPGRADE_BEFORE_TEST_HOLESKY="false"

# Whether to run eigen pod tests on the given chain.
TEST_EIGEN_PODS_MAINNET="true"
TEST_EIGEN_PODS_HOODI="false"
TEST_EIGEN_PODS_SEPOLIA="false"
TEST_EIGEN_PODS_HOLESKY="false"

# Whether to run upgrade tests on the given chain.
TEST_UPGRADES_MAINNET="true"
TEST_UPGRADES_HOODI="true"
TEST_UPGRADES_SEPOLIA="true"
TEST_UPGRADES_HOLESKY="true"

# If non-zero, we assume integration tests need to execute a timelocked upgrade.
TIMELOCK_PAYLOAD=""
15 changes: 11 additions & 4 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches:
- "dev"


env:
FOUNDRY_PROFILE: medium
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
Expand Down Expand Up @@ -62,6 +61,14 @@ jobs:
forge --version
forge build --sizes

# Generate a fuzz seed that changes weekly to avoid burning through RPC allowance.
- name: "Generate A Fuzz Seed Weekly"
if: ${{ matrix.suite == 'Fork' }}
run: >
echo "FOUNDRY_FUZZ_SEED=$(
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800))
)" >> $GITHUB_ENV

# Run the test suite in parallel based on the matrix configuration.
- name: Run ${{ matrix.suite }} tests
run: |
Expand All @@ -71,7 +78,7 @@ jobs:
Fork) forge test --match-contract Integration ;;
esac
env:
FOUNDRY_PROFILE: ${{ matrix.suite == 'Fork' && 'forktest' || 'medium' }}
FOUNDRY_PROFILE: ${{ matrix.suite == 'Fork' && 'mainnet' || 'medium' }}

# -----------------------------------------------------------------------
# Forge Test (Intense)
Expand All @@ -91,7 +98,7 @@ jobs:
submodules: recursive

# Restore Forge cache
- name: Cache Forge Build
- name: "Cache Forge Build"
uses: actions/cache@v3
with:
path: |
Expand All @@ -115,7 +122,7 @@ jobs:
id: build

# Run Forge Test (Intense)
- name: Forge Test (Intense)
- name: "Forge Test (Intense)"
run: |
echo -e "\033[1;33mWarning: This workflow may take several hours to complete.\033[0m"
echo -e "\033[1;33mThis intense fuzzing workflow is optional but helps catch edge cases through extended testing.\033[0m"
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ script/output/eigenpods.json
cache_hardhat
artifacts
*.lock

#Foundry files
out
cache
snapshots

*.DS_Store

Expand Down Expand Up @@ -53,4 +54,6 @@ deployed_strategies.json
populate_src*

# cerota
.certora_internal/*
.certora_internal/*

cache/solidity-files-cache.json
2 changes: 1 addition & 1 deletion .zeus
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"zeusHost": "https://github.com/Layr-Labs/eigenlayer-contracts-zeus-metadata",
"zeusHost": "https://github.com/layr-labs/eigenlayer-contracts-zeus-metadata",
"migrationDirectory": "script/releases"
}
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ fix-typos:
typos --config .github/configs/typos-cli.toml --write-changes

fmt:
forge fmt; FOUNDRY_PROFILE=test forge fmt
forge fmt; FOUNDRY_PROFILE=test forge fmt

integration:
export FOUNDRY_PROFILE=default; forge t --mc Integration
export FOUNDRY_PROFILE=mainnet; forge t --mc Integration
export FOUNDRY_PROFILE=sepolia; forge t --mc Integration
export FOUNDRY_PROFILE=hoodi; forge t --mc Integration
export FOUNDRY_PROFILE=holesky; forge t --mc Integration
13 changes: 13 additions & 0 deletions cache/fuzz/failures
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc cb16665b6c114cb28b723311e0c985f6211532509e71ac489a36f338c9358048 # shrinks to 0x7099c6310000000000000000000000000000000000000000000000000000000000000000
cc 2913c3b8b55a4ed0bcfa8469aa3faf11e07e5a010822aeb9a0da4cf5f4879471 # shrinks to 0x8ba58f1a0000000000000000000000000000000000000000000000000000000000003c09
cc 5c7503dcef161f8a61c52226f0eeb2c929a4c470a2cf3f205831f7bd2dd3c523 # shrinks to 0xa732bb5c0000000000000000000000000000000000000000000000000000000000000c04
cc f51a58bcaa5989372549d7466621b643f15acb750989fede6b36911518cc1098 # shrinks to 0x4d90ad1d000000000000000000000000000000000000000000000000000000000000004a
cc 5b4bced7d1dc835b7017680c1c9443fffda3e3a1f1e435539c5da46f5d8b0188 # shrinks to 0xeccb17a50000000000000000000000000000000000000000000000000000000000000002
cc 0fb74b55c7122b5d3cec6b6e5496ed0096f57a53e22fff950c8ed02d59229587 # shrinks to 0x3c79ca0400000000000000000000000000000000000000000000000000000000000006f6
cc 4d277d39cb477084e6f3e893f1e2de6f395dcea0b449565275e0fe9a1f38e23d # shrinks to 0xe0a4dc5000000000000000000000000000000000000000000000000000000000005d6104
Empty file added cache/test-failures
Empty file.
3 changes: 2 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@

[rpc_endpoints]
mainnet = "${RPC_MAINNET}"
holesky = "${RPC_HOLESKY}"
hoodi = "${RPC_HOODI}"
sepolia = "${RPC_SEPOLIA}"
56 changes: 0 additions & 56 deletions script/configs/devnet/deploy_from_scratch.anvil.config.json

This file was deleted.

56 changes: 0 additions & 56 deletions script/configs/devnet/deploy_from_scratch.holesky.config.json

This file was deleted.

This file was deleted.

Loading
Loading