[PASSED] OP-PIP-89: Upgrade Lazer Contract on Sui (testnet)

Abstract
Perform an test upgrade on a testnet deployment of Sui Lazer contract to ensure that the process works correctly.
The update itself only changes the included version number - goal is to test whether the contract can successfully execute governance action.

Rationale
Sui Lazer contract only allows maintenance through Wormhole’s Verified Action Approvals (VAAs) tied to specific emitter address and chain. We’ve tested the process with dummy emitter tied to ordinary wallet, but this flow doesn’t test implementation of proposal submitting and execution.

Description
Proposal should emit a single Wormhole message targeted to Sui chain, with update version 2 and digest of build of current version of the contract, with slight modification (see below), available after this commit in pyth-crosschain repository: https://github.com/pyth-network/pyth-crosschain/commit/d6dd7841edfd9fd4925b3b5477aa28c212968133

Implementation plan

Proposal verification

  • Install pnpm, jq and suiup

  • Install latest testnet version of Sui tools through command line:

suiup install sui
  • Clone the pyth-crosschain repository and build contract_manager:
git clone https://github.com/pyth-network/pyth-crosschain.git
cd pyth-crosschain/contract_manager
pnpm install && pnpm turbo build
  • Modify pyth-crosschain/lazer/contracts/sui/sources/pyth_lazer.move by appending the following lines (used to avoid accidental use of this proposal on mainnet):

public struct ThisIsATestContractMeantForTestnetOnly {}
  • Temporarily modify the pyth-crosschain/contract_manager/check_proposal.ts script to check the testnet contract instead of a mainnet one:
@@ -248,7 +248,7 @@ async function main() {
         console.log(`Verifying UpgradeSuiLazerContract on '${targetChainId}'`);

         if (targetChainId === "sui") {
-          const chain = DefaultStore.chains.sui_mainnet;
+          const chain = DefaultStore.chains.sui_testnet;

           if (!(chain instanceof SuiChain)) {
             console.error("Could not find valid Sui mainnet chain in store");
@@ -260,9 +260,13 @@ async function main() {
             "../../lazer/contracts/sui",
           );

-          const contracts = Object.values(DefaultStore.lazer_contracts)
-            .filter((c) => c instanceof SuiLazerContract)
-            .filter((c) => c.chain.isMainnet());
+          const contracts = [
+            new SuiLazerContract(
+              chain,
+              "0x219e26647e9e54d3915f82aeeabfbd1f008929c60ca12181a5eb5e3236848db3",
+              "31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790",
+            ),
+          ];

           if (contracts.length === 0) {
             console.error("Could not find valid Sui Lazer contract in store");
  • Within pyth-crosschain/contract_manager directory, run the check_proposal script:
pnpm tsx scripts/check_proposal.ts --cluster mainnet-beta --proposal 8tLtUiWjJ4jn8u4RwDuHjqBc3L6wLwhQC8iXDfT2FSq2
1 Like