From 61f1d6e5b002987d25957ce520f555a0001ec938 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Wed, 22 Nov 2023 17:24:02 +0300 Subject: [PATCH 01/20] refactor(github flows): bump actions/checkout v3 -> v4 --- .github/workflows/analyse.yml | 4 ++-- .github/workflows/assert-bytecode.yml | 2 +- .github/workflows/fix-abi-pr.yml | 2 +- .github/workflows/linters.yml | 4 ++-- .github/workflows/release-abis.yml | 2 +- .github/workflows/storage-layout-check.yml | 2 +- .github/workflows/storage-layout-update.yml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 153983807..edb000ff7 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -14,7 +14,7 @@ jobs: security-events: write steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false @@ -57,7 +57,7 @@ jobs: run: > curl -sSL https://install.python-poetry.org | python - && poetry install --no-root - + - name: Remove foundry.toml run: rm -f foundry.toml diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index 5fbfed4ea..db01ee6e0 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/.github/workflows/fix-abi-pr.yml b/.github/workflows/fix-abi-pr.yml index 8cf1cd021..3e72e33d0 100644 --- a/.github/workflows/fix-abi-pr.yml +++ b/.github/workflows/fix-abi-pr.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ab42f861d..7915ca31f 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false @@ -57,7 +57,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/.github/workflows/release-abis.yml b/.github/workflows/release-abis.yml index 9ab9a069b..9dc4d932a 100644 --- a/.github/workflows/release-abis.yml +++ b/.github/workflows/release-abis.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/.github/workflows/storage-layout-check.yml b/.github/workflows/storage-layout-check.yml index 41d545115..5cc017e11 100644 --- a/.github/workflows/storage-layout-check.yml +++ b/.github/workflows/storage-layout-check.yml @@ -12,7 +12,7 @@ jobs: name: Assert storage layout steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node.js version uses: actions/setup-node@v3 diff --git a/.github/workflows/storage-layout-update.yml b/.github/workflows/storage-layout-update.yml index a8a4247ed..da270a16f 100644 --- a/.github/workflows/storage-layout-update.yml +++ b/.github/workflows/storage-layout-update.yml @@ -9,7 +9,7 @@ jobs: name: Update storage layout steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node.js version uses: actions/setup-node@v3 From c320f3db9f0ee3fe0c08972bfa6fa6099c5e028e Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Wed, 22 Nov 2023 17:43:34 +0300 Subject: [PATCH 02/20] refactor(github flow): bump actions/setup-node v3 -> v4 --- .github/workflows/analyse.yml | 2 +- .github/workflows/assert-bytecode.yml | 2 +- .github/workflows/fix-abi-pr.yml | 2 +- .github/workflows/linters.yml | 4 ++-- .github/workflows/release-abis.yml | 2 +- .github/workflows/storage-layout-check.yml | 2 +- .github/workflows/storage-layout-update.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index edb000ff7..94b094683 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index db01ee6e0..e8136a8c5 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 diff --git a/.github/workflows/fix-abi-pr.yml b/.github/workflows/fix-abi-pr.yml index 3e72e33d0..5ff9afaba 100644 --- a/.github/workflows/fix-abi-pr.yml +++ b/.github/workflows/fix-abi-pr.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 7915ca31f..097310403 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -13,7 +13,7 @@ jobs: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 @@ -62,7 +62,7 @@ jobs: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 diff --git a/.github/workflows/release-abis.yml b/.github/workflows/release-abis.yml index 9dc4d932a..149d79fed 100644 --- a/.github/workflows/release-abis.yml +++ b/.github/workflows/release-abis.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 diff --git a/.github/workflows/storage-layout-check.yml b/.github/workflows/storage-layout-check.yml index 5cc017e11..e0e817c68 100644 --- a/.github/workflows/storage-layout-check.yml +++ b/.github/workflows/storage-layout-check.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x cache: 'yarn' diff --git a/.github/workflows/storage-layout-update.yml b/.github/workflows/storage-layout-update.yml index da270a16f..0a2c0cd6c 100644 --- a/.github/workflows/storage-layout-update.yml +++ b/.github/workflows/storage-layout-update.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v4 - name: Setup node.js version - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x cache: 'yarn' From ab4e81ea5bd2dd7352f6a31bc51d3c44df9f7975 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Wed, 22 Nov 2023 17:44:06 +0300 Subject: [PATCH 03/20] refactor(github flow): bump NodeJS version 16 -> 18 --- .github/workflows/analyse.yml | 2 +- .github/workflows/assert-bytecode.yml | 2 +- .github/workflows/fix-abi-pr.yml | 2 +- .github/workflows/linters.yml | 4 ++-- .github/workflows/release-abis.yml | 2 +- .github/workflows/storage-layout-check.yml | 2 +- .github/workflows/storage-layout-update.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 94b094683..5d50edb66 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -21,7 +21,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index e8136a8c5..bdf4ec652 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -18,7 +18,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/fix-abi-pr.yml b/.github/workflows/fix-abi-pr.yml index 5ff9afaba..3aa0cc8bd 100644 --- a/.github/workflows/fix-abi-pr.yml +++ b/.github/workflows/fix-abi-pr.yml @@ -16,7 +16,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 097310403..493cbd36b 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -15,7 +15,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -64,7 +64,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/release-abis.yml b/.github/workflows/release-abis.yml index 149d79fed..7f8ffad83 100644 --- a/.github/workflows/release-abis.yml +++ b/.github/workflows/release-abis.yml @@ -21,7 +21,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/storage-layout-check.yml b/.github/workflows/storage-layout-check.yml index e0e817c68..1531a90b1 100644 --- a/.github/workflows/storage-layout-check.yml +++ b/.github/workflows/storage-layout-check.yml @@ -17,7 +17,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 18.x cache: 'yarn' - name: Submodules diff --git a/.github/workflows/storage-layout-update.yml b/.github/workflows/storage-layout-update.yml index 0a2c0cd6c..a08d2307b 100644 --- a/.github/workflows/storage-layout-update.yml +++ b/.github/workflows/storage-layout-update.yml @@ -14,7 +14,7 @@ jobs: - name: Setup node.js version uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 18.x cache: 'yarn' - name: Install yarn deps From b50aadef56160880ea68cec3883341ae5a0f2f29 Mon Sep 17 00:00:00 2001 From: Veremeenko Artyom Date: Thu, 23 Nov 2023 14:36:21 +0400 Subject: [PATCH 04/20] try forge github action to run anvil (#808) feat(CI): add flow to scratch deploy on clean local anvil --- .github/workflows/assert-bytecode.yml | 3 +- .github/workflows/scratch-deploy-local.yml | 54 ++++++++++++++++++++++ docs/scratch-deploy.md | 6 +++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/scratch-deploy-local.yml diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index bdf4ec652..f7566a2cf 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -2,8 +2,7 @@ name: Verify deployed contracts' bytecode on: pull_request: - branches: - - 'master' + branches: [master] jobs: assert-bytecode: diff --git a/.github/workflows/scratch-deploy-local.yml b/.github/workflows/scratch-deploy-local.yml new file mode 100644 index 000000000..f222bb597 --- /dev/null +++ b/.github/workflows/scratch-deploy-local.yml @@ -0,0 +1,54 @@ +name: Scratch deploy on local clean anvil + +on: + pull_request: + branches: [master, develop] + +jobs: + do-scratch-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Start anvil in background + run: anvil --accounts 20 --mnemonic "test test test test test test test test test test test junk" & + + - name: Setup node.js version + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + + - name: Cache yarn cache + id: cache-yarn-cache + uses: actions/cache@v3 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: yarn-${{ hashFiles('**/yarn.lock') }} + + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: node_modules-${{ hashFiles('**/yarn.lock') }} + restore-keys: node_modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install modules + run: yarn + if: | + steps.cache-yarn-cache.outputs.cache-hit != 'true' || + steps.cache-node-modules.outputs.cache-hit != 'true' + + - name: Run local deploy script + run: bash scripts/scratch/dao-local-deploy.sh diff --git a/docs/scratch-deploy.md b/docs/scratch-deploy.md index f6cd2a5e6..515a499a6 100644 --- a/docs/scratch-deploy.md +++ b/docs/scratch-deploy.md @@ -75,6 +75,12 @@ Run the node with the command: anvil -p 8545 --auto-impersonate --gas-price 0 --base-fee 0 --chain-id 1337 --mnemonic "test test test test test test test test test test test junk" ``` +or just + +```shell +anvil +``` + ### Hardhat node > NB: Hardhat node configuration is set in `hardhat.config.js` under `hardhat: { `. From 986869f681095dcf6867671b97268428686c9f81 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Thu, 23 Nov 2023 15:14:22 +0300 Subject: [PATCH 05/20] refactor: CI anvil run command and missing debug output --- .github/workflows/scratch-deploy-local.yml | 2 +- scripts/scratch/00-populate-deploy-artifact-from-env.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scratch-deploy-local.yml b/.github/workflows/scratch-deploy-local.yml index f222bb597..4471ec00e 100644 --- a/.github/workflows/scratch-deploy-local.yml +++ b/.github/workflows/scratch-deploy-local.yml @@ -17,7 +17,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 - name: Start anvil in background - run: anvil --accounts 20 --mnemonic "test test test test test test test test test test test junk" & + run: anvil -p 8545 --mnemonic "test test test test test test test test test test test junk" & - name: Setup node.js version uses: actions/setup-node@v4 diff --git a/scripts/scratch/00-populate-deploy-artifact-from-env.js b/scripts/scratch/00-populate-deploy-artifact-from-env.js index 8c584541b..e029c76cb 100644 --- a/scripts/scratch/00-populate-deploy-artifact-from-env.js +++ b/scripts/scratch/00-populate-deploy-artifact-from-env.js @@ -17,6 +17,7 @@ async function saveDeployParameters({ web3, artifacts }) { GATE_SEAL_FACTORY, GENESIS_TIME, DEPOSIT_CONTRACT, + WITHDRAWAL_QUEUE_BASE_URI, }) const state = readNetworkState(network.name, netId) From 9f1399995aa5d46f04862568c1dbe2e8b10cfd7a Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Thu, 23 Nov 2023 15:15:04 +0300 Subject: [PATCH 06/20] doc(scratch-deploy): local deploy: remove accounts.json setup step --- docs/scratch-deploy.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/scratch-deploy.md b/docs/scratch-deploy.md index 515a499a6..2bed6b2ad 100644 --- a/docs/scratch-deploy.md +++ b/docs/scratch-deploy.md @@ -58,27 +58,20 @@ A brief description of what's going on under the hood in the deploy script. ## Local deployment Deploys the DAO to local (http://127.0.0.1:8545) dev node (anvil, hardhat, ganache). -The deployment is done from the default test account `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266`. -The node must be configured with the default test accounts derived from the mnemonic `test test test test test test test test test test test junk`. +The deployment is done from the default test account `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266` derived from the default mnemonic. +Thus the node must be configured with the default test accounts derived from the mnemonic `test test test test test test test test test test test junk`. 1. Run `yarn install` (get sure repo dependencies are installed) 2. Run the node on default port 8545 (for the commands, see subsections below) -3. Set test account private key `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80` to `accounts.json` under `/eth/local` like `"local": [""]` (see `accounts.sample.json` for example) -4. Run the deploy script `bash scripts/scratch/dao-local-deploy.sh` from root repo directory -5. Check out the deploy artifacts in `deployed-local.json` +3. Run the deploy script `bash scripts/scratch/dao-local-deploy.sh` from root repo directory +4. Check out the deploy artifacts in `deployed-local.json` ### Anvil Run the node with the command: ```shell -anvil -p 8545 --auto-impersonate --gas-price 0 --base-fee 0 --chain-id 1337 --mnemonic "test test test test test test test test test test test junk" -``` - -or just - -```shell -anvil +anvil -p 8545 --mnemonic "test test test test test test test test test test test junk" ``` ### Hardhat node From 124bfd2b634caf2c4d234a5b5a0e32548d4d9cd7 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Mon, 27 Nov 2023 21:23:16 +0300 Subject: [PATCH 07/20] feat(scratch): after deploy run simple acceptance test (on fork) --- .github/workflows/scratch-deploy-local.yml | 3 ++- scripts/scratch/checks/scratch-acceptance-test.js | 4 ---- scripts/scratch/dao-local-deploy.sh | 7 ++++++- scripts/scratch/send-hardhat-mine.js | 10 ++++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 scripts/scratch/send-hardhat-mine.js diff --git a/.github/workflows/scratch-deploy-local.yml b/.github/workflows/scratch-deploy-local.yml index 4471ec00e..af13cbf1e 100644 --- a/.github/workflows/scratch-deploy-local.yml +++ b/.github/workflows/scratch-deploy-local.yml @@ -17,7 +17,8 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 - name: Start anvil in background - run: anvil -p 8545 --mnemonic "test test test test test test test test test test test junk" & + # For the port see port in scripts/scratch/dao-local-deploy.sh in RPC_URL env var + run: anvil -p 8555 --mnemonic "test test test test test test test test test test test junk" & - name: Setup node.js version uses: actions/setup-node@v4 diff --git a/scripts/scratch/checks/scratch-acceptance-test.js b/scripts/scratch/checks/scratch-acceptance-test.js index f1b6c198c..03000cbe1 100644 --- a/scripts/scratch/checks/scratch-acceptance-test.js +++ b/scripts/scratch/checks/scratch-acceptance-test.js @@ -9,12 +9,8 @@ const { assert } = require('../../../test/helpers/assert') const REQUIRED_NET_STATE = [ - 'ensAddress', - 'lidoApmEnsName', - 'daoAragonId', 'vestingParams', 'daoInitialSettings', - 'lidoTemplate' ] const UNLIMITED = 1000000000 diff --git a/scripts/scratch/dao-local-deploy.sh b/scripts/scratch/dao-local-deploy.sh index 03f6b7445..60aa80f38 100755 --- a/scripts/scratch/dao-local-deploy.sh +++ b/scripts/scratch/dao-local-deploy.sh @@ -4,7 +4,7 @@ set -o pipefail # export NETWORK=local -export RPC_URL="http://127.0.0.1:8545" +export RPC_URL=${RPC_URL:="http://127.0.0.1:8555"} # if defined use the value set to default otherwise # If GateSeal factory is zero, deploy no GateSeal instance. Otherwise use the factory to deploy an instance export GATE_SEAL_FACTORY=0x0000000000000000000000000000000000000000 @@ -19,3 +19,8 @@ export NETWORK_STATE_FILE="deployed-${NETWORK}.json" export NETWORK_STATE_DEFAULTS_FILE="deployed-testnet-defaults.json" bash scripts/scratch/dao-deploy.sh + +# # Need this to get sure the last transactions are mined +yarn hardhat --network $NETWORK run ./scripts/scratch/send-hardhat-mine.js --no-compile + +NETWORK_STATE_FILE=deployed-local.json HARDHAT_FORKING_URL="${RPC_URL}" yarn hardhat run --no-compile ./scripts/scratch/checks/scratch-acceptance-test.js --network hardhat \ No newline at end of file diff --git a/scripts/scratch/send-hardhat-mine.js b/scripts/scratch/send-hardhat-mine.js new file mode 100644 index 000000000..1f07f7950 --- /dev/null +++ b/scripts/scratch/send-hardhat-mine.js @@ -0,0 +1,10 @@ +const runOrWrapScript = require('../helpers/run-or-wrap-script') +const { log } = require('../helpers/log') + +async function main() { + // 0x01 is too little, 0x80 works, although less might be enough + await ethers.provider.send('hardhat_mine', ["0x80"]) + log.success(`Send "hardhat_mine"`) +} + +module.exports = runOrWrapScript(main, module) From 8becfe69b07872ea94dcbc73e1777d8ce15e80d2 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Mon, 27 Nov 2023 21:28:07 +0300 Subject: [PATCH 08/20] feat: on scratch deploy grant NOR's MANAGE_NODE_OPERATOR_ROLE to voting Need this to make current scratch acceptance script work. After voting utilities added to the repo can rewrite the acceptance script to grant/renounce this role. --- contracts/0.4.24/template/LidoTemplate.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contracts/0.4.24/template/LidoTemplate.sol b/contracts/0.4.24/template/LidoTemplate.sol index a90fb784d..150ff1ad4 100644 --- a/contracts/0.4.24/template/LidoTemplate.sol +++ b/contracts/0.4.24/template/LidoTemplate.sol @@ -608,7 +608,12 @@ contract LidoTemplate is IsContract { // NodeOperatorsRegistry perms[0] = _state.operators.MANAGE_SIGNING_KEYS(); perms[1] = _state.operators.SET_NODE_OPERATOR_LIMIT_ROLE(); - for (i = 0; i < 2; ++i) { + // Need MANAGE_NODE_OPERATOR_ROLE to make current scratch acceptance script + // (scripts/scratch/checks/scratch-acceptance-test.js) work. + // After voting utilities added to the repo should rewrite the acceptance + // script to grant/renounce this role and remove granting from here. + perms[2] = _state.operators.MANAGE_NODE_OPERATOR_ROLE(); + for (i = 0; i < 3; ++i) { _createPermissionForVoting(acl, _state.operators, perms[i], voting); } acl.createPermission(_state.stakingRouter, _state.operators, _state.operators.STAKING_ROUTER_ROLE(), voting); From 43aaa742b2869d3077f036c159838310b582a865 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Mon, 27 Nov 2023 21:38:47 +0300 Subject: [PATCH 09/20] refactor(github flows): remove obsolete files --- .github/deployed-bytecode-consts.js | 20 -------------------- .github/prepare-accounts-json.py | 24 ------------------------ 2 files changed, 44 deletions(-) delete mode 100644 .github/deployed-bytecode-consts.js delete mode 100755 .github/prepare-accounts-json.py diff --git a/.github/deployed-bytecode-consts.js b/.github/deployed-bytecode-consts.js deleted file mode 100644 index 32d74f6f1..000000000 --- a/.github/deployed-bytecode-consts.js +++ /dev/null @@ -1,20 +0,0 @@ -const APPS_TO_NAMES = new Map([ - ['lido', 'Lido'], - ['node-operators-registry', 'NodeOperatorsRegistry'], -]) - -const CONTRACTS_TO_NAMES = new Map([ - ['wstethContract', 'WstETH'], - ['executionLayerRewardsVault', 'LidoExecutionLayerRewardsVault'], - ['compositePostRebaseBeaconReceiver', 'CompositePostRebaseBeaconReceiver'], - ['burner', 'Burner'], - ['depositor', 'DepositSecurityModule'] -]) - -const IGNORE_METADATA_CONTRACTS = ['WstETH'] - -module.exports = { - APPS_TO_NAMES, - CONTRACTS_TO_NAMES, - IGNORE_METADATA_CONTRACTS -} diff --git a/.github/prepare-accounts-json.py b/.github/prepare-accounts-json.py deleted file mode 100755 index 4cf8ce381..000000000 --- a/.github/prepare-accounts-json.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python3 -from pathlib import Path -import fileinput -import shutil -import os - -INFURA_PROJECT_ID = os.environ.get("INFURA_PROJECT_ID") -ETHERSCAN_API_KEY = os.environ.get("ETHERSCAN_API_KEY") - -ACCOUNTS_TMPL = Path("./accounts.sample.json") -ACCOUNTS = Path("./accounts.json") - - -def main(): - shutil.copyfile(ACCOUNTS_TMPL, ACCOUNTS) - with fileinput.FileInput(ACCOUNTS, inplace=True) as file: - for line in file: - updated_line = line.replace("INFURA_PROJECT_ID", INFURA_PROJECT_ID) - updated_line = updated_line.replace("ETHERSCAN_API_KEY", ETHERSCAN_API_KEY) - print(updated_line, end="") - - -if __name__ == "__main__": - main() From dfe71bde77aa94f97192bd6b2a0f49c4facfb59c Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Mon, 27 Nov 2023 21:47:10 +0300 Subject: [PATCH 10/20] fix(github flow): attempt to fix bytecode checks (assert-bytecode.yml) --- .github/workflows/assert-bytecode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index f7566a2cf..403f6a687 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -63,5 +63,5 @@ jobs: cat _actual _expected | sort | uniq -u | tee _diff [ -s _diff ] && exit 1 || exit 0 env: - IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil + IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil|WithdrawalsManagerStub|WithdrawalsManagerProxy|ERC1967Proxy if: ${{ always() }} From abf0b8b0183a71cea2c2b92595417b8fd05bd12f Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Mon, 27 Nov 2023 21:51:28 +0300 Subject: [PATCH 11/20] refactor: generate artifacts.json on CI, remove it from repo and compile --- .github/workflows/assert-bytecode.yml | 3 + artifacts.json | 176 -------------------------- package.json | 2 +- 3 files changed, 4 insertions(+), 177 deletions(-) delete mode 100644 artifacts.json diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index 403f6a687..248039451 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -48,6 +48,9 @@ jobs: - name: Compile contracts run: yarn compile + - name: Write config for action-verify-bytecode + run: extract-artifacts + - name: Verify bytecode uses: lidofinance/action-verify-bytecode@master with: diff --git a/artifacts.json b/artifacts.json deleted file mode 100644 index 36c2e847a..000000000 --- a/artifacts.json +++ /dev/null @@ -1,176 +0,0 @@ -[ - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0x852deD011285fe67063a08005c71a85690503Cee", - "txHash": "0x3def88f27741216b131de2861cf89af2ca2ac4242b384ee33dca8cc70c51c8dd" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/AccountingOracle.sol/AccountingOracle.json", - "sourcePath": "contracts/0.8.9/oracle/AccountingOracle.sol", - "name": "AccountingOracle", - "address": "0xF3c5E0A67f32CF1dc07a8817590efa102079a1aF", - "txHash": "0x3e27627d3ed236aff8901df187196e9682187dfd0d259c5d5811a6e923436083" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/Lido.sol/Lido.json", - "sourcePath": "contracts/0.4.24/Lido.sol", - "name": "Lido", - "address": "0x17144556fd3424EDC8Fc8A4C940B2D04936d17eb", - "txHash": "0xb4b5e02643c9802fd0f7c73c4854c4f1b83497aca13f8297ba67207b71c4dcd9" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/nos/NodeOperatorsRegistry.sol/NodeOperatorsRegistry.json", - "sourcePath": "contracts/0.4.24/nos/NodeOperatorsRegistry.sol", - "name": "NodeOperatorsRegistry", - "address": "0x8538930c385C0438A357d2c25CB3eAD95Ab6D8ed", - "txHash": "0xbec5b6ffb8fbc775a183e25cd285367993d7201752e1638a07abec8962bab750" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/oracle/LegacyOracle.sol/LegacyOracle.json", - "sourcePath": "contracts/0.4.24/oracle/LegacyOracle.sol", - "name": "LegacyOracle", - "address": "0xa29b819654cE6224A222bb5f586920105E2D7E0E", - "txHash": "0xe666e3ce409bb4c18e1016af0b9ed3495b20361a69f2856bccb9e67599795b6f" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/Burner.sol/Burner.json", - "sourcePath": "contracts/0.8.9/Burner.sol", - "name": "Burner", - "address": "0xD15a672319Cf0352560eE76d9e89eAB0889046D3", - "txHash": "0xbebf5c85404a0d8e36b859046c984fdf6dd764b5d317feb7eb3525016005b1d9" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/DepositSecurityModule.sol/DepositSecurityModule.json", - "sourcePath": "contracts/0.8.9/DepositSecurityModule.sol", - "name": "DepositSecurityModule", - "address": "0xC77F8768774E1c9244BEed705C4354f2113CFc09", - "txHash": "0x21307a2321f167f99de11ccec86d7bdd8233481bbffa493e15c519ca8d662c4f" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/EIP712StETH.sol/EIP712StETH.json", - "sourcePath": "contracts/0.8.9/EIP712StETH.sol", - "name": "EIP712StETH", - "address": "0x8F73e4C2A6D852bb4ab2A45E6a9CF5715b3228B7", - "txHash": "0xecb5010620fb13b0e2bbc98b8a0c82de0d7385491452cd36cf303cd74216ed91" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/LidoExecutionLayerRewardsVault.sol/LidoExecutionLayerRewardsVault.json", - "sourcePath": "contracts/0.8.9/LidoExecutionLayerRewardsVault.sol", - "name": "LidoExecutionLayerRewardsVault", - "address": "0x388C818CA8B9251b393131C08a736A67ccB19297", - "txHash": "0xd72cf25e4a5fe3677b6f9b2ae13771e02ad66f8d2419f333bb8bde3147bd4294" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/HashConsensus.sol/HashConsensus.json", - "sourcePath": "contracts/0.8.9/oracle/HashConsensus.sol", - "name": "HashConsensus", - "address": "0xD624B08C83bAECF0807Dd2c6880C3154a5F0B288", - "txHash": "0xd74dcca9bacede9f332d70562f49808254061853937ffbbfc7397ab5d017041a" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/HashConsensus.sol/HashConsensus.json", - "sourcePath": "contracts/0.8.9/oracle/HashConsensus.sol", - "name": "HashConsensus", - "address": "0x7FaDB6358950c5fAA66Cb5EB8eE5147De3df355a", - "txHash": "0xed1ab73dd5458b5ec0b174508318d2f39a31029112af21f87d09106933bd3a9e" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb", - "txHash": "0x3a2910624533935cc8c21837b1705bcb159a760796930097016186be705cc455" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/LidoLocator.sol/LidoLocator.json", - "sourcePath": "contracts/0.8.9/LidoLocator.sol", - "name": "LidoLocator", - "address": "0x1D920cc5bACf7eE506a271a5259f2417CaDeCE1d", - "txHash": "0xf90012ef0a40e47c909ab3a5b3503ecee78f6a9be134d1349a742e500d37ae33" - }, - { - "artifactPath": "artifacts/contracts/0.4.24/template/LidoTemplate.sol/LidoTemplate.json", - "sourcePath": "contracts/0.4.24/template/LidoTemplate.sol", - "name": "LidoTemplate", - "address": "0x752350797CB92Ad3BF1295Faf904B27585e66BF5", - "txHash": "0xdcd4ebe028aa3663a1fe8bbc92ae8489045e29d2a6ef5284083d9be5c3fa5f19" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/OracleDaemonConfig.sol/OracleDaemonConfig.json", - "sourcePath": "contracts/0.8.9/OracleDaemonConfig.sol", - "name": "OracleDaemonConfig", - "address": "0xbf05A929c3D7885a6aeAd833a992dA6E5ac23b09", - "txHash": "0xa4f380b8806f5a504ef67fce62989e09be5a48bf114af63483c01c22f0c9a36f" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol/OracleReportSanityChecker.json", - "sourcePath": "contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol", - "name": "OracleReportSanityChecker", - "address": "0x9305c1Dbfe22c12c66339184C0025d7006f0f1cC", - "txHash": "0x700c83996ad7deefda286044280ad86108dfef9c880909bd8e75a3746f7d631c" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0xFdDf38947aFB03C621C71b06C9C70bce73f12999", - "txHash": "0xb8620f04a8db6bb52cfd0978c6677a5f16011e03d4622e5d660ea6ba34c2b122" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/StakingRouter.sol/StakingRouter.json", - "sourcePath": "contracts/0.8.9/StakingRouter.sol", - "name": "StakingRouter", - "address": "0xD8784e748f59Ba711fB5643191Ec3fAdD50Fb6df", - "txHash": "0xd6d489f22203c835da6027ff0e532a01a08f36f0fda6c7c0a42e471ae3b3c461" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e", - "txHash": "0xef3eea1523d2161c2f36ba61e327e3520231614c055b8a88c7f5928d18e423ea" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol/ValidatorsExitBusOracle.json", - "sourcePath": "contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol", - "name": "ValidatorsExitBusOracle", - "address": "0xA89Ea51FddE660f67d1850e03C9c9862d33Bc42c", - "txHash": "0x5ab545276f78a72a432c3e971c96384973abfab6394e08cb077a006c25aef7a7" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/proxy/OssifiableProxy.sol/OssifiableProxy.json", - "sourcePath": "contracts/0.8.9/proxy/OssifiableProxy.sol", - "name": "OssifiableProxy", - "address": "0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1", - "txHash": "0x98c2170be034f750f5006cb69ea0aeeaf0858b11f6324ee53d582fa4dd49bc1a" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/WithdrawalQueueERC721.sol/WithdrawalQueueERC721.json", - "sourcePath": "contracts/0.8.9/WithdrawalQueueERC721.sol", - "name": "WithdrawalQueueERC721", - "address": "0xE42C659Dc09109566720EA8b2De186c2Be7D94D9", - "txHash": "0x6ab0151735c01acdef518421358d41a08752169bc383c57d57f5bfa135ac6eb1" - }, - { - "artifactPath": "artifacts/contracts/0.8.9/WithdrawalVault.sol/WithdrawalVault.json", - "sourcePath": "contracts/0.8.9/WithdrawalVault.sol", - "name": "WithdrawalVault", - "address": "0xCC52f17756C04bBa7E377716d7062fC36D7f69Fd", - "txHash": "0xd9eb2eca684770e4d2b192709b6071875f75072a0ce794a582824ee907a704f3" - }, - { - "artifactPath": "artifacts/contracts/0.6.12/WstETH.sol/WstETH.json", - "sourcePath": "contracts/0.6.12/WstETH.sol", - "name": "WstETH", - "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", - "txHash": "0xaf2c1a501d2b290ef1e84ddcfc7beb3406f8ece2c46dee14e212e8233654ff05" - }, - { - "artifactPath": "artifacts/contracts/0.6.11/deposit_contract.sol/DepositContract.json", - "sourcePath": "contracts/0.6.11/deposit_contract.sol", - "name": "DepositContract", - "address": "0x00000000219ab540356cBB839Cbe05303d7705Fa" - } -] diff --git a/package.json b/package.json index d9f20e113..3716d0ebe 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "test:coverage": "yarn compile && hardhat coverage --testfiles test", "test:e2e": "yarn compile && ava -T 1000000 -v", "estimate-deposit-loop-gas": "yarn run test:unit ./estimate_deposit_loop_gas.js", - "compile": "hardhat compile && yarn extract-abi && yarn extract-artifacts", + "compile": "hardhat compile && yarn extract-abi", "clean": "hardhat clean", "userdoc": "hardhat userdoc", "extract-abi": "node ./scripts/extract-abi.js", From fb8c68b6895c5d69424e4d9f58dee3f457c86586 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Mon, 27 Nov 2023 23:03:18 +0300 Subject: [PATCH 12/20] fix(workflows): typo in assert-bytecode.yml --- .github/workflows/assert-bytecode.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index 248039451..ef03409d8 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -2,7 +2,7 @@ name: Verify deployed contracts' bytecode on: pull_request: - branches: [master] + branches: [master, develop] jobs: assert-bytecode: @@ -49,7 +49,7 @@ jobs: run: yarn compile - name: Write config for action-verify-bytecode - run: extract-artifacts + run: yarn extract-artifacts - name: Verify bytecode uses: lidofinance/action-verify-bytecode@master From 858156969a67662654f01de4d1c42da964b05f0a Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Tue, 28 Nov 2023 15:11:59 +0300 Subject: [PATCH 13/20] fix(workflows): attemp to fix storage-layout updating the action used --- .github/workflows/storage-layout-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/storage-layout-check.yml b/.github/workflows/storage-layout-check.yml index 1531a90b1..17ad4d1cc 100644 --- a/.github/workflows/storage-layout-check.yml +++ b/.github/workflows/storage-layout-check.yml @@ -27,8 +27,9 @@ jobs: run: yarn - name: Check storage-layout - uses: lidofinance/storage-layout-action@v1 + uses: lidofinance/storage-layout-action@feat/ignore-contracts-input with: mode: check src-folder: ./contracts ignore-folders: '{test_helpers,template,mocks}' + ignore-contracts: 'WithdrawalsManagerProxy|WithdrawalsManagerStub' From fea112c529ac99d28e645f24a5ad7d75b09c3504 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Tue, 28 Nov 2023 15:23:31 +0300 Subject: [PATCH 14/20] fix(workflow): attempt to fix assert-bytecode (ignore LidoTemplate) --- .github/workflows/assert-bytecode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index ef03409d8..b6b2f3013 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -66,5 +66,5 @@ jobs: cat _actual _expected | sort | uniq -u | tee _diff [ -s _diff ] && exit 1 || exit 0 env: - IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil|WithdrawalsManagerStub|WithdrawalsManagerProxy|ERC1967Proxy + IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil|WithdrawalsManagerStub|WithdrawalsManagerProxy|ERC1967Proxy|LidoTemplate if: ${{ always() }} From 1c57abe12cc4c72dcb5c9d0980366572c39f5ff9 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Tue, 28 Nov 2023 15:30:16 +0300 Subject: [PATCH 15/20] fix(workflow): 2nd attempt to fix assert-bytecode (ignore LidoTemplate) --- .github/workflows/assert-bytecode.yml | 2 +- scripts/extract-artifacts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index b6b2f3013..4d4d82ba7 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -66,5 +66,5 @@ jobs: cat _actual _expected | sort | uniq -u | tee _diff [ -s _diff ] && exit 1 || exit 0 env: - IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil|WithdrawalsManagerStub|WithdrawalsManagerProxy|ERC1967Proxy|LidoTemplate + IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil if: ${{ always() }} diff --git a/scripts/extract-artifacts.js b/scripts/extract-artifacts.js index b00f9194c..bfdeb052f 100644 --- a/scripts/extract-artifacts.js +++ b/scripts/extract-artifacts.js @@ -6,7 +6,7 @@ const artifactsPath = path.resolve(__dirname, '..', artifactsFileName) const deployedFileName = 'deployed-mainnet.json' const deployedPath = path.resolve(__dirname, '..', deployedFileName) -const stateKeysToIgnore = ['dummyEmptyContract'] +const stateKeysToIgnore = ['dummyEmptyContract', 'lidoTemplate'] const additionalArtifacts = [ { "artifactPath": "artifacts/contracts/0.6.11/deposit_contract.sol/DepositContract.json", From 6831106b4556f4cc28b768ac7cf072fce17f4627 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Tue, 28 Nov 2023 15:31:45 +0300 Subject: [PATCH 16/20] fix(workflow storage-layout-check): ignore ERC1967Proxy --- .github/workflows/storage-layout-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/storage-layout-check.yml b/.github/workflows/storage-layout-check.yml index 17ad4d1cc..eda747821 100644 --- a/.github/workflows/storage-layout-check.yml +++ b/.github/workflows/storage-layout-check.yml @@ -32,4 +32,4 @@ jobs: mode: check src-folder: ./contracts ignore-folders: '{test_helpers,template,mocks}' - ignore-contracts: 'WithdrawalsManagerProxy|WithdrawalsManagerStub' + ignore-contracts: 'WithdrawalsManagerProxy|WithdrawalsManagerStub|ERC1967Proxy' From 0801db3ce6ba27c86209b4ffd7943c7f9c05d1e2 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Tue, 28 Nov 2023 15:43:55 +0300 Subject: [PATCH 17/20] fix(workflow): 3rd attempt to fix assert-bytecode (restore ignores) --- .github/workflows/assert-bytecode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index 4d4d82ba7..a54fec53f 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -66,5 +66,5 @@ jobs: cat _actual _expected | sort | uniq -u | tee _diff [ -s _diff ] && exit 1 || exit 0 env: - IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil + IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil|WithdrawalsManagerProxy|WithdrawalsManagerStub|ERC1967Proxy if: ${{ always() }} From a0dcbdfc94f3d70ccc5bf7f7e7d7d264a0c7342a Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Tue, 28 Nov 2023 16:21:42 +0300 Subject: [PATCH 18/20] refactor(storage-layout-action): refer to v1 again (not dev branch) --- .github/workflows/storage-layout-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/storage-layout-check.yml b/.github/workflows/storage-layout-check.yml index eda747821..597aaf309 100644 --- a/.github/workflows/storage-layout-check.yml +++ b/.github/workflows/storage-layout-check.yml @@ -27,7 +27,7 @@ jobs: run: yarn - name: Check storage-layout - uses: lidofinance/storage-layout-action@feat/ignore-contracts-input + uses: lidofinance/storage-layout-action@v1 with: mode: check src-folder: ./contracts From caeab6843be61e7a6e2cc4e7888663f41a8a5a2b Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Tue, 28 Nov 2023 16:36:56 +0300 Subject: [PATCH 19/20] refactor(workflow): restore assert-bytecode condition: only master --- .github/workflows/assert-bytecode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assert-bytecode.yml b/.github/workflows/assert-bytecode.yml index a54fec53f..1f2680ea8 100644 --- a/.github/workflows/assert-bytecode.yml +++ b/.github/workflows/assert-bytecode.yml @@ -2,7 +2,7 @@ name: Verify deployed contracts' bytecode on: pull_request: - branches: [master, develop] + branches: [master] jobs: assert-bytecode: From 2842af4ed281bd1f3ba71dd5001a992beb4d6fc4 Mon Sep 17 00:00:00 2001 From: Artyom Veremeenko Date: Wed, 6 Dec 2023 18:27:57 +0300 Subject: [PATCH 20/20] feat(scratch): assign MANAGE_NODE_OPERATOR_ROLE to agent (manager is voting) --- contracts/0.4.24/template/LidoTemplate.sol | 8 ++------ scripts/scratch/checks/scratch-acceptance-test.js | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/contracts/0.4.24/template/LidoTemplate.sol b/contracts/0.4.24/template/LidoTemplate.sol index 150ff1ad4..b589f04d8 100644 --- a/contracts/0.4.24/template/LidoTemplate.sol +++ b/contracts/0.4.24/template/LidoTemplate.sol @@ -608,15 +608,11 @@ contract LidoTemplate is IsContract { // NodeOperatorsRegistry perms[0] = _state.operators.MANAGE_SIGNING_KEYS(); perms[1] = _state.operators.SET_NODE_OPERATOR_LIMIT_ROLE(); - // Need MANAGE_NODE_OPERATOR_ROLE to make current scratch acceptance script - // (scripts/scratch/checks/scratch-acceptance-test.js) work. - // After voting utilities added to the repo should rewrite the acceptance - // script to grant/renounce this role and remove granting from here. - perms[2] = _state.operators.MANAGE_NODE_OPERATOR_ROLE(); - for (i = 0; i < 3; ++i) { + for (i = 0; i < 2; ++i) { _createPermissionForVoting(acl, _state.operators, perms[i], voting); } acl.createPermission(_state.stakingRouter, _state.operators, _state.operators.STAKING_ROUTER_ROLE(), voting); + acl.createPermission(_state.agent, _state.operators, _state.operators.MANAGE_NODE_OPERATOR_ROLE(), voting); // Lido perms[0] = _state.lido.PAUSE_ROLE(); diff --git a/scripts/scratch/checks/scratch-acceptance-test.js b/scripts/scratch/checks/scratch-acceptance-test.js index 03000cbe1..1430c1a70 100644 --- a/scripts/scratch/checks/scratch-acceptance-test.js +++ b/scripts/scratch/checks/scratch-acceptance-test.js @@ -83,8 +83,8 @@ async function prepareProtocolForSubmitDepositReportWithdrawalFlow(protocol, sta await withdrawalQueue.resume({ from: agent.address }) await withdrawalQueue.renounceRole(await withdrawalQueue.RESUME_ROLE(), agent.address, { from: agent.address }) - await nodeOperatorsRegistry.addNodeOperator('1', ADDRESS_1, { from: voting.address }) - await nodeOperatorsRegistry.addNodeOperator('2', ADDRESS_2, { from: voting.address }) + await nodeOperatorsRegistry.addNodeOperator('1', ADDRESS_1, { from: agent.address }) + await nodeOperatorsRegistry.addNodeOperator('2', ADDRESS_2, { from: agent.address }) await nodeOperatorsRegistry.addSigningKeys(0, 1, pad('0x010203', 48), pad('0x01', 96), { from: voting.address }) await nodeOperatorsRegistry.addSigningKeys(