-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix: Remove wait for finalization for create2 factory deployment #60
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f3c71df
fix: Remove wait for finalization for create2 factory deployment
clabby 062b2a9
update contracts deploy image
clabby d615fb4
Update src/contracts/contract_deployer.star
clabby 714579d
Merge branch 'main' into cl/finalized-wait-fix
barnabasbusa 0394066
Update Dockerfile
barnabasbusa 6ee71e5
fix lint
barnabasbusa d59b805
Update src/contracts/contract_deployer.star
barnabasbusa b8693e3
Update Dockerfile
barnabasbusa 2df25e5
Update Dockerfile
barnabasbusa cbcd21c
Merge branch 'cl/finalized-wait-fix' of github.com:clabby/optimism-pa…
barnabasbusa 789597d
fix img tag
barnabasbusa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
IMAGE = "ethpandaops/optimism-contract-deployer:latest" | ||
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. we prob want to ask PandaOps team to rebuild this 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. Would be able to rebuild, once the PR branch (cl/latest-getting-started) is merged in. |
||
IMAGE = "ethpandaops/optimism-contract-deployer:develop" | ||
|
||
ENVRC_PATH = "/workspace/optimism/.envrc" | ||
FACTORY_DEPLOYER_ADDRESS = "0x3fAB184622Dc19b6109349B94811493BF2a45362" | ||
|
@@ -16,31 +16,28 @@ def deploy_factory_contract( | |
): | ||
factory_deployment_result = plan.run_sh( | ||
name="op-deploy-factory-contract", | ||
description="Deploying L2 factory contract to L1 (needs to wait for l1 to finalize, about 4 min for minimal preset, 30 min for mainnet)", | ||
description="Deploying L2 factory contract to L1 (takes about a minute)", | ||
image=IMAGE, | ||
env_vars={ | ||
"WEB3_PRIVATE_KEY": str(priv_key), | ||
"FUND_VALUE": "10", | ||
"PRIVATE_KEY": str(priv_key), | ||
"FUND_VALUE": "10ether", | ||
"DEPLOY_CONFIG_PATH": "/workspace/optimism/packages/contracts-bedrock/deploy-config/getting-started.json", | ||
"DEPLOYMENT_CONTEXT": "getting-started", | ||
} | ||
| l1_config_env_vars, | ||
run=" && ".join( | ||
[ | ||
"web3 transfer $FUND_VALUE to {0}".format(FACTORY_DEPLOYER_ADDRESS), | ||
"sleep 3", | ||
"while true; do sleep 1; echo 'L1 Chain is starting up'; if [ \"$(curl -s $CL_RPC_URL/eth/v1/beacon/headers/ | jq -r '.data[0].header.message.slot')\" != \"0\" ]; then echo 'L1 Chain has started!'; break; fi; done", | ||
"cast send {0} --value $FUND_VALUE --rpc-url $L1_RPC_URL --private-key $PRIVATE_KEY".format( | ||
FACTORY_DEPLOYER_ADDRESS | ||
), | ||
"if [ $(cast codesize {0} --rpc-url $L1_RPC_URL) -gt 0 ]; then echo 'Factory contract already deployed!'; exit 0; fi".format( | ||
FACTORY_ADDRESS | ||
), | ||
# sleep till chain is finalized | ||
"while true; do sleep 3; echo 'Chain is not yet finalized...'; if [ \"$(curl -s $CL_RPC_URL/eth/v1/beacon/states/head/finality_checkpoints | jq -r '.data.finalized.epoch')\" != \"0\" ]; then echo 'Chain is finalized!'; break; fi; done", | ||
"cast publish --rpc-url $L1_RPC_URL {0}".format(FACTORY_DEPLOYER_CODE), | ||
"while true; do sleep 3; echo 'Factory code is not yet deployed...'; if [ $(cast codesize {0} --rpc-url $L1_RPC_URL) -gt 0 ]; then echo 'Factory contract already deployed!'; break; fi; done".format( | ||
FACTORY_ADDRESS | ||
), | ||
] | ||
), | ||
wait="2000s", | ||
wait="300s", | ||
) | ||
|
||
|
||
|
@@ -61,8 +58,8 @@ def deploy_l2_contracts( | |
description="Deploying L2 contracts (takes about a minute)", | ||
image=IMAGE, | ||
env_vars={ | ||
"WEB3_PRIVATE_KEY": str(priv_key), | ||
"FUND_VALUE": "10", | ||
"PRIVATE_KEY": str(priv_key), | ||
"FUND_VALUE": "10ether", | ||
"DEPLOY_CONFIG_PATH": "/workspace/optimism/packages/contracts-bedrock/deploy-config/getting-started.json", | ||
"DEPLOYMENT_CONTEXT": "getting-started", | ||
} | ||
|
@@ -87,19 +84,13 @@ def deploy_l2_contracts( | |
), | ||
". {0}".format(ENVRC_PATH), | ||
"mkdir -p /network-configs", | ||
"web3 transfer $FUND_VALUE to $GS_ADMIN_ADDRESS", # Fund Admin | ||
"sleep 3", | ||
"web3 transfer $FUND_VALUE to $GS_BATCHER_ADDRESS", # Fund Batcher | ||
"sleep 3", | ||
"web3 transfer $FUND_VALUE to $GS_PROPOSER_ADDRESS", # Fund Proposer | ||
"sleep 3", | ||
"cast send $GS_ADMIN_ADDRESS --value $FUND_VALUE --private-key $PRIVATE_KEY --rpc-url $L1_RPC_URL", # Fund Admin | ||
"cast send $GS_BATCHER_ADDRESS --value $FUND_VALUE --private-key $PRIVATE_KEY --rpc-url $L1_RPC_URL", # Fund Batcher | ||
"cast send $GS_PROPOSER_ADDRESS --value $FUND_VALUE --private-key $PRIVATE_KEY --rpc-url $L1_RPC_URL", # Fund Proposer | ||
"cd /workspace/optimism/packages/contracts-bedrock", | ||
"./scripts/getting-started/config.sh", | ||
'jq \'. + {"fundDevAccounts": true, "useInterop": true}\' $DEPLOY_CONFIG_PATH > tmp.$$.json && mv tmp.$$.json $DEPLOY_CONFIG_PATH', | ||
# sleep till gs_admin_address is funded | ||
"while true; do sleep 1; echo 'GS_ADMIN_ADDRESS is not yet funded...'; if [ \"$(web3 balance $GS_ADMIN_ADDRESS)\" != \"0\" ]; then echo 'GS_ADMIN_ADDRESS is funded!'; break; fi; done", | ||
"forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL", | ||
"sleep 3", | ||
"forge script scripts/deploy/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL", | ||
"CONTRACT_ADDRESSES_PATH=$DEPLOYMENT_OUTFILE forge script scripts/L2Genesis.s.sol:L2Genesis --sig 'runWithStateDump()' --chain-id $L2_CHAIN_ID", | ||
"cd /workspace/optimism/op-node/bin", | ||
"./op-node genesis l2 \ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
gud, this installation has occasionally failed for my setup
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.
oh really?