diff --git a/contrib/launchtools/README.md b/contrib/launchtools/README.md index 2aed6ba..ed3b0a2 100644 --- a/contrib/launchtools/README.md +++ b/contrib/launchtools/README.md @@ -45,6 +45,9 @@ minitiad launch $TARGET_NETWORK --with-config [path-to-config] "enable_oracle": true }, "system_keys": { + "admin": { + "l2_address": "init12z54lfqgp7zapzuuk2m4h6mjz84qzca8j0wm4x" + }, "validator": { "l2_address": "init12z54lfqgp7zapzuuk2m4h6mjz84qzca8j0wm4x", "mnemonic": "digital kingdom slim fall cereal aspect expose trade once antique treat spatial unfair trip silver diesel other friend invest valve human blouse decrease salt" diff --git a/contrib/launchtools/config.go b/contrib/launchtools/config.go index 2d39015..4fdabc8 100644 --- a/contrib/launchtools/config.go +++ b/contrib/launchtools/config.go @@ -339,6 +339,7 @@ func (gas *GenesisAccounts) Finalize(systemKeys SystemKeys) error { } type SystemKeys struct { + Admin *SystemAccount `json:"admin,omitempty"` Validator *SystemAccount `json:"validator,omitempty"` BridgeExecutor *SystemAccount `json:"bridge_executor,omitempty"` OutputSubmitter *SystemAccount `json:"output_submitter,omitempty"` @@ -463,8 +464,19 @@ func (systemKeys *SystemKeys) Finalize(buf *bufio.Reader, batchSubmissionTarget Mnemonic: mnemonic, } } + if systemKeys.Admin == nil { + // use validator account as admin account if not set + systemKeys.Admin = &SystemAccount{ + L1Address: systemKeys.Validator.L2Address, + L2Address: systemKeys.Validator.L2Address, + Mnemonic: systemKeys.Validator.Mnemonic, + } + } // validate all accounts + if systemKeys.Admin.L2Address == "" { + return errors.New("admin account not initialized") + } if systemKeys.Validator.L2Address == "" || systemKeys.Validator.Mnemonic == "" { return errors.New("validator account not initialized") } diff --git a/contrib/launchtools/steps/genesis.go b/contrib/launchtools/steps/genesis.go index d849c99..22f8935 100644 --- a/contrib/launchtools/steps/genesis.go +++ b/contrib/launchtools/steps/genesis.go @@ -166,14 +166,17 @@ func initializeGenesis( // Add fee whitelist to genesis // whitelist specific operators for fee exemption log.Info("adding fee whitelists", - "whitelist-len", 3, + "whitelist-len", 4, "whitelists", strings.Join([]string{ + config.SystemKeys.Admin.L2Address, config.SystemKeys.Validator.L2Address, config.SystemKeys.BridgeExecutor.L2Address, config.SystemKeys.Challenger.L2Address, }, ","), ) + opChildState, err = addFeeWhitelists(cdc, genesisAppState, []string{ + config.SystemKeys.Admin.L2Address, config.SystemKeys.Validator.L2Address, config.SystemKeys.BridgeExecutor.L2Address, config.SystemKeys.Challenger.L2Address, @@ -200,10 +203,10 @@ func initializeGenesis( // Step 5 ------------------------------------------------------------------------------------------- // Set admin address in the genesis parameter log.Info("setting admin address", - "admin", config.SystemKeys.Validator.L2Address, + "admin", config.SystemKeys.Admin.L2Address, ) - opChildState, err = setOpChildAdminAddress(cdc, genesisAppState, config.SystemKeys.Validator.L2Address) + opChildState, err = setOpChildAdminAddress(cdc, genesisAppState, config.SystemKeys.Admin.L2Address) if err != nil { return nil, errors.Wrap(err, "failed to set bridge executor address") }