Commit c201aeba authored by Mark Tyneway's avatar Mark Tyneway

contracts: add in berlin hardfork config

The hardfork block will need to be determined
and the genesis json file will need to be
recreated. This will by default set the
height to 0 so that the development
networks start with berlin activated.
parent 9c03b7ae
---
'@eth-optimism/contracts': patch
---
Add berlin hardfork config to genesis creation
...@@ -63,6 +63,8 @@ import { makeL2GenesisFile } from '../src/make-genesis' ...@@ -63,6 +63,8 @@ import { makeL2GenesisFile } from '../src/make-genesis'
const l1FeeWalletAddress = env.L1_FEE_WALLET_ADDRESS const l1FeeWalletAddress = env.L1_FEE_WALLET_ADDRESS
// The L1 cross domain messenger address, used for cross domain messaging // The L1 cross domain messenger address, used for cross domain messaging
const l1CrossDomainMessengerAddress = env.L1_CROSS_DOMAIN_MESSENGER_ADDRESS const l1CrossDomainMessengerAddress = env.L1_CROSS_DOMAIN_MESSENGER_ADDRESS
// The block height at which the berlin hardfork activates
const berlinBlock = parseInt(env.BERLIN_BLOCK, 10) || 0
ensure(whitelistOwner, 'WHITELIST_OWNER') ensure(whitelistOwner, 'WHITELIST_OWNER')
ensure(gasPriceOracleOwner, 'GAS_PRICE_ORACLE_OWNER') ensure(gasPriceOracleOwner, 'GAS_PRICE_ORACLE_OWNER')
...@@ -72,6 +74,7 @@ import { makeL2GenesisFile } from '../src/make-genesis' ...@@ -72,6 +74,7 @@ import { makeL2GenesisFile } from '../src/make-genesis'
ensure(l1StandardBridgeAddress, 'L1_STANDARD_BRIDGE_ADDRESS') ensure(l1StandardBridgeAddress, 'L1_STANDARD_BRIDGE_ADDRESS')
ensure(l1FeeWalletAddress, 'L1_FEE_WALLET_ADDRESS') ensure(l1FeeWalletAddress, 'L1_FEE_WALLET_ADDRESS')
ensure(l1CrossDomainMessengerAddress, 'L1_CROSS_DOMAIN_MESSENGER_ADDRESS') ensure(l1CrossDomainMessengerAddress, 'L1_CROSS_DOMAIN_MESSENGER_ADDRESS')
ensure(berlinBlock, 'BERLIN_BLOCK')
// Basic warning so users know that the whitelist will be disabled if the owner is the zero address. // Basic warning so users know that the whitelist will be disabled if the owner is the zero address.
if (env.WHITELIST_OWNER === '0x' + '00'.repeat(20)) { if (env.WHITELIST_OWNER === '0x' + '00'.repeat(20)) {
...@@ -94,6 +97,7 @@ import { makeL2GenesisFile } from '../src/make-genesis' ...@@ -94,6 +97,7 @@ import { makeL2GenesisFile } from '../src/make-genesis'
l1StandardBridgeAddress, l1StandardBridgeAddress,
l1FeeWalletAddress, l1FeeWalletAddress,
l1CrossDomainMessengerAddress, l1CrossDomainMessengerAddress,
berlinBlock,
}) })
fs.writeFileSync(outfile, JSON.stringify(genesis, null, 4)) fs.writeFileSync(outfile, JSON.stringify(genesis, null, 4))
......
...@@ -39,6 +39,8 @@ export interface RollupDeployConfig { ...@@ -39,6 +39,8 @@ export interface RollupDeployConfig {
l1FeeWalletAddress: string l1FeeWalletAddress: string
// Address of the L1CrossDomainMessenger contract. // Address of the L1CrossDomainMessenger contract.
l1CrossDomainMessengerAddress: string l1CrossDomainMessengerAddress: string
// Block height to activate berlin hardfork
berlinBlock: number
} }
/** /**
...@@ -149,6 +151,7 @@ export const makeL2GenesisFile = async ( ...@@ -149,6 +151,7 @@ export const makeL2GenesisFile = async (
petersburgBlock: 0, petersburgBlock: 0,
istanbulBlock: 0, istanbulBlock: 0,
muirGlacierBlock: 0, muirGlacierBlock: 0,
berlinBlock: cfg.berlinBlock,
clique: { clique: {
period: 0, period: 0,
epoch: 30000, epoch: 30000,
......
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