Skip to content

Commit

Permalink
Merge pull request #69 from ethereum-optimism/tip/pcw109550/deploy-co…
Browse files Browse the repository at this point in the history
…nfig-address

Stage 1.4 deployment preparation scripts and artifacts
  • Loading branch information
pcw109550 authored Jun 25, 2024
2 parents 722d74f + f14a3bb commit c06a13c
Show file tree
Hide file tree
Showing 11 changed files with 216 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deployments/addresses/op-mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"AnchorStateRegistryProxy": "0x18DAc71c228D1C32c99489B7323d441E1175e443",
"DelayedWETHProxy": "0xE497B094d6DbB3D5E4CaAc9a14696D7572588d14",
"PreimageOracle": "0xD326E10B8186e90F4E2adc5c13a2d0C137ee8b34"
}
5 changes: 5 additions & 0 deletions deployments/addresses/op-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"AnchorStateRegistryProxy": "0x218CD9489199F321E1177b56385d333c5B598629",
"DelayedWETHProxy": "0xF3D833949133e4E4D3551343494b34079598EA5a",
"PreimageOracle": "0x627F825CBd48c4102d36f287be71f4234426b9e4"
}
Empty file.
5 changes: 5 additions & 0 deletions deployments/anchor-state/op-mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"faultGameGenesisBlock": 121676215,
"faultGameGenesisOutputRoot": "0xb078eb196a3f39ab1ee9488c8eab766b9f86610a4b0460358343f64ab3b3bf30",
"faultGameAbsolutePrestate": "0x030cd49ed1c865166b54e0f9f1b37b38a11a3659233fd4ffc69e6fd792da55b7"
}
5 changes: 5 additions & 0 deletions deployments/anchor-state/op-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"faultGameGenesisBlock": 13575670,
"faultGameGenesisOutputRoot": "0x09c936758ad38eb03f2c1bce0b008dfc208e8c540695c3c0e5fd54022a6a2d1c",
"faultGameAbsolutePrestate": "0x0338dc64405def7e3b9ce8f5076b422a846d831832617d227f13baf219cb5406"
}
Empty file.
59 changes: 59 additions & 0 deletions deployments/deploy-config/op-mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"finalSystemOwner": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A",
"superchainConfigGuardian": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A",
"l1StartingBlockTag": "0x438335a20d98863a4c0c97999eb2481921ccd28553eac6f913af7c12aec04108",
"l1ChainID": 1,
"l2ChainID": 10,
"l2BlockTime": 2,
"l1BlockTime": 12,
"maxSequencerDrift": 600,
"sequencerWindowSize": 3600,
"channelTimeout": 300,
"p2pSequencerAddress": "0xAAAA45d9549EDA09E70937013520214382Ffc4A2",
"batchInboxAddress": "0xff00000000000000000000000000000000000010",
"batchSenderAddress": "0x6887246668a3b87F54DeB3b94Ba47a6f63F32985",
"l2OutputOracleSubmissionInterval": 1800,
"l2OutputOracleStartingTimestamp": 1686068903,
"l2OutputOracleStartingBlockNumber": 105235063,
"l2OutputOracleProposer": "0x473300df21D047806A082244b417f96b32f13A33",
"l2OutputOracleChallenger": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A",
"finalizationPeriodSeconds": 604800,
"proxyAdminOwner": "0x7871d1187A97cbbE40710aC119AA3d412944e4Fe",
"baseFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"l1FeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"sequencerFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"enableGovernance": true,
"governanceTokenName": "Optimism",
"governanceTokenSymbol": "OP",
"governanceTokenOwner": "0x5C4e7Ba1E219E47948e6e3F55019A647bA501005",
"l2GenesisBlockGasLimit": "0x1c9c380",
"l2GenesisBlockBaseFeePerGas": "0x3b9aca00",
"gasPriceOracleBaseFeeScalar": 1368,
"gasPriceOracleBlobBaseFeeScalar": 810949,
"eip1559Denominator": 50,
"eip1559Elasticity": 6,
"l2GenesisRegolithTimeOffset": "0x0",
"systemConfigStartBlock": 17422444,
"requiredProtocolVersion": "0x0000000000000000000000000000000000000003000000010000000000000000",
"recommendedProtocolVersion": "0x0000000000000000000000000000000000000003000000010000000000000000",
"faultGameAbsolutePrestate": "0x030cd49ed1c865166b54e0f9f1b37b38a11a3659233fd4ffc69e6fd792da55b7",
"faultGameMaxDepth": 73,
"faultGameClockExtension": 10800,
"faultGameMaxClockDuration": 302400,
"faultGameGenesisBlock": 121676215,
"faultGameGenesisOutputRoot": "0xb078eb196a3f39ab1ee9488c8eab766b9f86610a4b0460358343f64ab3b3bf30",
"faultGameSplitDepth": 30,
"faultGameWithdrawalDelay": 604800,
"preimageOracleMinProposalSize": 126000,
"preimageOracleChallengePeriod": 86400,
"proofMaturityDelaySeconds": 604800,
"disputeGameFinalityDelaySeconds": 302400,
"respectedGameType": 0,
"useFaultProofs": true
}
58 changes: 58 additions & 0 deletions deployments/deploy-config/op-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"finalSystemOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"superchainConfigGuardian": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l1StartingBlockTag": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b",
"l1ChainID": 11155111,
"l2ChainID": 11155420,
"l2BlockTime": 2,
"l1BlockTime": 12,
"maxSequencerDrift": 600,
"sequencerWindowSize": 3600,
"channelTimeout": 300,
"p2pSequencerAddress": "0x57CACBB0d30b01eb2462e5dC940c161aff3230D3",
"batchInboxAddress": "0xff00000000000000000000000000000011155420",
"batchSenderAddress": "0x8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c",
"l2OutputOracleSubmissionInterval": 120,
"l2OutputOracleStartingBlockNumber": 0,
"l2OutputOracleStartingTimestamp": 1690493568,
"l2OutputOracleProposer": "0x49277EE36A024120Ee218127354c4a3591dc90A9",
"l2OutputOracleChallenger": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"finalizationPeriodSeconds": 12,
"proxyAdminOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"baseFeeVaultRecipient": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l1FeeVaultRecipient": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"sequencerFeeVaultRecipient": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"enableGovernance": true,
"governanceTokenSymbol": "OP",
"governanceTokenName": "Optimism",
"governanceTokenOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l2GenesisBlockGasLimit": "0x1c9c380",
"l2GenesisBlockBaseFeePerGas": "0x3b9aca00",
"eip1559Denominator": 50,
"eip1559Elasticity": 6,
"l2GenesisRegolithTimeOffset": "0x0",
"systemConfigStartBlock": 4071248,
"requiredProtocolVersion": "0x0000000000000000000000000000000000000004000000000000000000000001",
"recommendedProtocolVersion": "0x0000000000000000000000000000000000000004000000000000000000000001",
"fundDevAccounts": false,
"faultGameAbsolutePrestate": "0x0338dc64405def7e3b9ce8f5076b422a846d831832617d227f13baf219cb5406",
"faultGameMaxDepth": 73,
"faultGameClockExtension": 10800,
"faultGameMaxClockDuration": 302400,
"faultGameGenesisBlock": 13575670,
"faultGameGenesisOutputRoot": "0x09c936758ad38eb03f2c1bce0b008dfc208e8c540695c3c0e5fd54022a6a2d1c",
"faultGameSplitDepth": 30,
"faultGameWithdrawalDelay": 604800,
"preimageOracleMinProposalSize": 126000,
"preimageOracleChallengePeriod": 86400,
"proofMaturityDelaySeconds": 604800,
"disputeGameFinalityDelaySeconds": 302400,
"respectedGameType": 0,
"useFaultProofs": true
}
8 changes: 8 additions & 0 deletions deployments/fault-proof-program-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"op-sepolia": {
"op-program": "1.1.0"
},
"op-mainnet": {
"op-program": "1.0.0"
}
}
36 changes: 36 additions & 0 deletions deployments/init_anchor_state.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -e

TARGET_L1_RPC_URL="${TARGET_L1_RPC_URL:-"http://localhost:8545"}"

if [ -z "$1" ]; then
echo "Usage: $0 <network-name>"
exit 1
fi

output_root=$(cast call $(jq -r .AnchorStateRegistryProxy addresses/$1.json) --rpc-url $TARGET_L1_RPC_URL "anchors(uint32)(bytes32,uint256)" 0 --block finalized)

fault_game_genesis_output_root=$(echo "$output_root" | sed -n '1p')
fault_game_genesis_block=$(echo "$output_root" | sed -n '2p' | awk '{print $1}')

echo "network: $1"
echo "faultGameGenesisBlock: $fault_game_genesis_block"
echo "faultGameGenesisOutputRoot: $fault_game_genesis_output_root"

fault_proof_program=op-program
fault_proof_program_version=$(jq -r --arg program $fault_proof_program --arg network $1 '.[$network][$program]' fault-proof-program-version.json)
fault_game_absolute_prestate=$(jq -r --arg program $fault_proof_program --arg version $fault_proof_program_version '.[$program][$version]' ../prestates.json)

if [ -z "$fault_game_absolute_prestate" ] || [ "$fault_game_absolute_prestate" == "null" ]; then
echo "Error: faultGameAbsolutePrestate is null or not found."
exit 1
fi

echo "fault proof program with version: $fault_proof_program $fault_proof_program_version"
echo "faultGameAbsolutePrestate: $fault_game_absolute_prestate"

jq -n --arg fault_game_genesis_block $fault_game_genesis_block \
--arg fault_game_genesis_output_root $fault_game_genesis_output_root \
--arg fault_game_absolute_prestate $fault_game_absolute_prestate \
'{faultGameGenesisBlock: ($fault_game_genesis_block | tonumber), faultGameGenesisOutputRoot: $fault_game_genesis_output_root, faultGameAbsolutePrestate: $fault_game_absolute_prestate}' \
> anchor-state/$1.json
35 changes: 35 additions & 0 deletions deployments/init_deploy_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -e

if [ -z "$1" ]; then
echo "Usage: $0 <network-name>"
exit 1
fi

l2=$(echo "$1" | cut -d"-" -f1)
l1=$(echo "$1" | cut -d"-" -f2)

input_file="../rvsol/lib/optimism/packages/contracts-bedrock/deploy-config/$l1.json"
output_file="deploy-config/$1.json"

if [ ! -f "$input_file" ]; then
echo "Deploy config: $l1.json does not exist at monorepo."
exit 1
fi

fault_game_genesis_output_root=$(jq -r .faultGameGenesisOutputRoot anchor-state/$1.json)
fault_game_genesis_block=$(jq -r .faultGameGenesisBlock anchor-state/$1.json)
fault_game_absolute_prestate=$(jq -r .faultGameAbsolutePrestate anchor-state/$1.json)

set_key_value() {
jq --arg key "$1" --arg value "$2" '.[$key] = (try ($value | tonumber) catch $value)'
}

output_file_content=$(cat "$input_file")

output_file_content=$(echo "$output_file_content" | set_key_value "faultGameGenesisOutputRoot" $fault_game_genesis_output_root )
output_file_content=$(echo "$output_file_content" | set_key_value "faultGameAbsolutePrestate" $fault_game_absolute_prestate )
output_file_content=$(echo "$output_file_content" | set_key_value "faultGameGenesisBlock" $fault_game_genesis_block )

echo "$output_file_content" > "$output_file"
echo "Asterisc deployment config for $1 saved to $output_file"

0 comments on commit c06a13c

Please sign in to comment.