Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
470b0b9
feat: add nest vote and tests
katamarinaki Jul 18, 2026
fd13e34
fix(Tests): move validators to corresponding utils paths
phonktown Jul 22, 2026
a9f719c
feat(Tests): tag acceptance checks with vote item numbers and order t…
phonktown Jul 22, 2026
c27febd
fix(Tests): remove unused import
phonktown Jul 23, 2026
bd8974a
feat(Nest): add happy path regression test
phonktown Jul 24, 2026
f1f3c2e
feat: replace staking module share limits factory
skhomuti Jul 24, 2026
a8ef3d6
feat(Nest): adjust happy-path test
phonktown Jul 27, 2026
e97a2d8
feat(Vote): add lol stables factories + tests
phonktown Jul 28, 2026
ace2b55
fix(Tests): move scenario tests to the main vote test file
phonktown Jul 29, 2026
d5c15d9
feat(Vote): adjust descriptions
phonktown Jul 29, 2026
e1524bb
fix(Tests): fix CI tests
phonktown Jul 30, 2026
4d9d360
feat(Tests): update comment
phonktown Jul 30, 2026
5c14985
Merge pull request #659 from lidofinance/feat/nest-vote
iamnp Aug 3, 2026
23d4488
fix(ci): remove unsupported vote_prev_block input
skhomuti Aug 3, 2026
9dc1479
Merge pull request #669 from lidofinance/fix/remove-unsupported-vote-…
iamnp Aug 3, 2026
7f0ac81
fix(Stonks): split stonks test into 2 parts
phonktown Aug 3, 2026
b0a0266
fix(CI): fix core tests CI
phonktown Aug 3, 2026
8d54da8
fix(Interface): update interface
phonktown Aug 3, 2026
60683b5
feat(Tests): adjust vote tests
phonktown Aug 3, 2026
ced54b8
feat(Vote): upload IPFS + adjust descriptions
phonktown Aug 3, 2026
c79452e
fix(Makefile): fix stonks tests grep
phonktown Aug 3, 2026
1640c61
feat(Tests): pick an unclaimed source operator for consolidation pair
phonktown Aug 3, 2026
c2ed5e8
Merge pull request #670 from lidofinance/fix/stonks-test
iamnp Aug 4, 2026
ca290c7
feat(Tests): adjust tests
phonktown Aug 4, 2026
e8e1b17
Merge pull request #671 from lidofinance/feat/vote-204-tests
phonktown Aug 4, 2026
eaa450a
feat(Vote): update IPFS
phonktown Aug 4, 2026
2d9f94e
Merge pull request #672 from lidofinance/feat/vote-204-ipfs
iamnp Aug 4, 2026
ad68fbe
feat(Vote): update IPFS
phonktown Aug 4, 2026
5a8454e
Merge pull request #673 from lidofinance/feat/vote-204-ipfs
iamnp Aug 4, 2026
d00e51a
feat(Vote): update IPFS
phonktown Aug 4, 2026
36a1a6a
Merge pull request #674 from lidofinance/feat/vote-204-ipfs
iamnp Aug 4, 2026
5b02e00
feat(Vote): move script to archive
phonktown Aug 12, 2026
1b0a416
feat(Tests): skip nest test
phonktown Aug 12, 2026
45d5cf8
feat(Makefile): balance tests
phonktown Aug 12, 2026
468d003
Merge pull request #676 from lidofinance/feat/vote-204-archive
iamnp Aug 12, 2026
3ef19ca
feat(Tests): archive tests after vote 204
phonktown Aug 19, 2026
282e3e7
Merge pull request #677 from lidofinance/feat/vote-204-archive-test
iamnp Aug 19, 2026
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
7 changes: 7 additions & 0 deletions .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }}

# The step above enacted the vote, which moved the fork clock past the vaults report.
- name: Refresh the vaults report
run: docker exec -e ETH_RPC_URL -e ETHERSCAN_TOKEN tests-runner bash -c 'make ci-refresh-vaults-report'
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}
ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }}

