Sui.

Post

Share your knowledge.

Bounty+10

Peera Admin.
Mar 05, 2025
Expert Q&A

Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution

Developers working with Sui Move frequently encounter issues related to "Multiple source verification errors found" when attempting to publish or upgrade modules. These errors occur due to mismatches between local dependencies and their on-chain counterparts, leading to failed publications and deployment challenges. Below is a consolidated example of the errors developers face:

Failed to publish the Move module(s), reason: [warning] Multiple source verification errors found:
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::vec_set
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::vec_map
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000001::MoveStdlib::bit_vector
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000001::MoveStdlib::ascii
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::hex
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::zklogin_verified_id
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::prover
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::coin
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::dynamic_field
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::transfer
- On-chain version of dependency Sui::zklogin_verified_id was not found.
- On-chain version of dependency Sui::zklogin_verified_issuer was not found.
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::tx_context
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::transfer_policy
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::kiosk

This issue often arises due to:

  1. Mismatched versions between the local development environment (e.g., Sui CLI) and the on-chain state.
  2. Differences in package configurations across networks (e.g., Mainnet vs. Testnet).
  3. Missing or outdated dependencies in the on-chain environment.

Key Questions

  • How can we automate the detection and resolution of these dependency mismatches during the publication process?
  • What tools or scripts can be developed to ensure that local dependencies always align with their on-chain counterparts?
  • Is there a way to streamline this process by integrating dependency checks into existing CI/CD pipelines or enhancing the Sui SDK?

Your task is to propose a solution that addresses these challenges, ensuring smoother and more reliable deployments for Sui Move developers. Make sure to post your solution below.

  • Sui
  • SDKs and Developer Tools
4
5
Share
Comments
.

Answers

5
0xduckmove.
Mar 7 2025, 09:09

Let me explain the solution and how to solve the "Multiple source verification errors" you're encountering in Sui Move when publishing or upgrading modules. When you develop Sui Move modules locally, you specify dependencies in your Move.toml file, like this:

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui", subdir = "crates/sui-framework", rev = "some-revision" }

The rev field indicates the specific version (a branch, tag, or commit hash) of the Sui framework you’re using.

If this version doesn’t match what’s deployed on the blockchain for your target network, you’ll get verification errors during publication or upgrades. For example, the blockchain might be using an older version of Sui::vec_set than your local code, or a module like Sui::zklogin_verified_id might not be published on the network you’re targeting.

My solution is a Bash script that updates your Move.toml file with the correct revision of the Sui framework based on your target network and then verifies the setup by building your package. Save it as update-deps.sh in your project directory (where Move.toml is located).

#!/bin/bash

# Function to get the latest commit hash for the network-specific branch
get_latest_rev() {
    network=$1
    case $network in
        "testnet")
            branch="framework/testnet"
            ;;
        "devnet")
            branch="framework/devnet"
            ;;
        "mainnet")
            branch="main"
            ;;
        *)
            echo "Invalid network specified. Use 'testnet', 'devnet', or 'mainnet'."
            exit 1
            ;;
    esac
    # Fetch the latest commit hash from the specified branch
    rev=$(git ls-remote https://github.com/MystenLabs/sui $branch | cut -f1)
    if [ -z "$rev" ]; then
        echo "Failed to fetch revision for branch $branch."
        exit 1
    fi
    echo $rev
}

# Function to update Move.toml with the correct revision
update_move_toml() {
    network=$1
    rev=$(get_latest_rev $network)
    # Update the rev field in Move.toml for the Sui dependency
    sed -i "s/rev = .*/rev = \"$rev\"/" Move.toml
    echo "Updated Move.toml with rev = $rev for $network"
}

# Main function
main() {
    if [ $# -ne 1 ]; then
        echo "Usage: $0 <network> (e.g., testnet, devnet, mainnet)"
        exit 1
    fi
    network=$1
    update_move_toml $network
    # Attempt to build the package
    if ! sui move build; then
        echo "Build failed. Please check for missing dependencies or other issues."
    else
        echo "Build successful. You can now publish the package."
    fi
}

# Run the main function with provided arguments
main "$@"

You can run Run chmod +x update-deps.sh and execute it with your target network. like ./update-deps.sh testnet

So here is the out in your terminal:

harryphan@MacBook-Pro-2 hello % ./update-deps.sh testnet

Updated Move.toml with rev = 556b6e14896a09f95e7cf460bc8220a3bf997979 for testnet
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING hello
Build successful. You can now publish the package.
5
Best Answer
Comments
.
md rifat hossen.
Jun 19 2025, 17:22

My Answer (for +10 bounty):

To automatically avoid "Multiple source verification errors" in Sui Move module deployment, I recommend the following automated resolution workflow:


🛠️ Step-by-step Solution:

  1. Sync with On-chain Version

Before publishing, your Move.toml must match the exact framework revision used on the target network (Testnet, Devnet, or Mainnet).

Otherwise, dependency mismatches like Sui::vec_set or Sui::transfer_policy will cause publish failures.


  1. Use an Automation Script

Create a bash script named update-deps.sh that:

✅ Fetches the correct revision hash for the network ✅ Updates your Move.toml dependency ✅ Rebuilds your package to check compatibility

#!/bin/bash

get_latest_rev() { network=$1 case $network in "testnet") branch="framework/testnet" ;; "devnet") branch="framework/devnet" ;; "mainnet") branch="main" ;; *) echo "Invalid network! Use: testnet/devnet/mainnet"; exit 1 ;; esac

rev=$(git ls-remote https://github.com/MystenLabs/sui $branch | cut -f1) echo $rev }

update_move_toml() { rev=$(get_latest_rev $1) sed -i "s/rev = .*/rev = "$rev"/" Move.toml echo "✅ Updated Move.toml with rev = $rev" }

main() { [ $# -ne 1 ] && echo "Usage: $0 " && exit 1 update_move_toml $1 sui move build && echo "✅ Build successful. Ready to publish!" || echo "❌ Build failed. Check dependencies." }

main "$@"


✅ Usage:

chmod +x update-deps.sh ./update-deps.sh testnet

This ensures your local environment uses the exact Sui and MoveStdlib versions deployed on-chain.


🚀 Extra Tips:

CI/CD Integration: Add this script to your GitHub Actions workflow before sui move publish.

Error Logging: Log version mismatches to help detect upgrades faster.

Module Safety: Never change public struct fields or order in upgrades — Sui will reject them.


By automating dependency sync, you remove the #1 cause of module verification failure — and speed up production deployments.


Submitted by: md rifat hossen Let me know if you want this translated in Bangla or want a CI/CD YAML example also ✅

1
Comments
.
24p30p.
24p30p2032
Jul 9 2025, 03:59

Let me elucidate a robust method to resolve the "Multiple source verification errors" that developers frequently encounter when attempting to publish or upgrade Sui Move modules.

During Sui Move development, external dependencies are declared in the Move.toml manifest, typically structured as follows:

[dependencies] Sui = { git = "https://github.com/MystenLabs/sui", subdir = "crates/sui-framework", rev = "some-revision" }

The rev key specifies a precise commit hash, branch, or tag of the sui-framework repository to be used locally. However, complications arise when this local reference becomes misaligned with the canonical version deployed on the blockchain—resulting in source verification conflicts during deployment.

For instance, you may observe error messages such as:

Local dependency did not match its on-chain version at 0x2::Sui::coin On-chain version of dependency Sui::zklogin_verified_id was not found.

These discrepancies emerge due to divergence between the locally resolved bytecode and the on-chain deployed binaries. They can be attributed to:

  1. Inconsistent or outdated revisions in Move.toml

  2. Divergence between the developer’s environment and the target network’s deployment state (e.g., Mainnet, Testnet, Devnet)

  3. Use of modules locally that have not been instantiated on-chain yet

To mitigate this friction point, I propose an automated Bash utility titled update-deps.sh.

This script:

a. Determines the latest canonical revision hash of the Sui framework corresponding to the desired network.

b. Programmatically updates the rev field in Move.toml with the correct commit hash.

c. Validates the environment by invoking a local build via sui move build, preempting runtime publishing errors.

To do this, place this script within the root directory of your Move project:

#!/bin/bash

# Retrieve the most recent commit hash from the appropriate branch based on network context
get_latest_rev() {
    network=$1
    case $network in
        "testnet")
            branch="framework/testnet"
            ;;
        "devnet")
            branch="framework/devnet"
            ;;
        "mainnet")
            branch="main"
            ;;
        *)
            echo "Invalid network specified. Use 'testnet', 'devnet', or 'mainnet'."
            exit 1
            ;;
    esac
    rev=$(git ls-remote https://github.com/MystenLabs/sui $branch | cut -f1)
    if [ -z "$rev" ]; then
        echo "Failed to retrieve commit hash for branch $branch."
        exit 1
    fi
    echo $rev
}

# Apply the revision update to Move.toml
update_move_toml() {
    network=$1
    rev=$(get_latest_rev $network)
    sed -i "s/rev = .*/rev = \"$rev\"/" Move.toml
    echo "Move.toml updated with rev = $rev for network: $network"
}

# Entrypoint
main() {
    if [ $# -ne 1 ]; then
        echo "Usage: $0 <network> (e.g., testnet, devnet, mainnet)"
        exit 1
    fi
    network=$1
    update_move_toml $network
    # Attempt to compile the package
    if ! sui move build; then
        echo "Build failed. Please inspect for unresolved dependencies or other conflicts."
    else
        echo "Build succeeded. You are now primed for module publication."
    fi
}

main "$@"

Afterwards, grant executable permissions to the script chmod +x update-deps.sh and invoke the script by supplying your target deployment network `./update-deps.sh testnet.

Finally, your expected terminal output should look like this:

$ ./update-deps.sh testnet

Move.toml updated with rev = 556b6e14896a09f95e7cf460bc8220a3bf997979 for network: testnet
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING hello
Build succeeded. You are now primed for module publication.

1
Comments
.
d-podium.
Aug 15 2025, 02:32

Let me provide a comprehensive solution for automating dependency verification and resolution in Sui Move module publications:

Core Concepts

The solution revolves around three key components:

  1. Dependency State Management

    i. Local dependency tracking

    ii. On-chain state verification

    iii. Version comparison logic

  2. Automated Resolution

    i. Version synchronization

    ii. Missing dependency installation

    iii. Configuration validation

  3. Integration Framework

    i. CI/CD pipeline hooks

    ii. SDK extensions

    iii. Error reporting system

Implementation Details

Here's the core implementation that handles dependency verification and resolution:

// dependency-verifier.ts
import { SuiClient } from '@mysten/sui.js';
import { execSync } from 'child_process';

interface DependencyState {
  address: string;
  name: string;
  localVersion: string;
  onChainVersion: string;
  status: 'matched' | 'mismatched' | 'missing';
}

class DependencyVerifier {
  private client: SuiClient;
  private localDeps: Map<string, string>;
  private onChainDeps: Map<string, string>;

  constructor(network: string) {
    this.client = new SuiClient(network);
    this.localDeps = new Map();
    this.onChainDeps = new Map();
  }

  async verifyDependencies(): Promise<DependencyState[]> {
    await this.loadLocalDependencies();
    await this.loadOnChainDependencies();
    
    const results: DependencyState[] = [];
    
    for (const [address, localVersion] of this.localDeps) {
      const onChainVersion = this.onChainDeps.get(address);
      results.push({
        address,
        name: this.getDependencyName(address),
        localVersion,
        onChainVersion,
        status: this.determineStatus(localVersion, onChainVersion)
      });
    }
    
    return results;
  }

  private async resolveDependencies(results: DependencyState[]): Promise<void> {
    for (const dep of results) {
      if (dep.status === 'missing') {
        await this.installMissingDependency(dep.address);
      } else if (dep.status === 'mismatched') {
        await this.syncDependencyVersion(dep.address, dep.onChainVersion);
      }
    }
  }

  private determineStatus(local: string, onChain: string): DependencyState['status'] {
    if (!onChain) return 'missing';
    if (local !== onChain) return 'mismatched';
    return 'matched';
  }
}

CI/CD Integration

Here's how to integrate the verifier into your CI/CD pipeline:

# .github/workflows/dependency-check.yml
name: Dependency Verification
on:
  push:
    branches:
      - main
jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Dependencies
        run: npm install
      - name: Verify Dependencies
        run: npm run verify:dependencies
      - name: Publish
        if: success()
        run: sui move publish

SDK Integration

Extend the Sui SDK with dependency verification:

// sui-sdk-extensions.ts
import { SuiClient } from '@mysten/sui.js';
import { DependencyVerifier } from './dependency-verifier';

declare module '@mysten/sui.js' {
  interface SuiClient {
    verifyDependencies(): Promise<void>;
  }
}

SuiClient.prototype.verifyDependencies = async function() {
  const verifier = new DependencyVerifier(this.network);
  const results = await verifier.verifyDependencies();
  
  if (results.some(r => r.status !== 'matched')) {
    console.error('Dependency mismatches found:');
    results.forEach(r => {
      if (r.status !== 'matched') {
        console.error(`- ${r.name}: ${r.status}`);
      }
    });
    throw new Error('Dependency verification failed');
  }
};

Usage Example

// package.json scripts
{
  "scripts": {
    "verify:dependencies": "ts-node scripts/verify-dependencies.ts",
    "publish": "sui move publish",
    "publish:with-verify": "npm run verify:dependencies && npm run publish"
  }
}

Best Practices

  1. Version Management

    i. Use semantic versioning for all dependencies

    ii. Maintain version lock files

    iii. Document version requirements

  2. Error Handling

    i. Implement detailed error reporting

    ii. Provide clear resolution steps

    iii. Log dependency states for debugging

  3. Development Workflow

    i. Run verification before local testing

    ii. Use the CI pipeline for automated checks

    iii. Maintain consistent dependency versions across environments

0
Comments
.
BigDev.
Aug 15 2025, 16:31

Here’s how to explain and solve the “Multiple source verification errors” in Sui Move when publishing or upgrading:

These errors usually happen because your local Sui framework version (from Move.toml) doesn’t match what the target blockchain (Testnet, Devnet, Mainnet) is using. That mismatch leads to validation failures—especially if modules like Sui::vec_set or Sui::zklogin_verified_id aren’t present or differ in bytecode across versions.

To fix it, update the rev in your [dependencies] section to exactly match the revision deployed on-chain for the network you’re targeting. Instead of doing this manually, use the provided Bash script (update-deps.sh) to automate the process.

This script: • Pulls the latest commit hash from the right branch (framework/testnet, framework/devnet, or main). • Updates the rev value in Move.toml. • Builds the package using sui move build to confirm that the setup is valid.

Example Usage:

chmod +x update-deps.sh ./update-deps.sh testnet

You’ll get output like:

Updated Move.toml with rev = 556b6e14896a09f95e7cf460bc8220a3bf997979 for testnet
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING hello
Build successful. You can now publish the package.

This ensures your local build matches the chain’s runtime, avoiding source verification errors

0
Comments
.

Do you know the answer?

Please log in and share it.