diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index d3ddca09a7..a103f65a41 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -188,6 +188,11 @@ func localE2ETest(cmd *cobra.Command, _ []string) { if !skipSetup { logger.Print("⚙️ setting up networks") startTime := time.Now() + + if err := deployerRunner.EnableVerificationFlags(); err != nil { + panic(err) + } + deployerRunner.SetupEVM(contractsDeployed, true) deployerRunner.SetZEVMContracts() diff --git a/e2e/runner/setup_zeta.go b/e2e/runner/setup_zeta.go index 3789babf06..0de4693210 100644 --- a/e2e/runner/setup_zeta.go +++ b/e2e/runner/setup_zeta.go @@ -204,6 +204,13 @@ func (runner *E2ERunner) SetupBTCZRC20() { runner.BTCZRC20 = BTCZRC20 } +// EnableVerificationFlags enables the verification flags on ZetaChain +func (runner *E2ERunner) EnableVerificationFlags() error { + runner.Logger.Print("⚙️ enabling verification flags for block headers") + + return runner.ZetaTxServer.EnableVerificationFlags(e2eutils.FungibleAdminName) +} + // FundEmissionsPool funds the emissions pool on ZetaChain with the same value as used originally on mainnet (20M ZETA) func (runner *E2ERunner) FundEmissionsPool() error { runner.Logger.Print("⚙️ funding the emissions pool on ZetaChain with 20M ZETA (%s)", txserver.EmissionsPoolAddress) diff --git a/e2e/txserver/zeta_tx_server.go b/e2e/txserver/zeta_tx_server.go index f3d946ff5c..ebcdc6b24c 100644 --- a/e2e/txserver/zeta_tx_server.go +++ b/e2e/txserver/zeta_tx_server.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + lightclienttypes "github.com/zeta-chain/zetacore/x/lightclient/types" "math/big" "os" "strings" @@ -192,6 +193,27 @@ func (zts ZetaTxServer) BroadcastTx(account string, msg sdktypes.Msg) (*sdktypes return zts.clientCtx.BroadcastTx(txBytes) } +// EnableVerificationFlags enables the verification flags for the lightclient module +func (zts ZetaTxServer) EnableVerificationFlags(account string) error { + // retrieve account + acc, err := zts.clientCtx.Keyring.Key(account) + if err != nil { + return err + } + addr, err := acc.GetAddress() + if err != nil { + return err + } + + _, err = zts.BroadcastTx(account, lightclienttypes.NewMsgUpdateVerificationFlags( + addr.String(), + true, + true, + )) + + return err +} + // DeploySystemContractsAndZRC20 deploys the system contracts and ZRC20 contracts // returns the addresses of uniswap factory, router and erc20 zrc20 func (zts ZetaTxServer) DeploySystemContractsAndZRC20(account, erc20Addr string) (string, string, string, string, string, error) {