- name: Run core tests
run: docker exec -e CORE_TESTS_TARGET_RPC_URL -e NODE_OPTIONS -e DG_PROPOSAL_IDS tests-runner bash -c 'make test-core'
env:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/sm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ jobs:
run: poetry run brownie networks import network-config.yaml True
working-directory: scripts

- name: Capture pre-vote block for staking modules regression
id: modules-regression-vote-block
shell: bash
run: |
vote_prev_block=$(make --no-print-directory __get_rpc_latest_block_number CORE_TESTS_TARGET_RPC_URL=${{ env.HARDHAT_NODE_URL }})
echo "vote_prev_block=$vote_prev_block" >> "$GITHUB_OUTPUT"
working-directory: scripts

- name: Prepare test environment with Brownie
run: PYTHONPATH=$PWD poetry run brownie run scripts/ci/prepare_environment --network mfh-1
working-directory: scripts
Expand All @@ -111,4 +103,3 @@ jobs:
ref: develop
path: staking-modules
rpc_url: ${{ env.HARDHAT_NODE_URL }}
vote_prev_block: ${{ steps.modules-regression-vote-block.outputs.vote_prev_block }}
105 changes: 105 additions & 0 deletions .github/workflows/stonks_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Stonks integration tests

on:
push:
branches:
- feat/next-vote
workflow_dispatch:

env:
# Stonks branch the NEST V2 integration tests are run from.
STONKS_REF: main

jobs:
run-tests:
name: Stonks integration tests in docker
runs-on: [ubuntu-latest]
timeout-minutes: 120
env:
NODE_OPTIONS: --max_old_space_size=7200

# Fork node on localhost:8545, same scripts image core_tests uses (has brownie + node/npm).
services:
tests-runner:
image: ghcr.io/lidofinance/scripts:v21
ports:
- 8545:8545
volumes:
- ${{ github.workspace }}:/root/scripts
options: >-
--name=tests-runner

steps:
- name: Checkout scripts
uses: actions/checkout@v4

- name: Checkout stonks (${{ env.STONKS_REF }})
uses: actions/checkout@v4
with:
repository: lidofinance/stonks
ref: ${{ env.STONKS_REF }}
path: stonks
persist-credentials: false

- name: Run init script
run: docker exec tests-runner bash -c 'PYTHONPATH=$PWD make init-scripts'

- name: Run node
run: docker exec -e ETH_RPC_URL -e NODE_OPTIONS --detach tests-runner bash -c 'NODE_PORT=8545 make node'
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}

- name: Check that the fork is ready
shell: bash
run: |
echo "Waiting for fork node on 127.0.0.1:8545..."
sleep 10
for i in {1..30}; do
if (echo > /dev/tcp/127.0.0.1/8545) >/dev/null 2>&1; then
echo "Fork is ready ✅"
exit 0
fi
echo "Not ready yet... ($i/30)"
sleep 1
done
echo "❌ Fork was not ready after 30 seconds" >&2
exit 1

# Suites that price tokens through the real Chainlink FeedRegistry. They run before the vote
# because enacting it warps the fork clock past the feeds' updatedAt — see the comment above
# STONKS_POSTVOTE_SUITES in the Makefile.
- name: Run stonks suites that need a clean fork
run: docker exec -e ETH_RPC_URL -e NODE_OPTIONS tests-runner bash -c 'make test-stonks-integration-prevote STONKS_DIR=stonks'
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}

# The pass above deploys contracts, impersonates the Aragon Agent and moves LDO around, so the
# vote is enacted on a fresh fork rather than on top of that state.
- name: Restart the fork node
run: |
docker exec tests-runner bash -c 'pkill -f "hardhat node"' || true
docker exec -e ETH_RPC_URL -e NODE_OPTIONS --detach tests-runner bash -c 'NODE_PORT=8545 make node'
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}

- name: Check that the restarted fork is ready
shell: bash
run: |
echo "Waiting for fork node on 127.0.0.1:8545..."
sleep 10
for i in {1..30}; do
if (echo > /dev/tcp/127.0.0.1/8545) >/dev/null 2>&1; then
echo "Fork is ready ✅"
exit 0
fi
echo "Not ready yet... ($i/30)"
sleep 1
done
echo "❌ Fork was not ready after 30 seconds" >&2
exit 1

