-
Notifications
You must be signed in to change notification settings - Fork 31
update to op stack v1.9.3 #100
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
base: master
Are you sure you want to change the base?
Changes from all commits
8672151
3e93bfd
f3e7381
2b2fbe3
e061187
a706486
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,10 +46,7 @@ def deploy_contracts_on_l1(config: Config, tmp_l1=False): | |
|
|
||
| # Copy the deploy config to where the deploy script can find it. | ||
| shutil.copy(config.deploy_config_path, config.op_deploy_config_path) | ||
| try: | ||
| _deploy_contracts_on_l1(config, tmp_l1) | ||
| finally: | ||
| os.remove(config.op_deploy_config_path) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we shouldn't delete this and pass the |
||
| _deploy_contracts_on_l1(config, tmp_l1) | ||
|
|
||
|
|
||
| def _deploy_contracts_on_l1(config: Config, tmp_l1: bool): | ||
|
|
@@ -110,14 +107,15 @@ def _deploy_contracts_on_l1(config: Config, tmp_l1: bool): | |
| create2_deployer_deploy_tx | ||
| ]) | ||
|
|
||
| deploy_script = "scripts/Deploy.s.sol:Deploy" | ||
| deploy_script = "scripts/deploy/Deploy.s.sol:Deploy" | ||
|
|
||
| log_file = f"{config.logs_dir}/deploy_l1_contracts.log" | ||
| print(f"Deploying contracts to L1 with {deployer_account}. Logging to {log_file}\n" | ||
| f"Using deploy salt: '{config.deploy_salt}'") | ||
|
|
||
| env = {**os.environ, | ||
| "DEPLOYMENT_CONTEXT": config.deployment_name, | ||
| "DEPLOYMENT_OUTFILE": config.op_rollup_l1_contracts_addresses_path, | ||
| "DEPLOY_CONFIG_PATH": config.op_deploy_config_path, | ||
| "ETH_RPC_URL": l1_rpc_url, | ||
| "IMPL_SALT": f"'{config.deploy_salt}'"} | ||
|
|
||
|
|
@@ -132,6 +130,7 @@ def _deploy_contracts_on_l1(config: Config, tmp_l1: bool): | |
| "deploy the L2 contracts on L1", [ | ||
| "forge script", | ||
| deploy_script, | ||
| "--sig", "'runWithStateDump()'", | ||
| "--sender", deployer_account, | ||
| private_key_arg, | ||
| f"--gas-estimate-multiplier {config.l1_deployment_gas_multiplier} " | ||
|
|
@@ -144,25 +143,12 @@ def _deploy_contracts_on_l1(config: Config, tmp_l1: bool): | |
| env=env, | ||
| log_file=log_file) | ||
|
|
||
| # copy now because the sync() invocation will delete the file | ||
| shutil.move(src=os.path.join(config.op_contracts_dir, | ||
| f'state-dump-{config.l1_chain_id}.json'), dst=config.l1_allocs_path) | ||
|
|
||
| shutil.copy(config.op_rollup_l1_contracts_addresses_path, | ||
| config.addresses_path) | ||
|
|
||
| log_file = f"{config.logs_dir}/create_l1_artifacts.log" | ||
| print(f"Creating L1 deployment artifacts. Logging to {log_file}") | ||
| lib.run_roll_log( | ||
| "create L1 deployment artifacts", [ | ||
| "forge script", | ||
| deploy_script, | ||
| "--sig 'sync()'", | ||
| f"--rpc-url {l1_rpc_url}", | ||
| ], | ||
| cwd=config.op_contracts_dir, | ||
| env=env, | ||
| log_file=log_file) | ||
|
|
||
| shutil.move(config.op_deployment_artifacts_dir, config.abi_dir) | ||
|
|
||
|
|
||
| #################################################################################################### | ||
|
|
||
|
|
@@ -173,18 +159,43 @@ def _generate_l2_genesis(config: Config): | |
| if os.path.exists(config.l2_genesis_path): | ||
| print("L2 genesis and rollup configs already generated.") | ||
| else: | ||
| print("Generating L2 genesis and rollup configs.") | ||
| print("Generating L2 genesis allocs.") | ||
| try: | ||
| log_file = f"{config.logs_dir}/generate_l2_genesis_allocs.log" | ||
| print('Generating L2 genesis allocs, with L1 addresses: '+config.addresses_path) | ||
| script = 'scripts/L2Genesis.s.sol:L2Genesis' | ||
| env = {**os.environ, | ||
| 'CONTRACT_ADDRESSES_PATH': config.addresses_path, | ||
| 'DEPLOY_CONFIG_PATH': config.op_deploy_config_path, } | ||
| lib.run_roll_log("generate l2 genesis allocs", [ | ||
| 'forge', 'script', script, "--sig", "'runWithAllUpgrades()'" | ||
| ], env=env, cwd=config.op_contracts_dir, | ||
| log_file=log_file) | ||
|
|
||
| # For each fork move the forge-dumps into place as .devnet allocs. | ||
| for suffix in ["-delta", "-ecotone", "-fjord", "-granite"]: | ||
| input_path = os.path.join(config.op_contracts_dir, | ||
| f"state-dump-{config.l2_chain_id}{suffix}.json") | ||
| output_path = os.path.join(config.artifacts_dir, f'allocs-l2{suffix}.json') | ||
| shutil.move(src=input_path, dst=output_path) | ||
| print("Generated L2 allocs: "+output_path) | ||
| except Exception as err: | ||
| raise lib.extend_exception( | ||
| err, prefix="Failed to generate L2 genesis and rollup configs: ") from None | ||
|
|
||
| print("Generating L2 genesis and rollup configs") | ||
| try: | ||
| lib.run( | ||
| "generate L2 genesis and rollup configs", [ | ||
| "go run cmd/main.go genesis l2", | ||
| f"--l1-rpc={config.l1_rpc_url}", | ||
| f"--deploy-config={config.deploy_config_path}", | ||
| f"--deployment-dir={config.abi_dir}", | ||
| f"--outfile.l2={config.l2_genesis_path}", | ||
| f"--outfile.rollup={config.rollup_config_path}" | ||
| ], | ||
| cwd=config.op_node_dir) | ||
| log_file = f"{config.logs_dir}/generate_l2_genesis.log" | ||
| l2_allocs_path = os.path.join(config.artifacts_dir, 'allocs-l2.json') | ||
| lib.run_roll_log("generate l2 genesis and rollup configs", [ | ||
| 'go', 'run', 'cmd/main.go', 'genesis', 'l2', | ||
| '--l1-rpc', 'http://localhost:8545', | ||
| '--deploy-config', config.deploy_config_path, | ||
| '--l2-allocs', l2_allocs_path, | ||
| '--l1-deployments', config.addresses_path, | ||
| '--outfile.l2', config.l2_genesis_path, | ||
| '--outfile.rollup', config.rollup_config_path | ||
| ], cwd=config.op_node_dir, log_file=log_file) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just checking if the last two invocations require rolling (i.e. if they emit a lot of output, or something we might want to save)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looking at the outputs, I think there is some potentially useful info here so doesn't hurt to save it imo |
||
| except Exception as err: | ||
| raise lib.extend_exception( | ||
| err, prefix="Failed to generate L2 genesis and rollup configs: ") from None | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| line-length = 110 | ||
|
|
||
| [lint.per-file-ignores] | ||
| "l1.py" = ["E402"] | ||
| "l1.py" = ["E402"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to this? Oh I see it's handled by the contracts now?