Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
3 changes: 0 additions & 3 deletions .github/workflows/tests-integration-hoodi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ jobs:
run: yarn test:integration
env:
RPC_URL: "${{ secrets.HOODI_RPC_URL }}"
LOG_LEVEL: debug
NETWORK_STATE_FILE: deployed-hoodi.json
# TODO: enable csm integration tests later (CSM is deployed on hoodis)
INTEGRATION_WITH_CSM: "off"
24 changes: 1 addition & 23 deletions .github/workflows/tests-integration-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,14 @@ jobs:
SKIP_CONTRACT_SIZE: true
SKIP_INTERFACES_CHECK: true

services:
hardhat-node:
image: ghcr.io/lidofinance/hardhat-node:2.26.0
ports:
- 8555:8545
env:
ETH_RPC_URL: "${{ secrets.ETH_RPC_URL }}"
DONT_SET_CHAIN_ID: true
HARDFORK: "prague"

steps:
- uses: actions/checkout@v4

- name: Common setup
uses: ./.github/workflows/setup

- name: Mock Aragon voting
run: yarn upgrade:mock-voting
env:
RPC_URL: http://localhost:8555
NETWORK_STATE_FILE: deployed-mainnet.json

- name: Workaround for not updated state error when forking a fork
run: yarn hardhat --network local run --no-compile scripts/utils/mine.ts
env:
RPC_URL: http://localhost:8555

- name: Run integration tests
run: yarn test:integration
env:
RPC_URL: http://localhost:8555
LOG_LEVEL: debug
RPC_URL: "${{ secrets.ETH_RPC_URL }}"
NETWORK_STATE_FILE: deployed-mainnet.json
29 changes: 0 additions & 29 deletions .github/workflows/tests-integration-upgrade-template.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/verify-state-hoodi.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/verify-state.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Verify State

on:
workflow_dispatch:
push:
branches:
- "main"
- "develop"
schedule:
- cron: "0 0 * * *" # runs every day at midnight UTC

jobs:
run_state_mate_hoodi:
name: Hoodi State
runs-on: ubuntu-latest
timeout-minutes: 120
env:
STATE_MATE_BRANCH: "main"
HOODI_REMOTE_RPC_URL: "https://hoodi.drpc.org"