- name: Enact vote and run stonks suites that need the NEST notifier
run: docker exec -e ETH_RPC_URL -e ETHERSCAN_TOKEN -e NODE_OPTIONS tests-runner bash -c 'make test-stonks-integration-postvote STONKS_DIR=stonks'
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}
ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }}
29 changes: 27 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ CORE_BRANCH ?= master
NODE_PORT ?= 8545
SECONDARY_NETWORK ?= mfh-2
NETWORK_STATE_FILE ?= deployed-mainnet.json
STONKS_DIR ?= ../stonks

test-1/2:
poetry run brownie test tests/[tc]*.py tests/regression/test_staking_router_stake_distribution.py --durations=20 --network mfh-1
poetry run brownie test tests/[tc]*.py tests/regression/test_staking_router_stake_distribution.py tests/regression/test_permissions.py --durations=20 --network mfh-1

test-2/2:
$(call run_2nd_test,brownie test -k 'not test_staking_router_stake_distribution.py' --durations=20 --network $(SECONDARY_NETWORK))
$(call run_2nd_test,brownie test -k 'not test_staking_router_stake_distribution.py and not test_permissions.py' --durations=20 --network $(SECONDARY_NETWORK))

init: init-scripts init-core

Expand Down Expand Up @@ -94,6 +95,25 @@ test-core:
FORKING_BLOCK_NUMBER=$$LATEST_BLOCK_NUMBER \
yarn test:integration

# Two passes, because enacting the vote warps the fork clock ~9 days ahead of the Chainlink updatedAt:
# suites pricing through the real FeedRegistry hit OracleStale after that, so they run on a clean fork.
# The suites below need the opposite — the post-vote NEST TokenRateNotifier — and price through a stub
# registry stamped with the current block timestamp, so the warp does not affect them.
STONKS_POSTVOTE_SUITES ?= staking-revenue-source buyback-happy-path

test-stonks-integration-prevote:
cd $(STONKS_DIR) && \
{ [ -d node_modules ] || npm ci; } && \
POSTVOTE_PATTERN="^test/integration/($$(echo $(STONKS_POSTVOTE_SUITES) | tr ' ' '|'))\.ts$$" && \
PREVOTE_SUITES=$$(ls test/integration/*.ts | grep -vE "$$POSTVOTE_PATTERN" || true) && \
{ [ -n "$$PREVOTE_SUITES" ] || { echo "No pre-vote suites left after excluding: $(STONKS_POSTVOTE_SUITES)" >&2; exit 1; }; } && \
RPC_URL=$(ETH_RPC_URL) npx hardhat test $$PREVOTE_SUITES --network localhost

test-stonks-integration-postvote: ci-prepare-environment
cd $(STONKS_DIR) && \
{ [ -d node_modules ] || npm ci; } && \
RPC_URL=$(ETH_RPC_URL) npx hardhat test $(patsubst %,test/integration/%.ts,$(STONKS_POSTVOTE_SUITES)) --network localhost

slots:
@echo "Input https://github.com/lidofinance/protocol-onchain-mon-bots/blob/main/bots/ethereum-steth-v2/src/utils/constants.mainnet.ts file content (end with Enter and Ctrl+D):"
@cat | grep -v "import { ERC20 } from './constants'" | sed 's/ERC20/any/g' > slots2.ts
Expand All @@ -117,5 +137,10 @@ slots:
ci-prepare-environment:
poetry run brownie run scripts/ci/prepare_environment --network mfh-1

# Core tests operate on vaults, and VaultHub rejects a vaults report older than 2 days, while
# enacting the vote leaves the fork clock ~9 days past the last one.
ci-refresh-vaults-report:
poetry run brownie run scripts/ci/refresh_vaults_report --network mfh-1

enact-fork:
poetry run brownie run $(vote) start_and_execute_vote_on_fork_manual --network=mfh-1
Loading
Loading