Update optimism and contracts deployment script

This commit is contained in:
Prathamesh Musale 2024-04-26 16:12:51 +05:30
parent 999c211e24
commit e3589ddaa6
2 changed files with 12 additions and 28 deletions

View File

@ -65,7 +65,7 @@ if [ -n "$CERC_L1_ADDRESS" ] && [ -n "$CERC_L1_PRIV_KEY" ]; then
# Sequencer # Sequencer
SEQ=$(echo "$wallet3" | awk '/Address:/{print $2}') SEQ=$(echo "$wallet3" | awk '/Address:/{print $2}')
SEQ_KEY=$(echo "$wallet3" | awk '/Private key:/{print $3}') SEQ_KEY=$(echo "$wallet3" | awk '/Private key:/{print $3}')
echo "Funding accounts." echo "Funding accounts."
wait_for_block 1 300 wait_for_block 1 300
cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 5ether $PROPOSER --private-key $ADMIN_KEY cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 5ether $PROPOSER --private-key $ADMIN_KEY
@ -105,42 +105,26 @@ echo "$accounts_json" > "/l2-accounts/accounts.json"
echo "Checking L1 for finalized block..." echo "Checking L1 for finalized block..."
finalized=$(cast block finalized --rpc-url $CERC_L1_RPC | grep -E "(timestamp|hash|number)" || true) finalized=$(cast block finalized --rpc-url $CERC_L1_RPC | grep -E "(timestamp|hash|number)" || true)
if [ -n "$finalized" ]; then config_build_script="scripts/getting-started/config.sh"
# finalized block was found if [ -z "$finalized" ]; then
start_block=$finalized
else
# assume fresh chain and use block 1 instead # assume fresh chain and use block 1 instead
echo "No finalized block. Using block 1 instead." echo "No finalized block. Using block 1 instead."
# wait for 20 or so blocks to be safe # wait for 20 or so blocks to be safe
wait_for_block 24 300 wait_for_block 24 300
start_block=$(cast block 1 --rpc-url $CERC_L1_RPC | grep -E "(timestamp|hash|number)" || true)
# Replace how block is calculated in the config building script
sed -i 's/block=.*/block=$(cast block 1 --rpc-url $L1_RPC_URL)/g' $config_build_script
fi fi
if [ -z "$start_block" ]; then # Generate the deploy-config/getting-started.json file
echo "Unable to query chain for starting block. Exiting..." GS_ADMIN_ADDRESS=$ADMIN GS_BATCHER_ADDRESS=$BATCHER GS_PROPOSER_ADDRESS=$PROPOSER GS_SEQUENCER_ADDRESS=$SEQ L1_RPC_URL=$CERC_L1_RPC $config_build_script
exit 1
fi
BLOCKHASH=$(echo $start_block | awk -F ' ' '{print $2}')
HEIGHT=$(echo $start_block | awk -F ' ' '{print $4}')
TIMESTAMP=$(echo $start_block | awk -F ' ' '{print $6}')
echo "Using block as deployment point:"
echo "Height: $HEIGHT"
echo "Hash: $BLOCKHASH"
echo "Timestamp: $TIMESTAMP"
# Fill out the deployment template (./deploy-config/getting-started.json) with our values:
echo "Writing deployment config." echo "Writing deployment config."
deploy_config_file="deploy-config/$DEPLOYMENT_CONTEXT.json" deploy_config_file="deploy-config/$DEPLOYMENT_CONTEXT.json"
cp deploy-config/getting-started.json $deploy_config_file cp deploy-config/getting-started.json $deploy_config_file
# Replace chain id in the copied config
sed -i "s/\"l1ChainID\": .*/\"l1ChainID\": $DEPLOYMENT_CONTEXT,/g" $deploy_config_file sed -i "s/\"l1ChainID\": .*/\"l1ChainID\": $DEPLOYMENT_CONTEXT,/g" $deploy_config_file
sed -i "s/ADMIN/$ADMIN/g" $deploy_config_file
sed -i "s/PROPOSER/$PROPOSER/g" $deploy_config_file
sed -i "s/BATCHER/$BATCHER/g" $deploy_config_file
sed -i "s/SEQUENCER/$SEQ/g" $deploy_config_file
sed -i "s/BLOCKHASH/$BLOCKHASH/g" $deploy_config_file
sed -i "s/TIMESTAMP/$TIMESTAMP/g" $deploy_config_file
mkdir -p deployments/$DEPLOYMENT_CONTEXT mkdir -p deployments/$DEPLOYMENT_CONTEXT

View File

@ -8,8 +8,8 @@ repos:
- git.vdb.to/cerc-io/lighthouse - git.vdb.to/cerc-io/lighthouse
# L2 (optimism) # L2 (optimism)
- github.com/dboreham/foundry - github.com/dboreham/foundry
- github.com/ethereum-optimism/optimism@op-node/v1.3.0 - github.com/ethereum-optimism/optimism@v1.7.3
- github.com/ethereum-optimism/op-geth@v1.101304.0 - github.com/ethereum-optimism/op-geth@v1.101311.0
containers: containers:
# L1 (fixturenet-plugeth) # L1 (fixturenet-plugeth)
- cerc/plugeth-statediff - cerc/plugeth-statediff