steps:
- name: Checkout state-mate
uses: actions/checkout@v4
with:
repository: lidofinance/state-mate
ref: ${{ env.STATE_MATE_BRANCH }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install

- name: Run state-mate (V3 Hoodi Testnet)
run: yarn start configs/lidov3/hoodi/lidov3-testnet.yaml

- name: Run state-mate (V3 Hoodi Easy Track)
run: yarn start configs/lidov3/hoodi/lidov3-et-testnet.yml

run_state_mate_mainnet:
name: Mainnet State
runs-on: ubuntu-latest
timeout-minutes: 120
env:
STATE_MATE_BRANCH: "main"
MAINNET_REMOTE_RPC_URL: "https://eth.drpc.org"

steps:
- name: Checkout state-mate
uses: actions/checkout@v4
with:
repository: lidofinance/state-mate
ref: ${{ env.STATE_MATE_BRANCH }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install

- name: Run state-mate (V3 Mainnet)
run: yarn start configs/lidov3/mainnet/lidov3-core-post-vote.yaml

- name: Run state-mate (V3 Mainnet Easy Track)
run: yarn start configs/lidov3/mainnet/lidov3-et-post-vote.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is the core repository of the Lido on Ethereum protocol. The entire codebas
---

<div>
<img alt="Lido" src="https://img.shields.io/badge/v2.1-version?label=lido&labelColor=rgb(91%2C%20162%2C%20252)&color=white"/>
<img alt="Lido" src="https://img.shields.io/badge/v3.0.0-version?label=lido&labelColor=rgb(91%2C%20162%2C%20252)&color=white"/>
<img alt="GitHub license" src="https://img.shields.io/github/license/lidofinance/lido-dao?labelColor=orange&color=white"/>
<img alt="Solidity" src="https://img.shields.io/badge/multiver-s?style=flat&label=solidity&labelColor=rgb(86%2C%2085%2C%20212)&color=white"/>
<img alt="Aragon OS" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Flidofinance%2Fcore%2Fmaster%2Fpackage.json&query=%24.dependencies%5B'%40aragon%2Fos'%5D&style=flat&label=aragon%2Fos&labelColor=rgb(70%2C%20100%2C%20246)&color=white"/>
Expand Down
5 changes: 5 additions & 0 deletions deployed-mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,11 @@
"maxPositiveTokenRebase": 750000
}
},
"pinnedBeaconProxy": {
"contract": "contracts/0.8.25/vaults/PinnedBeaconProxy.sol",
"address": "0x62e0D92cf7B8752b5292B9BCbbacE4cFa1633428",
"constructorArgs": ["0x5FbE8cEf9CCc56ad245736D3C5bAf82ad54Ca789", "0x"]
},
"predepositGuarantee": {
"proxy": {
"contract": "contracts/0.8.9/proxy/OssifiableProxy.sol",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"eslint-plugin-simple-import-sort": "12.1.1",
"ethereumjs-util": "7.1.5",
"ethers": "6.14.4",
"glob": "11.0.3",
"glob": "11.1.0",
"globals": "15.15.0",
"hardhat": "2.26.1",
"hardhat-contract-sizer": "2.10.0",
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions scripts/upgrade/steps/0500-mock-v3-aragon-voting.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { mockDGAragonVoting } from "scripts/utils/upgrade";

import { getAddress, readNetworkState, Sk } from "lib/state-file";
import { readNetworkState } from "lib/state-file";

export async function main(): Promise<ReturnType<typeof mockDGAragonVoting>> {
const state = readNetworkState();
const votingDescription = "V3 Lido Upgrade description placeholder";
const proposalMetadata = "V3 Lido Upgrade proposal metadata placeholder";
return mockDGAragonVoting(getAddress(Sk.v3VoteScript, state), votingDescription, proposalMetadata, state);
return mockDGAragonVoting(state);
}
35 changes: 5 additions & 30 deletions scripts/utils/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import fs from "fs";

import * as toml from "@iarna/toml";

import { IDualGovernance, IEmergencyProtectedTimelock, OmnibusBase, TokenManager, Voting } from "typechain-types";
import { IDualGovernance, IEmergencyProtectedTimelock } from "typechain-types";

import { advanceChainTime, ether, log } from "lib";
import { impersonate } from "lib/account";
import { UpgradeParameters, validateUpgradeParameters } from "lib/config-schemas";
import { loadContract } from "lib/contract";
import { findEventsWithInterfaces } from "lib/event";
import { DeploymentState, getAddress, Sk } from "lib/state-file";

import { ONE_HOUR } from "test/suite";
Expand Down Expand Up @@ -39,52 +38,28 @@ export function readUpgradeParameters(): UpgradeParameters {
}
}

export async function mockDGAragonVoting(
omnibusScriptAddress: string,
description: string,
proposalMetadata: string,
state: DeploymentState,
): Promise<{
voteId: bigint;
export async function mockDGAragonVoting(state: DeploymentState): Promise<{
proposalId: bigint;
executeReceipt: TransactionReceipt;
scheduleReceipt: TransactionReceipt;
proposalExecutedReceipt: TransactionReceipt;
}> {
log("Starting mock Aragon voting...");
const agentAddress = getAddress(Sk.appAgent, state);
const votingAddress = getAddress(Sk.appVoting, state);
const tokenManagerAddress = getAddress(Sk.appTokenManager, state);

const deployer = await impersonate(agentAddress, ether("100"));
const tokenManager = await loadContract<TokenManager>("TokenManager", tokenManagerAddress);
const voting = await loadContract<Voting>("Voting", votingAddress);
const timelock = await loadContract<IEmergencyProtectedTimelock>(
"IEmergencyProtectedTimelock",
state[Sk.dgEmergencyProtectedTimelock].proxy.address,
);
const afterSubmitDelay = await timelock.getAfterSubmitDelay();
const afterScheduleDelay = await timelock.getAfterScheduleDelay();

const voteId = await voting.votesLength();

const voteScript = await loadContract<OmnibusBase>("OmnibusBase", omnibusScriptAddress);
const voteBytecode = await voteScript.getNewVoteCallBytecode(description, proposalMetadata);

await tokenManager.connect(deployer).forward(voteBytecode);
if (!(await voteScript.isValidVoteScript(voteId, proposalMetadata))) throw new Error("Vote script is not valid");
await voting.connect(deployer).vote(voteId, true, false);
await advanceChainTime(await voting.voteTime());
const executeTx = await voting.executeVote(voteId);
const executeReceipt = (await executeTx.wait())!;
log.success("Voting executed: gas used", executeReceipt.gasUsed);

const dualGovernance = await loadContract<IDualGovernance>(
"IDualGovernance",
state[Sk.dgDualGovernance].proxy.address,
);
const events = findEventsWithInterfaces(executeReceipt, "ProposalSubmitted", [dualGovernance.interface]);
const proposalId = events[0].args.id;

const proposalId = 6n; // https://dg.lido.fi/proposals/6
log.success("Proposal submitted: proposalId", proposalId);

await advanceChainTime(afterSubmitDelay);
Expand Down Expand Up @@ -115,5 +90,5 @@ export async function mockDGAragonVoting(
process.exit(1);
}

return { voteId, proposalId, executeReceipt, scheduleReceipt, proposalExecutedReceipt };
return { proposalId, scheduleReceipt, proposalExecutedReceipt };
}
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ describe("Integration: AccountingOracle extra data full items", () => {
if (norExitedItems + sdvtExitedItems + csmExitedItems === 0) {
continue;
}
it(

// TODO: https://github.com/lidofinance/core/issues/1624
const itFn = csmExitedItems > 0 ? it.skip : it;

itFn(
`should process extra data with full items for all modules with norExitedItems=${norExitedItems}, sdvtExitedItems=${sdvtExitedItems}, csmExitedItems=${csmExitedItems}`,
testReportingModuleWithMaxExtraDataItems({
norExitedItems,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ describe("Integration: Withdrawals finalization with bad debt internalization",
expect(stateAfter.badDebtToInternalize).to.equal(0n, "There should be no bad debt to internalize after report");
});

it("Bad debt internalization should affect finalization share rate", async () => {
// TODO: https://github.com/lidofinance/core/issues/1621
it.skip("Bad debt internalization should affect finalization share rate", async () => {
const beforeReportSnapshot = await Snapshot.take();

// 1. Finalize withdrawals without bad debt internalization
Expand Down
Loading
Loading