Skip to content

Commit

Permalink
deploy slowly
Browse files Browse the repository at this point in the history
  • Loading branch information
norswap committed Sep 26, 2023
1 parent 07dbbad commit 29a103f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os.path

from paths import OPPaths
import libroll as lib

# Summary on default port mapping:
#
Expand Down Expand Up @@ -45,7 +46,6 @@
class Config:

def __init__(self, paths: OPPaths = None):

# ==========================================================================================
# Paths (General)

Expand Down Expand Up @@ -188,6 +188,15 @@ def __init__(self, paths: OPPaths = None):
default, which is the Foundry default).
"""

self.deploy_slowly = lib.args.preset == "prod"
"""
Whether to deploy contracts "slowly", i.e. wait for each transaction to succeed before
submitting the next one. This is recommended for production deployments, since RPC nodes
can be capricious and don't react kindly to getting 30+ transactions at once.
Defaults to True when the `--preset=prod` is passed, False otherwise.
"""

# ==========================================================================================
# Governance

Expand Down Expand Up @@ -736,7 +745,7 @@ def l2_engine_chaindata_dir(self):
"""Directory storing chain data for the L2 engine."""
return os.path.join(self.l2_engine_data_dir, "geth", "chaindata")

# ==============================================================================================
# ==============================================================================================

def validate(self):
"""
Expand Down Expand Up @@ -903,5 +912,4 @@ def production_config(paths: OPPaths):
config.use_production_config()
return config


####################################################################################################
4 changes: 2 additions & 2 deletions l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ def deploy_l1_contracts(config: Config):

log_file = "logs/deploy_l1_contracts.log"
print(f"Deploying contracts to L1. Logging to {log_file}")
slow = "--slow" if config.deploy_slowly else ""
lib.run_roll_log(
"deploy contracts",
f"forge script {deploy_script} --private-key {config.contract_deployer_key} "
f"--gas-estimate-multiplier {config.l1_deployment_gas_multiplier} "
f"--rpc-url {config.l1_rpc} --broadcast",
f"--rpc-url {config.l1_rpc} --broadcast {slow}",
cwd=config.paths.contracts_dir,
env=env,
log_file=log_file)
Expand Down Expand Up @@ -335,5 +336,4 @@ def clean(config: Config):
shutil.rmtree(config.deployments_dir, ignore_errors=True)



####################################################################################################

0 comments on commit 29a103f

Please sign in to comment.