Skip to content

feat(ct): overhaul deployment process#2298

Merged
mslipper merged 1 commit intodevelopfrom
sc/ct-update-deploy
Mar 23, 2022
Merged

feat(ct): overhaul deployment process#2298
mslipper merged 1 commit intodevelopfrom
sc/ct-update-deploy

Conversation

@smartcontracts
Copy link
Contributor

@smartcontracts smartcontracts commented Mar 9, 2022

Description
Overhauls the contract deployment process to use a simpler typed
deployment method. Removes the need for deployment bash scripts and
makes review of deployment configurations much easier.

TODO:

  • Add parsing/validation for config files
  • Add checks to confirm environment variables are properly set
  • Check if anything needs to be modified in stackman
  • Update README to reflect new deploy process

@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2022

⚠️ No Changeset found

Latest commit: 4c486d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@smartcontracts smartcontracts marked this pull request as draft March 9, 2022 17:38
@smartcontracts smartcontracts force-pushed the sc/ct-update-deploy branch 2 times, most recently from 7ea02e3 to 90dc13f Compare March 9, 2022 17:44
L2StandardBridge: {
l1TokenBridge: cfg.l1StandardBridgeAddress,
l1TokenBridge: (
await getContractFromArtifact(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is no longer configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, it gets pulled automatically from the deployment folder based on the current network name. This is effectively what we did anyway, except we did it manually which is error prone.

@tynes
Copy link
Contributor

tynes commented Mar 9, 2022

I would say at this point, the most confusing part of the deploy setup is this:

if (
process.env.CONTRACTS_TARGET_NETWORK &&
process.env.CONTRACTS_DEPLOYER_KEY &&
process.env.CONTRACTS_RPC_URL

These env vars modifying the networks is a bit confusing

@smartcontracts
Copy link
Contributor Author

I would say at this point, the most confusing part of the deploy setup is this:

if (
process.env.CONTRACTS_TARGET_NETWORK &&
process.env.CONTRACTS_DEPLOYER_KEY &&
process.env.CONTRACTS_RPC_URL

These env vars modifying the networks is a bit confusing

I agree. We might as well use a more standard setup (different RPC URLs for different networks? API keys? idk).

@smartcontracts smartcontracts marked this pull request as ready for review March 9, 2022 20:27
@smartcontracts smartcontracts marked this pull request as draft March 9, 2022 20:28
@smartcontracts smartcontracts force-pushed the sc/ct-update-deploy branch 4 times, most recently from ef5b859 to a433656 Compare March 9, 2022 21:30
@smartcontracts smartcontracts marked this pull request as ready for review March 9, 2022 21:33
@codecov-commenter
Copy link

Codecov Report

Merging #2298 (3cd8d0b) into develop (779709f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2298   +/-   ##
========================================
  Coverage    80.08%   80.08%           
========================================
  Files           77       77           
  Lines         2460     2460           
  Branches       450      450           
========================================
  Hits          1970     1970           
  Misses         490      490           
Flag Coverage Δ
contracts 99.29% <ø> (ø)
core-utils 86.77% <ø> (ø)
data-transport-layer 49.72% <ø> (ø)
sdk 55.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 779709f...3cd8d0b. Read the comment docs.

Overhauls the contract deployment process to use a simpler typed
deployment method. Removes the need for deployment bash scripts and
makes review of deployment configurations much easier.
The output is most easily viewable by opening the html file in your browser:

```shell
open ./coverage/index.html
Copy link
Contributor

Choose a reason for hiding this comment

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

open is a mac specific thing, one particular flavor of linux uses xdg-open

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'll fix this in another PR

@maurelian maurelian removed their request for review March 17, 2022 13:21
@@ -0,0 +1,23 @@
import { DeployConfig } from '../src/deploy-config'

Copy link
Collaborator

Choose a reason for hiding this comment

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

We'll have to add one of these for nightly, but we can do this later.

@mslipper
Copy link
Collaborator

Do we still have the ability to automatically set the chugsplash proxy owner? Without that capability, deployments get stuck during automated but non-CI builds like nightly.

Copy link
Collaborator

@mslipper mslipper left a comment

Choose a reason for hiding this comment

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

Approved conditionally on my above comment.

@smartcontracts
Copy link
Contributor Author

Do we still have the ability to automatically set the chugsplash proxy owner? Without that capability, deployments get stuck during automated but non-CI builds like nightly.

I haven't changed anything on that front. I think as long as you set the AUTOMATICALLY_TRANSFER_OWNERSHIP environment variable you should be fine.

@mslipper
Copy link
Collaborator

mslipper commented Mar 23, 2022

Great, then I'm happy to merge this if you are.

@mslipper mslipper merged commit 3b82da3 into develop Mar 23, 2022
@mslipper mslipper deleted the sc/ct-update-deploy branch March 23, 2022 19:36
Copy link
Contributor

@maurelian maurelian left a comment

Choose a reason for hiding this comment

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

I see that this was merged... but I had a question about the tags flag not being include in mainnet.ts.
If the point of these scripts is to make previous deployments reproducible, I think that's necessary.

Comment on lines +4 to +11
# Private key that will send deployment transactions
CONTRACTS_DEPLOYER_KEY=

# RPC URL connected to the L1 chain we're deploying to
CONTRACTS_RPC_URL=

# Your Etherscan API key for the L1 network
ETHERSCAN_API_KEY=
Copy link
Contributor

Choose a reason for hiding this comment

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

After a quick text search, I don't see any of these 3 values used anywhere outside the deleted bash scripts.

Can these be deleted? Where would these values now be specified? I don't see where that would be done in the deploy configs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, looks like they're already in hardhat.config.ts

--ovm-address-manager-owner 0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A \
--gasprice 150000000000 \
--num-deploy-confirmations 4 \
--tags upgrade \
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this --tags argument reflected in the mainnet.ts flag that replaces this. Should it be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ops Area: ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants