Commit a8b31e71 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #6428 from ethereum-optimism/feat/sepolia-deployconfig

contracts-bedrock: deploy config for sepolia
parents b9864a4e 07a2457d
...@@ -188,7 +188,7 @@ func (d *DeployConfig) Copy() *DeployConfig { ...@@ -188,7 +188,7 @@ func (d *DeployConfig) Copy() *DeployConfig {
// Check will ensure that the config is sane and return an error when it is not // Check will ensure that the config is sane and return an error when it is not
func (d *DeployConfig) Check() error { func (d *DeployConfig) Check() error {
if d.L1StartingBlockTag == nil { if d.L1StartingBlockTag == nil {
return fmt.Errorf("%w: L2StartingBlockTag cannot be nil", ErrInvalidDeployConfig) return fmt.Errorf("%w: L1StartingBlockTag cannot be nil", ErrInvalidDeployConfig)
} }
if d.L1ChainID == 0 { if d.L1ChainID == 0 {
return fmt.Errorf("%w: L1ChainID cannot be 0", ErrInvalidDeployConfig) return fmt.Errorf("%w: L1ChainID cannot be 0", ErrInvalidDeployConfig)
......
...@@ -14,6 +14,7 @@ import ( ...@@ -14,6 +14,7 @@ import (
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum-optimism/optimism/op-bindings/hardhat" "github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
...@@ -132,10 +133,6 @@ var Subcommands = cli.Commands{ ...@@ -132,10 +133,6 @@ var Subcommands = cli.Commands{
if err := config.GetDeployedAddresses(hh); err != nil { if err := config.GetDeployedAddresses(hh); err != nil {
return err return err
} }
// Sanity check the config
if err := config.Check(); err != nil {
return err
}
client, err := ethclient.Dial(ctx.String("l1-rpc")) client, err := ethclient.Dial(ctx.String("l1-rpc"))
if err != nil { if err != nil {
...@@ -145,6 +142,8 @@ var Subcommands = cli.Commands{ ...@@ -145,6 +142,8 @@ var Subcommands = cli.Commands{
var l1StartBlock *types.Block var l1StartBlock *types.Block
if config.L1StartingBlockTag == nil { if config.L1StartingBlockTag == nil {
l1StartBlock, err = client.BlockByNumber(context.Background(), nil) l1StartBlock, err = client.BlockByNumber(context.Background(), nil)
tag := rpc.BlockNumberOrHashWithHash(l1StartBlock.Hash(), true)
config.L1StartingBlockTag = (*genesis.MarshalableRPCBlockNumberOrHash)(&tag)
} else if config.L1StartingBlockTag.BlockHash != nil { } else if config.L1StartingBlockTag.BlockHash != nil {
l1StartBlock, err = client.BlockByHash(context.Background(), *config.L1StartingBlockTag.BlockHash) l1StartBlock, err = client.BlockByHash(context.Background(), *config.L1StartingBlockTag.BlockHash)
} else if config.L1StartingBlockTag.BlockNumber != nil { } else if config.L1StartingBlockTag.BlockNumber != nil {
...@@ -153,6 +152,13 @@ var Subcommands = cli.Commands{ ...@@ -153,6 +152,13 @@ var Subcommands = cli.Commands{
if err != nil { if err != nil {
return fmt.Errorf("error getting l1 start block: %w", err) return fmt.Errorf("error getting l1 start block: %w", err)
} }
// Sanity check the config. Do this after filling in the L1StartingBlockTag
// if it is not defined.
if err := config.Check(); err != nil {
return err
}
log.Info("Using L1 Start Block", "number", l1StartBlock.Number(), "hash", l1StartBlock.Hash().Hex()) log.Info("Using L1 Start Block", "number", l1StartBlock.Number(), "hash", l1StartBlock.Hash().Hex())
// Build the developer L2 genesis block // Build the developer L2 genesis block
......
{ {
"numDeployConfirmations": 1,
"finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"portalGuardian": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "portalGuardian": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7", "l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7",
"l1ChainID": 5, "l1ChainID": 5,
"l2ChainID": 420, "l2ChainID": 420,
"l2BlockTime": 2, "l2BlockTime": 2,
"maxSequencerDrift": 600, "maxSequencerDrift": 600,
"sequencerWindowSize": 3600, "sequencerWindowSize": 3600,
"channelTimeout": 300, "channelTimeout": 300,
"p2pSequencerAddress": "0x715b7219D986641DF9eFd9C7Ef01218D528e19ec", "p2pSequencerAddress": "0x715b7219D986641DF9eFd9C7Ef01218D528e19ec",
"batchInboxAddress": "0xff00000000000000000000000000000000000420", "batchInboxAddress": "0xff00000000000000000000000000000000000420",
"batchSenderAddress": "0x7431310e026B69BFC676C0013E12A1A11411EEc9", "batchSenderAddress": "0x7431310e026B69BFC676C0013E12A1A11411EEc9",
"l2OutputOracleSubmissionInterval": 120, "l2OutputOracleSubmissionInterval": 120,
"l2OutputOracleStartingBlockNumber": 4061224, "l2OutputOracleStartingBlockNumber": 4061224,
"l2OutputOracleStartingTimestamp": 1673550516, "l2OutputOracleStartingTimestamp": 1673550516,
"l2OutputOracleProposer": "0x02b1786A85Ec3f71fBbBa46507780dB7cF9014f6", "l2OutputOracleProposer": "0x02b1786A85Ec3f71fBbBa46507780dB7cF9014f6",
"l2OutputOracleChallenger": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "l2OutputOracleChallenger": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"finalizationPeriodSeconds": 12, "finalizationPeriodSeconds": 12,
"proxyAdminOwner": "0xf80267194936da1E98dB10bcE06F3147D580a62e", "proxyAdminOwner": "0xf80267194936da1E98dB10bcE06F3147D580a62e",
"baseFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "baseFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"l1FeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "l1FeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"sequencerFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "sequencerFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", "baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", "l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", "sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0, "baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0, "l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0, "sequencerFeeVaultWithdrawalNetwork": 0,
"gasPriceOracleOverhead": 2100, "gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000, "gasPriceOracleScalar": 1000000,
"enableGovernance": true, "enableGovernance": true,
"governanceTokenSymbol": "OP", "governanceTokenSymbol": "OP",
"governanceTokenName": "Optimism", "governanceTokenName": "Optimism",
"governanceTokenOwner": "0x038a8825A3C3B0c08d52Cc76E5E361953Cf6Dc76", "governanceTokenOwner": "0x038a8825A3C3B0c08d52Cc76E5E361953Cf6Dc76",
"l2GenesisBlockGasLimit": "0x17D7840", "l2GenesisBlockGasLimit": "0x17D7840",
"l2GenesisBlockBaseFeePerGas": "0x3b9aca00", "l2GenesisBlockBaseFeePerGas": "0x3b9aca00",
"eip1559Denominator": 50, "eip1559Denominator": 50,
"eip1559Elasticity": 10 "eip1559Elasticity": 10
} }
{
"finalSystemOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"portalGuardian": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l1StartingBlockTag": "0x70e5634d09793b1cfaa7d0a2a5d3289a3b2308de1e82f682b4f817fc670f9797",
"l1ChainID": 11155111,
"l2ChainID": 11155420,
"l2BlockTime": 2,
"maxSequencerDrift": 600,
"sequencerWindowSize": 3600,
"channelTimeout": 300,
"p2pSequencerAddress": "0x715b7219D986641DF9eFd9C7Ef01218D528e19ec",
"batchInboxAddress": "0xff00000000000000000000000000000011155420",
"batchSenderAddress": "0x7431310e026B69BFC676C0013E12A1A11411EEc9",
"l2OutputOracleSubmissionInterval": 120,
"l2OutputOracleStartingBlockNumber": 0,
"l2OutputOracleStartingTimestamp": 0,
"l2OutputOracleProposer": "0x02b1786A85Ec3f71fBbBa46507780dB7cF9014f6",
"l2OutputOracleChallenger": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"finalizationPeriodSeconds": 12,
"proxyAdminOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"baseFeeVaultRecipient": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l1FeeVaultRecipient": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"sequencerFeeVaultRecipient": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"gasPriceOracleOverhead": 188,
"gasPriceOracleScalar": 684000,
"enableGovernance": true,
"governanceTokenSymbol": "OP",
"governanceTokenName": "Optimism",
"governanceTokenOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l2GenesisBlockGasLimit": "0x1c9c380",
"l2GenesisBlockBaseFeePerGas": "0x3b9aca00",
"eip1559Denominator": 50,
"eip1559Elasticity": 6,
"l2GenesisRegolithTimeOffset": "0x0"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
[profile.default] [profile.default]
src = 'src' src = 'src'
out = 'forge-artifacts' out = 'forge-artifacts'
script = 'scripts'
optimizer = true optimizer = true
optimizer_runs = 999999 optimizer_runs = 999999
script = 'scripts'
remappings = [ remappings = [
'@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts', '@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts',
......
...@@ -445,6 +445,10 @@ abstract contract Deployer is Script { ...@@ -445,6 +445,10 @@ abstract contract Deployer is Script {
return "devnetL1"; return "devnetL1";
} else if (chainid == 31337) { } else if (chainid == 31337) {
return "hardhat"; return "hardhat";
} else if (chainid == 11155111) {
return "sepolia";
} else if (chainid == 11155420) {
return "optimism-sepolia";
} else { } else {
return vm.toString(chainid); return vm.toString(chainid);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment