inkdevhub / swanky-node

Substrate test node with instant finality
The Unlicense
38 stars 14 forks source link

Runtime panic submitting transaction via subxt #60

Closed boyswan closed 1 year ago

boyswan commented 1 year ago

Testing submitting transactions with subxt via the following panics:

    let client = OnlineClient::<SubstrateConfig>::new().await?;
    let account_id = AccountId32::from_str(&*account)?;

    let call = node::tx().contracts().call(
        MultiAddress::Id(contract),
        0,
        Weight {
            ref_time: 500_000_000,
            proof_size: PROOF_SIZE,
        },
        None,
        Default::default(),
    );

    let partial = client
        .tx()
        .create_partial_signed(&call, &account_id, Default::default())
        .await?;

    let payload = partial.signer_payload();

    let extrinsic =
        partial.sign_with_address_and_signature(&MultiAddress::Id(account_id), &"fake_signature");

    extrinsic
        .submit_and_watch()
        .await
        .unwrap()
        .wait_for_finalized_success()
        .await
        .unwrap();
Version: 1.5.0-d9bef545308

   0: sp_panic_handler::set::{{closure}}
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/alloc/src/boxed.rs:2002:9
      std::panicking::rust_panic_with_hook
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/std/src/panicking.rs:692:13
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/std/src/panicking.rs:579:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/std/src/sys_common/backtrace.rs:137:18
   4: rust_begin_unwind
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/std/src/panicking.rs:575:5
   5: core::panicking::panic_fmt
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/core/src/panicking.rs:64:14
   6: swanky_runtime::api::dispatch
   7: std::thread::local::LocalKey<T>::with
   8: sc_executor::native_executor::WasmExecutor<H>::with_instance::{{closure}}
   9: sc_executor::wasm_runtime::RuntimeCache::with_instance
  10: <sc_executor::native_executor::NativeElseWasmExecutor<D> as sp_core::traits::CodeExecutor>::call
  11: sp_state_machine::execution::StateMachine<B,H,Exec>::execute_aux
  12: sp_state_machine::execution::StateMachine<B,H,Exec>::execute_using_consensus_failure_handler
  13: <sc_service::client::call_executor::LocalCallExecutor<Block,B,E> as sc_client_api::call_executor::CallExecutor<Block>>::contextual_call
  14: <sc_service::client::client::Client<B,E,Block,RA> as sp_api::CallApiAt<Block>>::call_api_at
  15: <swanky_runtime::RuntimeApiImpl<__SR_API_BLOCK__,RuntimeApiImplCall> as sp_block_builder::BlockBuilder<__SR_API_BLOCK__>>::__runtime_api_internal_call_api_at
  16: sp_transaction_pool::runtime_api::TaggedTransactionQueue::validate_transaction
  17: sc_transaction_pool::api::validate_transaction_blocking
  18: <sc_transaction_pool::api::FullChainApi<Client,Block> as sc_transaction_pool::graph::pool::ChainApi>::validate_transaction::{{closure}}::{{closure}}
  19: sc_transaction_pool::api::spawn_validation_pool_task::{{closure}}
  20: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
  21: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  22: <futures_util::future::select::Select<A,B> as core::future::future::Future>::poll
  23: <tracing_futures::Instrumented<T> as core::future::future::Future>::poll
  24: tokio::runtime::context::BlockingRegionGuard::block_on
  25: tokio::runtime::handle::Handle::block_on
  26: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  27: tokio::runtime::task::core::Core<T,S>::poll
  28: tokio::runtime::task::harness::Harness<T,S>::poll
  29: tokio::runtime::blocking::pool::Inner::run
  30: std::sys_common::backtrace::__rust_begin_short_backtrace
  31: core::ops::function::FnOnce::call_once{{vtable.shim}}
  32: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/alloc/src/boxed.rs:1988:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/alloc/src/boxed.rs:1988:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/3020239de947ec52677e9b4e853a6a9fc073d1f9/library/std/src/sys/unix/thread.rs:108:17
  33: start_thread
  34: __GI___clone3

Thread 'tokio-runtime-worker' panicked at 'Bad input data provided to validate_transaction: Could not decode `MultiSignature`, variant doesn't exist', runtime/src/lib.rs:537
boyswan commented 1 year ago

Not specific to swanky-node