The key differences that need to be considered are:
- RPC endpoints,
- Contract addresses,
- Chain IDs, and,
- The fee token.
The settings need to be changed in dozens of places, so the easiest way to tackle this is as a PR on top of the base system.
As the deployment proceeds, various new files will be generated, such as the state-dump
file which defines the intial state of the L2.
The first step is to test deploy our L1 base contracts on the new L1's testnet. If the deployment succeeds, that's already a good sign. A local copy of the L2 stack them can be connected to those contracts on the new chain. So, your computer will run the services and the L2, and those will be connected to the new L1's testnet.
File changes needed
The .env
needs four funded keys containing the new L1's fee token and rpc endpoint (process.env.L1_NODE_WEB3_URL
). Here are all the things we usually set (see docker-compose.yaml
):
FRAUD_PROOF_WINDOW_SECONDS: 0
L1_NODE_WEB3_URL: http://l1_chain:8545
<< : *deployer_pk
<< : *sequencer_pk
<< : *proposer_pk
<< : *relayer_pk
# setting the whitelist owner to address(0) disables the whitelist
WHITELIST_OWNER: "0x0000000000000000000000000000000000000000"
L2_CHAIN_ID: 31338
L2_BLOCK_GAS_LIMIT: 11000000
L1_FEE_WALLET_ADDRESS: "0x391716d440c151c42cdf1c95c1d83a5427bca52c"
BLOCK_SIGNER_ADDRESS: "0x00000398232E2064F896018496b4b44b3D62751F"
GAS_PRICE_ORACLE_OWNER: "0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199"
GAS_PRICE_ORACLE_OVERHEAD: "2750"
GAS_PRICE_ORACLE_SCALAR: "1500000"
GAS_PRICE_ORACLE_L1_BASE_FEE: "1"
GAS_PRICE_ORACLE_GAS_PRICE: "1000000000"
GAS_PRICE_ORACLE_DECIMALS: "6"
There are defaults in many places that relate to BOBA and ETH, which are proably not relevant to the new chain. Conceptulally, the new chain's native token will replace ETH, and BOBA is largely unchanged. So the things to do are:
- Set up four funded accounts and provide the keys to the
docker-compose.yaml
- Change the
L1_NODE_WEB3_URL
- for test/debuffing purposes, the
L2_CHAIN_ID
can be left at31338
, assuming you are running the stack locally - You also need the
L1_FEE_WALLET_ADDRESS
,BLOCK_SIGNER_ADDRESS
, andGAS_PRICE_ORACLE_OWNER
. Question - what do we normally do with those?
- Forgetting to change settings in the dozens of configurations files
- Changes in fees/gas
- Missing functionality from the "EVM-compatible" chains.
The key idea is that your local L2 will now write transactions into those new contracts on the new L1. The major issues there are address configuration.
For example, the SDK
stores key addresses in SDK\src\utils\contracts.ts
and the new chain needs to be added there - just follow the structure for the other chains.