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

@ -105,42 +105,26 @@ echo "$accounts_json" > "/l2-accounts/accounts.json"
echo "Checking L1 for finalized block..."
finalized=$(cast block finalized --rpc-url $CERC_L1_RPC | grep -E "(timestamp|hash|number)" || true)
if [ -n "$finalized" ]; then
# finalized block was found
start_block=$finalized
else
config_build_script="scripts/getting-started/config.sh"
if [ -z "$finalized" ]; then
# assume fresh chain and use block 1 instead
echo "No finalized block. Using block 1 instead."
# wait for 20 or so blocks to be safe
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
if [ -z "$start_block" ]; then
echo "Unable to query chain for starting block. Exiting..."
exit 1
fi
# Generate the deploy-config/getting-started.json file
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
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."
deploy_config_file="deploy-config/$DEPLOYMENT_CONTEXT.json"
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/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

View File

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