paritytech / cumulus

Write Parachains on Substrate
GNU General Public License v3.0
620 stars 380 forks source link

Collator computes incorrect storage root for relay chain #281

Closed gregdhill closed 3 years ago

gregdhill commented 3 years ago
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] babe:We have 2 logs in this header    
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] header:Retrieving mutable reference to digest    
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] babe:Verifying Primary block    
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] header:Retrieving mutable reference to digest    
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] db:DB Commit 0xdd700a6c92decf6e3b550ab621fa84bd4be14f8a1113075a976378972b3265d4 (10), best = true    
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] babe:We have 3 logs in this header    
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] header:Retrieving mutable reference to digest    
2021-01-07 11:20:49.577  DEBUG tokio-runtime-worker [Relaychain] babe:Verifying Primary block    
2021-01-07 11:20:49.578  DEBUG tokio-runtime-worker [Relaychain] babe:👶 New epoch 1 launching at block 0xad0b…f98f (block slot 268336330 >= start slot 268336330).    
2021-01-07 11:20:49.578  DEBUG tokio-runtime-worker [Relaychain] babe:👶 Next epoch starts at slot 268336340    
Hash: given=b80da74d1fb84b26126b598cf31b0e4665e64cedd7aa2f7023597690f4293b31, expected=743e806eb8bc938856172f3272d57ba40b77dfd6785b238d8ec64ef2a46aa7fc

====================

Version: 0.3.2-0d4e37d-x86_64-linux-gnu

   0: sp_panic_handler::set::{{closure}}
   1: std::panicking::rust_panic_with_hook
             at /rustc/ef663a8a48ea6b98b43cbfaefd99316b36b16825/library/std/src/panicking.rs:581:17
   2: std::panicking::begin_panic::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: std::panicking::begin_panic
   5: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllModules,COnRuntimeUpgrade>::final_checks
   6: tracing::span::Span::in_scope
   7: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllModules,COnRuntimeUpgrade>::execute_block
   8: <rococo_runtime::Runtime as sp_api::runtime_decl_for_Core::Core<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32,sp_runtime::traits::BlakeTwo256>,sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic<<<sp_runtime::MultiSignature as sp_runtime::traits::Verify>::Signer as sp_runtime::traits::IdentifyAccount>::AccountId,rococo_runtime::Call,sp_runtime::MultiSignature,(frame_system::extensions::check_spec_version::CheckSpecVersion<rococo_runtime::Runtime>,frame_system::extensions::check_tx_version::CheckTxVersion<rococo_runtime::Runtime>,frame_system::extensions::check_genesis::CheckGenesis<rococo_runtime::Runtime>,frame_system::extensions::check_mortality::CheckMortality<rococo_runtime::Runtime>,frame_system::extensions::check_nonce::CheckNonce<rococo_runtime::Runtime>,frame_system::extensions::check_weight::CheckWeight<rococo_runtime::Runtime>,pallet_transaction_payment::ChargeTransactionPayment<rococo_runtime::Runtime>)>>>>::execute_block
   9: sp_api::runtime_decl_for_Core::execute_block_native_call_generator::{{closure}}
  10: std::thread::local::LocalKey<T>::with
  11: sc_executor::native_executor::WasmExecutor::with_instance::{{closure}}
  12: sc_executor::wasm_runtime::RuntimeCache::with_instance
  13: <sc_executor::native_executor::NativeExecutor<D> as sp_core::traits::CodeExecutor>::call
  14: sp_state_machine::execution::StateMachine<B,H,N,Exec>::execute_aux
  15: sp_state_machine::execution::StateMachine<B,H,N,Exec>::execute_using_consensus_failure_handler
  16: <sc_service::client::call_executor::LocalCallExecutor<B,E> as sc_client_api::call_executor::CallExecutor<Block>>::contextual_call
  17: <sc_service::client::client::Client<B,E,Block,RA> as sp_api::CallApiAt<Block>>::call_api_at
  18: sp_api::runtime_decl_for_Core::execute_block_call_api_at
  19: sp_api::Core::execute_block_with_context
  20: <&sc_service::client::client::Client<B,E,Block,RA> as sp_consensus::block_import::BlockImport<Block>>::import_block
  21: <sc_finality_grandpa::import::GrandpaBlockImport<BE,Block,Client,SC> as sp_consensus::block_import::BlockImport<Block>>::import_block
  22: <sc_consensus_babe::BabeBlockImport<Block,Client,Inner> as sp_consensus::block_import::BlockImport<Block>>::import_block
  23: sp_consensus::import_queue::import_single_block_metered
  24: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
  25: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
  26: <futures_util::future::future::flatten::Flatten<Fut,<Fut as core::future::future::Future>::Output> as core::future::future::Future>::poll
  27: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
  28: <sc_service::task_manager::prometheus_future::PrometheusFuture<T> as core::future::future::Future>::poll
  29: <futures_util::future::select::Select<A,B> as core::future::future::Future>::poll
  30: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  31: <tracing_futures::Instrumented<T> as core::future::future::Future>::poll
  32: std::thread::local::LocalKey<T>::with
  33: futures_executor::local_pool::block_on
  34: tokio::runtime::task::core::Core<T,S>::poll
  35: std::panicking::try
  36: tokio::runtime::task::harness::Harness<T,S>::poll
  37: tokio::runtime::blocking::pool::Inner::run
  38: tokio::runtime::context::enter
  39: std::sys_common::backtrace::__rust_begin_short_backtrace
  40: core::ops::function::FnOnce::call_once{{vtable.shim}}
  41: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/ef663a8a48ea6b98b43cbfaefd99316b36b16825/library/alloc/src/boxed.rs:1042:9
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/ef663a8a48ea6b98b43cbfaefd99316b36b16825/library/alloc/src/boxed.rs:1042:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/ef663a8a48ea6b98b43cbfaefd99316b36b16825/library/std/src/sys/unix/thread.rs:87:17
  42: start_thread
  43: __GI___clone

Thread 'tokio-runtime-worker' panicked at 'Storage root must match that calculated.', /home/greg/.cargo/git/checkouts/substrate-7e08433d4c370a21/1b840aa/frame/executive/src/lib.rs:405

This is a bug. Please report it at:

    https://github.com/paritytech/cumulus/issues/new

2021-01-07 11:20:49.599  DEBUG tokio-runtime-worker [Relaychain] header:Retrieving mutable reference to digest   

Polkadot: https://github.com/paritytech/polkadot/tree/e9866d55d650cabfd139f9013ae95023f65c8946 BTC-Parachain: https://gitlab.com/interlay/btc-parachain/-/tree/76cdd382c641ba15cd088cdc73ee80ea8139bb5c

gregdhill commented 3 years ago

Commands:

polkadot --chain rococo-custom.json --tmp --ws-port 9944 --port 30333 --alice
polkadot --chain rococo-custom.json --tmp --ws-port 9955 --port 30334 --bob --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/<ID>
btc-parachain --tmp --ws-port 9977 --port 30336 --parachain-id 200 --validator -- --chain rococo-custom.json --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/<ID>
bkchr commented 3 years ago

btc-parachain --tmp --ws-port 9977 --port 30336 --parachain-id 200 --validator -- --chain rococo-custom.json --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/ --execution wasm

Add the highlighted part