sui icon indicating copy to clipboard operation
sui copied to clipboard

Publish Error occurring when using sui::token

Open jojoo-eth opened this issue 1 year ago • 7 comments
trafficstars

Error occurring when i run:

sui client publish --gas-budget 100000000 --skip-dependency-verification

Error executing transaction: Failure {
    error: "VMVerificationOrDeserializationError in command 0",
}

However, when I no longer use the sui::token package, the error disappears.

Here is some infos about my envs:

❯ sui -V        
sui 1.17.3-ebcb58ff
[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", 
subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/mainnet" }

Move Code is the example in Sui repo: https://github.com/MystenLabs/sui/blob/mainnet/examples/move/token/sources/coffee.move

jojoo-eth avatar Feb 02 '24 15:02 jojoo-eth

I'm facing the same issue when I try to publish this module https://github.com/movemntdev/hyperlane-monorepo/blob/v3-sui/sui-move/isms/sources/multisig_ism.move

0xmovses avatar Feb 05 '24 15:02 0xmovses

I see you have --skip-dependency-verification enabled. What happens if you remove that flag?

tnowacki avatar Feb 05 '24 23:02 tnowacki

In my case, when I remove that flag I get this error:

Failed to publish the Move module(s), reason: [warning] Local version of dependency b5739c742bf153ab7f45a962da53cea2a0b88123f205f9c8346c3564a3c0615d::msg_utils was not found.

This may indicate that the on-chain version(s) of your package's dependencies may behave differently than the source version(s) your package was built against.

Fix this by rebuilding your packages with source versions matching on-chain versions of dependencies, or ignore this warning by re-running with the --skip-dependency-verification flag.

Even though this module which is the dependency, is published on testnet https://suiexplorer.com/object/0xb5739c742bf153ab7f45a962da53cea2a0b88123f205f9c8346c3564a3c0615d?network=testnet

The Move.toml for the module I'm trying to publish.

[package]
name = "HyperlaneISM"
version = "0.0.1"

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

[addresses]
hp_isms = "0x0"

[dependencies.HyperlaneLibrary]
local = "../library"

0xmovses avatar Feb 07 '24 13:02 0xmovses

@jojoo-eth, it is hard to know exactly what is wrong without seeing the result without the flag. But make sure you are specifying the correct rev for the chain you are publishing to, e.g. rev = "framework/testnet" instead of mainnet when publishing on testnet

@0xmovses it looks like your local code is different from what is on chain. So you might be using some new functionality from the local checkout that is not present on-chain, which is why the package fails on publish.

tnowacki avatar Feb 12 '24 17:02 tnowacki

I also had this problem and it was because the package I was depending on did not have it's original deploy address in the [addresses] field:

  • Bad ❌
[package]
name = "MyPackage"
edition = "2024.beta"
published-at = "0x00000000000000000000000000000V2"
version = "1.0.0"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.24.1" }

[addresses]
my_package = "0x0"
  • Good ✅
[package]
name = "MyPackage"
edition = "2024.beta"
published-at = "0x00000000000000000000000000000V2"
version = "1.0.0"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.24.1" }

[addresses]
my_package = "0x00000000000000000000000000000V1"

Usage

[package]
name = "MyApp"
edition = "2024.beta"
published-at = "0x0000000000000000000000000000000000FOO"
version = "1.0.0"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.24.1" }
MyPackage = { git = "https://github.com/foo/my-package.git", rev = "master" }

[addresses]
my_app = "0x0000000000000000000000000000000000FOO"

The use of 0x0 for upgrading is confusing and is explained more here: https://docs.sui.io/concepts/sui-move-concepts/packages/upgrade

ronanyeah avatar May 10 '24 17:05 ronanyeah

what if "MyPackage" published to both testnet and mainnet, how to specify addresses from different networks?

shiqicao avatar Jun 26 '24 22:06 shiqicao

@shiqicao we are releasing "Automated Address Management" to automatically manage addresses for a package that is published to different networks--keep an eye out in the release notes for when this is available!

rvantonder avatar Jun 28 '24 06:06 rvantonder

Automated address management is now (or very soon) available: https://docs.sui.io/concepts/sui-move-concepts/packages/automated-address-management

stefan-mysten avatar Jul 23 '24 21:07 stefan-mysten