movementlabsxyz / movement

The Movement Network is a Move-based L2 on Ethereum.
Apache License 2.0
74 stars 61 forks source link

Deployment Fails with Code Deserialization Error #770

Open Aladeenb opened 1 week ago

Aladeenb commented 1 week ago

Describe the bug Attempts to publish or upgrade a Move package on Porto Testnet result in deserialization failure (CODE_DESERIALIZATION_ERROR).

To Reproduce

  1. Initialize a Move project: aptos move init
  2. add a module
  3. Publish the package using aptos move publish or deploy via object.
{
  "Error": "Simulation failed with status: CODE_DESERIALIZATION_ERROR\nExecution failed with message: Backtrace: Backtrace [\n    { fn: \"move_binary_format::errors::PartialVMError::finish\" },\n    { fn: \"aptos_vm::aptos_vm::AptosVM::deserialize_module_bundle\" },\n    { fn: \"aptos_vm::aptos_vm::AptosVM::resolve_pending_code_publish\" },\n    { fn: \"aptos_vm::aptos_vm::AptosVM::execute_script_or_entry_function\" },\n    { fn: \"aptos_vm::aptos_vm::AptosSimulationVM::create_vm_and_simulate_signed_transaction\" },\n    { fn: \"aptos_api::transactions::TransactionsApi::simulate\" },\n    { fn: \"aptos_api::transactions::TransactionsApi::simulate_transaction::{{closure}}::{{closure}}\" },\n    { fn: \"<tracing::instrument::Instrumented<T> as core::future::future::Future>::poll\" },\n    { fn: \"tokio::runtime::task::core::Core<T,S>::poll\" },\n    { fn: \"tokio::runtime::task::harness::Harness<T,S>::poll\" },\n    { fn: \"tokio::runtime::blocking::pool::Inner::run\" },\n    { fn: \"std::sys_common::backtrace::__rust_begin_short_backtrace\" },\n    { fn: \"core::ops::function::FnOnce::call_once{{vtable.shim}}\" },\n    { fn: \"std::sys::pal::unix::thread::Thread::new::thread_start\" },\n    { fn: \"start_thread\" },\n    { fn: \"__GI___clone\" },\n]"
}

Expected behavior The package should deploy successfully, as it does on Aptos devnet/testnet/mainnet.

Desktop (please complete the following information):

Additional context

MoonShiesty commented 1 week ago

I'm experiencing the same issue

I'm using aptos-framework, rev=main. ive tried a few different runtimes with no luck

I'm on Ubuntu 22.04, same aptos version

robbinh commented 1 week ago

Also the same issue. I've tried the aptos-framework with rev=main, rev=aptos-framework-v1.20.0, but no luck.

Desktop:

OS: macOS Sequoia Aptos CLI: v4.2.6

mzabaluev commented 1 week ago

Anyone experiencing this, can you try with Aptos CLI 3.5.1?

Aladeenb commented 1 week ago

Is there any workaround to resolve this without having to downgrade?

robbinh commented 1 week ago

Anyone experiencing this, can you try with Aptos CLI 3.5.1?

for Mac brew:

Warning: No available formula with the name "aptos@3.5.1". ==> Searching for similarly named formulae and casks... Error: No formulae or casks found for aptos@3.5.1.

Aladeenb commented 4 days ago

So I managed to deploy by making the following changes:

  1. Used Movement CLI instead of Aptos CLI: this will enforce the use of Aptos CLI v3.5.0 (make sure to have Movement CLI setup)
  2. Updated Move.toml by replacing:
    [dependencies.AptosFramework]
    git = "https://github.com/aptos-labs/aptos-core.git"
    rev = "main"
    subdir = "aptos-move/framework/aptos-framework"

    with:

[dependencies.AptosFramework]
git = "https://github.com/movementlabsxyz/aptos-core.git"
rev = "movement"
subdir = "aptos-move/framework/aptos-framework"
  1. Refactored the configuration directory from .aptos to .movement.

  2. use movement move publish or movement move create-object-and-publish-package ...

I was able to deploy after following these steps. Just be aware that any feature beyond v3.5.0 won't be available.