Skip to content
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

feat(scratch deploy): mvp of local scratch deployment #790

Merged
merged 51 commits into from
Nov 4, 2023

Conversation

arwer13
Copy link
Contributor

@arwer13 arwer13 commented Sep 11, 2023

Renovation of the scratch deploy scripts. For the README see docs/scratch-deploy.md

NB that the scripts are to undertake one more refactoring iteration during migration to TypeScript and new repo https://github.com/lidofinance/core

SCRATCH_DEPLOY.md Outdated Show resolved Hide resolved
contracts/0.8.4/WithdrawalsManagerProxy.sol Dismissed Show dismissed Hide dismissed
contracts/0.8.4/WithdrawalsManagerProxy.sol Dismissed Show dismissed Hide dismissed
contracts/0.8.4/WithdrawalsManagerProxy.sol Dismissed Show dismissed Hide dismissed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the json files are quite different for different networks, for example this is how the accounting oracle section looks like for goerli and holesky:

"accountingOracle": {
  "parameters": {
  "deployParameters": {
    "consensusVersion": 1
  },
  "contract": "AccountingOracle",
  "implementation": "0xC94ad2eb129146235f71cc35f7FbFec7fe404DF9",
  "address": "0x76f358A842defa0E179a8970767CFf668Fc134d6",
  "constructorArgs": [
    "0x1eDf09b5023DC86737b59dE68a8130De878984f5",
    "0x1643E812aE58766192Cf7D2Cf9567dF2C37e9B7F",
    "0x24d8451BC07e7aF4Ba94F69aCDD9ad3c6579D9FB",
    12,
    1616508000
  ]
},
"accountingOracle": {
  "deployParameters": {
    "consensusVersion": 1
  },
  "proxy": {
    "contract": "contracts/0.8.9/proxy/OssifiableProxy.sol",
    "address": "0x4E97A3972ce8511D87F334dA17a2C332542a5246",
    "constructorArgs": [
      "0x6AcA050709469F1f98d8f40f68b1C83B533cd2b2",
      "0x22896Bfc68814BFD855b1a167255eE497006e730",
      "0x"
    ]
  },
  "implementation": {
    "contract": "contracts/0.8.9/oracle/AccountingOracle.sol",
    "address": "0x6AcA050709469F1f98d8f40f68b1C83B533cd2b2",
    "constructorArgs": [
      "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8",
      "0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034",
      "0x072f72BE3AcFE2c52715829F2CD9061A6C8fF019",
      12,
      1695902400
    ]
  }
},

May we bring them to the same format and make a uniform order (maybe sort the keys alphabetically)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pro for the unified order and for the alphabetical one: seems to be the most seamless among other options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support the suggestion by @avsetsin 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@loga4 loga4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe remove cli folder at all?

Copy link
Member

@krogla krogla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of minor remarks. otherwise lgtm

scripts/scratch/07-create-app-repos.js Outdated Show resolved Hide resolved
address: contract.address,
constructorArgs: constructorArgs,
}
persistNetworkState2(network.name, netId, state)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

persistNetworkState2 -> persistNetworkState ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed duplicate function, left the more straightforward version of it

@@ -1,4 +1,4 @@
const { readNetworkState, persistNetworkState2 } = require('./persisted-network-state')
const { readNetworkState, persistNetworkState, persistNetworkState2 } = require('./persisted-network-state')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need 2 funcs like persistNetworkState ?
or maybe rename persist Network State 2 to understand the difference with persistNetworkState ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, we don't )
persistNetworkState2 was introduced by me once upon a time to maintain compatibility with all other existing scripts, but I also agree that it is a bit redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed duplicate function, left the more straightforward version of it

Copy link
Contributor

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is huge 👏

I'd suggest implementing some changes and updating the README file as well to properly refer to the new scratch deployment approach.

contracts/0.4.24/template/LidoTemplate.sol Outdated Show resolved Hide resolved
contracts/0.4.24/template/LidoTemplate.sol Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support the suggestion by @avsetsin 👍

docs/scratch-deploy.md Outdated Show resolved Hide resolved

if (implementation === null) {
console.log(`Deploying implementation for proxy of ${artifactName}`)
process.stdout.write(`Deploying implementation for proxy of ${artifactName}... `)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why sometimes console.log but here process.stdout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.stdout.write is for printing without end of line (just to save some space on the screen)

scripts/helpers/run-or-wrap-script.js Outdated Show resolved Hide resolved
scripts/scratch/00-populate-deploy-artifact-from-env.js Outdated Show resolved Hide resolved
scripts/scratch/checks/scratch-acceptance-test.js Outdated Show resolved Hide resolved
scripts/scratch/dao-deploy.sh Outdated Show resolved Hide resolved
@TheDZhon
Copy link
Contributor

@arwer13 could you please explicitly secure the quorum-sufficient TESTLDO amount to reside on the Agent's balance during the deployment

That would ease governance-related test fixtures greatly.

@bulbozaur proposes the idea, and I'd suggest implementing it

@arwer13
Copy link
Contributor Author

arwer13 commented Oct 31, 2023

could you please explicitly secure the quorum-sufficient TESTLDO amount to reside on the Agent's balance during the deployment
Added.

The other comments are processed as well.
Ready for merge, imho.

@arwer13 arwer13 dismissed TheDZhon’s stale review November 4, 2023 06:58

TheDZhon is OoO, but he approved beforehand in messanger.

@arwer13 arwer13 merged commit 9677230 into develop Nov 4, 2023
4 of 5 checks passed
@arwer13 arwer13 deleted the feat/scratch-holesky branch November 4, 2023 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants