paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

build non determinism leads to different wasm blobs #6143

Closed dvc94ch closed 4 years ago

dvc94ch commented 4 years ago

~The problem seems to be that the light client is sending the genesis header hash as the genesis hash which fails to match the genesis block hash.~

2020-05-26 15:04:14.461 tokio-runtime-worker TRACE sync  Peer is on different chain (our genesis: 0x4353…708a theirs: 0xe9aa…0b33)

Not sure if this can be fixed, but after analyzing the gensis block I decompiled the wasm blobs and there are some differences.

diff ```diff > call $_as_core::clone::Clone>::clone::hba4a6d13bdaeeb6f 79421c79421 < call $sp_io::crypto::extern_host_function_impls::sr25519_generate::h8d604cc810bd43df --- > call $sp_io::crypto::extern_host_function_impls::sr25519_generate::h6ae33098d90683d3 79437c79437 < call $_as_core::clone::Clone>::clone::hb34e13daa25ebaf3 --- > call $_as_core::clone::Clone>::clone::hba4a6d13bdaeeb6f 79462c79462 < call $sp_io::crypto::extern_host_function_impls::ed25519_generate::hc503ea14fe7ac12f --- > call $sp_io::crypto::extern_host_function_impls::ed25519_generate::h709def84e2299517 79554c79554 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 79594c79594 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 79653c79653 < call $::encode::h9e47c87da803faf0 --- > call $::encode::h04e186dc47fec9cb 79722c79722 < (func $sp_io::crypto::extern_host_function_impls::sr25519_generate::h8d604cc810bd43df (type 18) (param i32 i32 i32) --- > (func $sp_io::crypto::extern_host_function_impls::sr25519_generate::h6ae33098d90683d3 (type 18) (param i32 i32 i32) 79736c79736 < call $sp_runtime_interface::pass_by::::into_ffi_value::h1963ed1b88595b9a --- > call $sp_runtime_interface::pass_by::::into_ffi_value::he35424dc2fa96621 79857c79857 < (func $sp_io::crypto::extern_host_function_impls::ed25519_generate::hc503ea14fe7ac12f (type 18) (param i32 i32 i32) --- > (func $sp_io::crypto::extern_host_function_impls::ed25519_generate::h709def84e2299517 (type 18) (param i32 i32 i32) 79871c79871 < call $sp_runtime_interface::pass_by::::into_ffi_value::h1963ed1b88595b9a --- > call $sp_runtime_interface::pass_by::::into_ffi_value::he35424dc2fa96621 80022c80022 < call $_as_parity_scale_codec::codec::Decode>::decode::h9293bb0049cf2312 --- > call $_as_parity_scale_codec::codec::Decode>::decode::h1f48a32fe0e5c087 80037c80037 < call $parity_scale_codec::codec::read_vec_u8::h99a9f3398d9ee1ba --- > call $parity_scale_codec::codec::read_vec_u8::h8bec0390f1d7e531 80059c80059 < call $<_T__32__as_parity_scale_codec::codec::Decode>::decode::hcef25c818380b472 --- > call $<_T__32__as_parity_scale_codec::codec::Decode>::decode::h9822ae027ad80585 80118c80118 < call $<_T__32__as_parity_scale_codec::codec::Decode>::decode::hcef25c818380b472 --- > call $<_T__32__as_parity_scale_codec::codec::Decode>::decode::h9822ae027ad80585 80352c80352 < call $alloc::vec::Vec::extend_from_slice::h78c8161bcd11d00f --- > call $alloc::vec::Vec::extend_from_slice::h0ef3e604057e6793 80369c80369 < call $alloc::vec::Vec::reserve::h0acd478b854bdcce --- > call $alloc::vec::Vec::reserve::h31fa4c0b497bbf57 80415c80415 < call $alloc::vec::Vec::extend_from_slice::h78c8161bcd11d00f --- > call $alloc::vec::Vec::extend_from_slice::h0ef3e604057e6793 80434c80434 < call $alloc::vec::Vec::reserve::h0acd478b854bdcce --- > call $alloc::vec::Vec::reserve::h31fa4c0b497bbf57 80517c80517 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 80571c80571 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 80591c80591 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 80612c80612 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 80637c80637 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 80662c80662 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 80702c80702 < call $<_T__as_parity_scale_codec::codec::Encode>::encode_to::hf301bdd4263dfafb --- > call $<_T__as_parity_scale_codec::codec::Encode>::encode_to::hb0bb1b8ae1fa526c 80709c80709 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 80842c80842 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 80845c80845 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h085d01ae56708be7 --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h0f6c0a7011b1c61e 80847c80847 < (func $alloc::vec::Vec::extend_from_slice::h78c8161bcd11d00f (type 2) (param i32 i32) --- > (func $alloc::vec::Vec::extend_from_slice::h0ef3e604057e6793 (type 2) (param i32 i32) 81012c81012 < call $sp_io::storage::extern_host_function_impls::get::hc0ca3a3f164a02bf --- > call $sp_io::storage::extern_host_function_impls::get::hf6416921fb2a24a6 81060c81060 < call $_as_parity_scale_codec::codec::Decode>::decode::h82e0640d34f1582e --- > call $_as_parity_scale_codec::codec::Decode>::decode::hb88b8c69770695b1 81138c81138 < call $sp_io::misc::extern_host_function_impls::print_utf8::haa1521b2072c4978 --- > call $sp_io::misc::extern_host_function_impls::print_utf8::hd83e93afa7ca0572 81228c81228 < call $alloc::raw_vec::RawVec::reserve::h9d3cdcaab0a9c66c --- > call $alloc::raw_vec::RawVec::reserve::h838daf3dcbe6586e 81374c81374 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81394c81394 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81420c81420 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81450c81450 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81480c81480 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81518c81518 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81567c81567 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81619c81619 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h085d01ae56708be7 --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h0f6c0a7011b1c61e 81622c81622 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 81654c81654 < call $sp_finality_grandpa::_::>::decode::hcf64be0945c4b2c0 --- > call $sp_finality_grandpa::_::>::decode::h3d39b5708539f8db 81667c81667 < call $_as_parity_scale_codec::codec::Decode>::decode::h9293bb0049cf2312 --- > call $_as_parity_scale_codec::codec::Decode>::decode::h1f48a32fe0e5c087 81679c81679 < call $parity_scale_codec::codec::read_vec_u8::h99a9f3398d9ee1ba --- > call $parity_scale_codec::codec::read_vec_u8::h8bec0390f1d7e531 81710c81710 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81825c81825 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 81872c81872 < call $<_T__32__as_parity_scale_codec::codec::Decode>::decode::hcef25c818380b472 --- > call $<_T__32__as_parity_scale_codec::codec::Decode>::decode::h9822ae027ad80585 81896c81896 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 81966c81966 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 82013c82013 < (func $_as_frame_support::traits::Currency<::AccountId>>::ensure_can_withdraw::h20e322cd1a30f41d (type 31) (param i32 i32 i64 i64 i32 i64 i64) --- > (func $_as_frame_support::traits::Currency<::AccountId>>::ensure_can_withdraw::h911288fa4f888d25 (type 31) (param i32 i32 i64 i64 i32 i64 i64) 82031c82031 < call $frame_support::storage::generator::map::StorageMap::storage_map_final_key::h5ccecfa6e679646a --- > call $frame_support::storage::generator::map::StorageMap::storage_map_final_key::hf524bc66c321b119 82038c82038 < call $frame_support::storage::unhashed::get::hd7b124e9887c833e --- > call $frame_support::storage::unhashed::get::h9759fbab5ab2f2db 82150c82150 < call $pallet_balances::>_for_sp_runtime::DispatchError>::from::h5d549f1826c7d9ce --- > call $pallet_balances::>_for_sp_runtime::DispatchError>::from::h03e9b3a79436e17a 82161c82161 < (func $pallet_balances::Module::call_functions::hd6c46b59ba339d4b (type 3) (param i32) --- > (func $pallet_balances::Module::call_functions::hd9f800723ea6c30c (type 3) (param i32) 82168c82168 < (func $pallet_balances::Module::storage_metadata::h307cb388b79d320b (type 3) (param i32) --- > (func $pallet_balances::Module::storage_metadata::h52cfbadd7e5ae8aa (type 3) (param i32) 82190c82190 < (func $_as_frame_metadata::DefaultByte>::default_byte::heb83457fab6a8585 (type 2) (param i32 i32) --- > (func $_as_frame_metadata::DefaultByte>::default_byte::h599e5bd663bcaef3 (type 2) (param i32 i32) 82206c82206 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82230c82230 < (func $_as_frame_metadata::DefaultByte>::default_byte::hc5aeba5b1a11c564 (type 2) (param i32 i32) --- > (func $_as_frame_metadata::DefaultByte>::default_byte::h9540b7a812df67f1 (type 2) (param i32 i32) 82246c82246 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82268c82268 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82290c82290 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82312c82312 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82340c82340 < (func $_as_frame_metadata::DefaultByte>::default_byte::h6730c0f2e34093a1 (type 2) (param i32 i32) --- > (func $_as_frame_metadata::DefaultByte>::default_byte::h21c1a28ae9c758d6 (type 2) (param i32 i32) 82352c82352 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 82364c82364 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82392c82392 < (func $pallet_balances::Module::module_constants_metadata::he7b8c0c78b260880 (type 3) (param i32) --- > (func $pallet_balances::Module::module_constants_metadata::h040fd011cab17e6f (type 3) (param i32) 82399c82399 < (func $::module_constants_metadata::ExistentialDepositDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h931f5239acfa94ad (type 2) (param i32 i32) --- > (func $::module_constants_metadata::ExistentialDepositDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h5ceeeb730a5854e8 (type 2) (param i32 i32) 82411c82411 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 82423c82423 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82451c82451 < (func $_as_frame_metadata::ModuleErrorMetadata>::metadata::he3e4916d2d3f4bcc (type 3) (param i32) --- > (func $_as_frame_metadata::ModuleErrorMetadata>::metadata::h1d492edb0768a5a3 (type 3) (param i32) 82458c82458 < (func $pallet_grandpa::Module::call_functions::h22d78a241ab22595 (type 3) (param i32) --- > (func $pallet_grandpa::Module::call_functions::hf39b345299d18dc2 (type 3) (param i32) 82465c82465 < (func $pallet_grandpa::Module::storage_metadata::hf3b9aa62a3f1d5e9 (type 3) (param i32) --- > (func $pallet_grandpa::Module::storage_metadata::hff905e0b84dd7bcd (type 3) (param i32) 82487c82487 < (func $_as_frame_metadata::DefaultByte>::default_byte::hb8e0ad126775111f (type 2) (param i32 i32) --- > (func $_as_frame_metadata::DefaultByte>::default_byte::h8904559737e441e7 (type 2) (param i32 i32) 82499c82499 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 82511c82511 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82535c82535 < (func $_as_frame_metadata::DefaultByte>::default_byte::h2c4f6489ea36edba (type 2) (param i32 i32) --- > (func $_as_frame_metadata::DefaultByte>::default_byte::h618d621cb652a97b (type 2) (param i32 i32) 82540,82541c82540,82541 < call $parity_scale_codec::codec::Encode::encode::h758925e92f28b4d2) < (func $pallet_transaction_payment::Module::storage_metadata::hae13bf7fc05d5474 (type 3) (param i32) --- > call $parity_scale_codec::codec::Encode::encode::h8696df4bfd11a678) > (func $pallet_transaction_payment::Module::storage_metadata::h7b82dd76b9165adc (type 3) (param i32) 82563c82563 < (func $pallet_transaction_payment::Module::module_constants_metadata::hb8f3a984514f266c (type 3) (param i32) --- > (func $pallet_transaction_payment::Module::module_constants_metadata::h0d5cbf74f119784a (type 3) (param i32) 82570c82570 < (func $::module_constants_metadata::WeightToFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h0dab10ca3ef8f0b8 (type 2) (param i32 i32) --- > (func $::module_constants_metadata::WeightToFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hb83283f5c102f717 (type 2) (param i32 i32) 82627c82627 < call $alloc::raw_vec::RawVec::reserve::h2df164c29985e127 --- > call $alloc::raw_vec::RawVec::reserve::h017c9d493643ec64 82723c82723 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82741c82741 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82759c82759 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82781c82781 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82803c82803 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82827c82827 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 82830c82830 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h085d01ae56708be7 --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h0f6c0a7011b1c61e 82859c82859 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82886c82886 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82909c82909 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82932c82932 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 82984c82984 < (func $::module_constants_metadata::TransactionByteFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hc2fffff869306acf (type 2) (param i32 i32) --- > (func $::module_constants_metadata::TransactionByteFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h7ea5f9485c2f63e7 (type 2) (param i32 i32) 82996c82996 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 83008c83008 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 83036c83036 < (func $_as_frame_metadata::ModuleErrorMetadata>::metadata::h6c83d9c778d84710 (type 3) (param i32) --- > (func $_as_frame_metadata::ModuleErrorMetadata>::metadata::h5526f0f8ea703b55 (type 3) (param i32) 83043c83043 < (func $<&T_as_core::fmt::Debug>::fmt::h8101c35a67e6bf55 (type 1) (param i32 i32) (result i32) --- > (func $<&T_as_core::fmt::Debug>::fmt::h42ad3802bc218c0c (type 1) (param i32 i32) (result i32) 83707c83707 < (func $::fmt::h2486b1ceace616e9 (type 1) (param i32 i32) (result i32) --- > (func $::fmt::h44fead6c04f2ddaa (type 1) (param i32 i32) (result i32) 83718c83718 < (func $<&T_as_core::fmt::Display>::fmt::hf3bd4e6f13745ee0 (type 1) (param i32 i32) (result i32) --- > (func $<&T_as_core::fmt::Display>::fmt::h2518d79259772b68 (type 1) (param i32 i32) (result i32) 83915c83915 < (func $sp_runtime_interface::pass_by::::from_ffi_value::h225e3256a6dd9d3c (type 32) (param i32 i64) --- > (func $sp_runtime_interface::pass_by::::from_ffi_value::hd78d3114d4e787e7 (type 32) (param i32 i64) 84144c84144 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h085d01ae56708be7 --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h0f6c0a7011b1c61e 84147c84147 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 84155c84155 < (func $sp_io::allocator::extern_host_function_impls::free::h15de03fdb03d0aa3 (type 3) (param i32) --- > (func $sp_io::allocator::extern_host_function_impls::free::he3fa8cc255eb43f7 (type 3) (param i32) 84158c84158 < (func $sp_io::allocator::extern_host_function_impls::malloc::h0b76c6d9e3cf5f42 (type 9) (param i32) (result i32) --- > (func $sp_io::allocator::extern_host_function_impls::malloc::h01a2fb46b6789324 (type 9) (param i32) (result i32) 84161c84161 < (func $sp_runtime_interface::pass_by::::into_ffi_value::h1963ed1b88595b9a (type 2) (param i32 i32) --- > (func $sp_runtime_interface::pass_by::::into_ffi_value::he35424dc2fa96621 (type 2) (param i32 i32) 84198c84198 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h085d01ae56708be7 --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h0f6c0a7011b1c61e 84205c84205 < call $alloc::raw_vec::RawVec::allocate_in::__closure__::h004de2c6dcb83bfe --- > call $alloc::raw_vec::RawVec::allocate_in::__closure__::h032c125834d40a01 84220c84220 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 84256c84256 < call $_as_parity_scale_codec::codec::Encode>::encode_to::h9cb34336faaaebf8 --- > call $_as_parity_scale_codec::codec::Encode>::encode_to::h311fce3453982c41 84261c84261 < call $alloc::raw_vec::RawVec::reserve::h6eaee27f55d32b69 --- > call $alloc::raw_vec::RawVec::reserve::h22f5aca05de25ed8 84312c84312 < (func $::fmt::hfdbafa1af6fb7af3 (type 1) (param i32 i32) (result i32) --- > (func $::fmt::h26f943c87fc5dc17 (type 1) (param i32 i32) (result i32) 84323c84323 < (func $alloc::vec::Vec::reserve::hdfdd23f3190e45f9 (type 2) (param i32 i32) --- > (func $alloc::vec::Vec::reserve::h9bd1ab1386fbb0d9 (type 2) (param i32 i32) 85680c85680 < (elem (;0;) (i32.const 1) $core::fmt::num::imp::::fmt::hf1508a55b24cdfdd $core::ops::function::FnOnce::call_once::h7d8f7cd2e849e998 $<&T_as_core::fmt::Debug>::fmt::h662237685ce856fd $<&T_as_core::fmt::Display>::fmt::h48b4a665fa21fec5 $<&T_as_core::fmt::Display>::fmt::hf3bd4e6f13745ee0 $_as_core::fmt::Debug>::fmt::h18c36e8b48fc966f $::fmt::h7aa3f14289d08ba6 $<&T_as_core::fmt::Display>::fmt::h089f31b2e14c601c $<&T_as_core::fmt::Debug>::fmt::h4bed83bb72e4970c $::fmt::h3b095babf939f2cb $<&T_as_core::fmt::Debug>::fmt::he5bc1b23947b3d6b $<&T_as_core::fmt::Debug>::fmt::hd44d9dc35956b0fa $<&T_as_core::fmt::Debug>::fmt::hddf8f39b264c64b4 $<&T_as_core::fmt::Display>::fmt::hbcd0436ff711495d $core::ptr::drop_in_place::h035d0389470c7b5e $<&mut_W_as_core::fmt::Write>::write_str::h89aa693014ded9be $<&mut_W_as_core::fmt::Write>::write_char::h48fda0fc55b7bf31 $<&mut_W_as_core::fmt::Write>::write_fmt::hc087a648cf1151b3 $::fmt::ha019935b7b3a3d4e $::type_id::h00ebb145f422501e $::write_str::h60b6ecc71abab556 $core::fmt::Write::write_char::hc76f83659b8cda4e $core::fmt::Write::write_fmt::ha720439f8e5cc3e0 $<&mut_W_as_core::fmt::Write>::write_str::hf98c9fadd33ac675 $<&mut_W_as_core::fmt::Write>::write_char::hd4a7c1b421246e30 $<&mut_W_as_core::fmt::Write>::write_fmt::h571b8b076927c908 $<&mut_W_as_core::fmt::Write>::write_str::h8ea9eacc71ea8444 $<&mut_W_as_core::fmt::Write>::write_char::h0aa6ad80a4d5153b $<&mut_W_as_core::fmt::Write>::write_fmt::ha3c7d2acc4caf13d $::enabled::h7958681075fca8e6 $::log::hde767d0b58842889 $::flush::hb5dba739d051c721 $::enabled::h36061f824516a64b $::log::hfcf1390640681584 $_as_frame_metadata::DefaultByte>::default_byte::hfd8ad9c497879b6c $_as_frame_metadata::DefaultByte>::default_byte::hb76c6a4a8c69c8aa $_as_frame_metadata::DefaultByte>::default_byte::hfcb3592c5c69dc83 $_as_frame_metadata::DefaultByte>::default_byte::h9f8061da2f540e8e $_as_frame_metadata::DefaultByte>::default_byte::hb0e3c9a8f345ed86 $_as_frame_metadata::DefaultByte>::default_byte::hc6e0eab996083082 $_as_frame_metadata::DefaultByte>::default_byte::h40eb7c500e99403b $::module_constants_metadata::BlockHashCountDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::he2ea2af560d3ce1e $::module_constants_metadata::MaximumBlockWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::haa2cc68f2c9a10ab $::module_constants_metadata::DbWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hd7db185bb94bd082 $::module_constants_metadata::BlockExecutionWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h4e41575cc6d65291 $::module_constants_metadata::ExtrinsicBaseWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h8d2d1e932082103a $::module_constants_metadata::MaximumBlockLengthDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h86b216d621b56a86 $<&mut_W_as_core::fmt::Write>::write_fmt::h5efdbd1cf86e1019 $::fmt::h2486b1ceace616e9 $_as_frame_metadata::DefaultByte>::default_byte::hb8e0ad126775111f $::module_constants_metadata::MinimumPeriodDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h47dd834a4c9b9ee2 $core::ptr::drop_in_place::h6896737faeeb4089 $::fmt::hfdbafa1af6fb7af3 $frame_system::Module::storage_metadata::ha857374e3f4d82b3 $frame_system::Module::call_functions::h47e8f2e3e6e57f29 $node_template_runtime::Runtime::__module_events_system::h836970e77b1c5d8e $frame_system::Module::module_constants_metadata::he63d8c6b3917c9ab $_as_frame_metadata::ModuleErrorMetadata>::metadata::h58a992682c2ec954 $pallet_randomness_collective_flip::Module::storage_metadata::h5a576b285dc8b842 $_as_frame_metadata::ModuleErrorMetadata>::metadata::h908002e1e50bda33 $pallet_timestamp::Module::storage_metadata::hdfa84f8ce6dc1e6d $pallet_timestamp::Module::call_functions::h4e07526c948870da $pallet_timestamp::Module::module_constants_metadata::h039caef1a17209d8 $pallet_grandpa::Module::storage_metadata::hf3b9aa62a3f1d5e9 $pallet_grandpa::Module::call_functions::h22d78a241ab22595 $node_template_runtime::Runtime::__module_events_grandpa::he36221cd24ae5444 $_as_frame_metadata::ModuleErrorMetadata>::metadata::h6c83d9c778d84710 $pallet_balances::Module::storage_metadata::h307cb388b79d320b $pallet_balances::Module::call_functions::hd6c46b59ba339d4b $node_template_runtime::Runtime::__module_events_balances::h3fe6ea76120b005d $pallet_balances::Module::module_constants_metadata::he7b8c0c78b260880 $_as_frame_metadata::ModuleErrorMetadata>::metadata::he3e4916d2d3f4bcc $pallet_transaction_payment::Module::storage_metadata::hae13bf7fc05d5474 $pallet_transaction_payment::Module::module_constants_metadata::hb8f3a984514f266c $pallet_sudo::Module::storage_metadata::h4e1391e28b1e5efd $pallet_sudo::Module::call_functions::hb371e67b7dd5211e $node_template_runtime::Runtime::__module_events_sudo::h1c1e3390ea79c3a3 $_as_frame_metadata::ModuleErrorMetadata>::metadata::h21488b8d9d4bf333 $pallet_template::Module::storage_metadata::hec1109f0856aa374 $pallet_template::Module::call_functions::h906ff44926c4a8c7 $node_template_runtime::Runtime::__module_events_template::hf0c6c7e31590983a $_as_frame_metadata::ModuleErrorMetadata>::metadata::h6aeb33b0790418a2 $_as_frame_metadata::DefaultByte>::default_byte::h3edad258d006c3ea $_as_frame_metadata::DefaultByte>::default_byte::h6730c0f2e34093a1 $_as_frame_metadata::DefaultByte>::default_byte::hc5aeba5b1a11c564 $_as_frame_metadata::DefaultByte>::default_byte::heb83457fab6a8585 $::module_constants_metadata::ExistentialDepositDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h931f5239acfa94ad $_as_frame_metadata::DefaultByte>::default_byte::h2c4f6489ea36edba $::module_constants_metadata::TransactionByteFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hc2fffff869306acf $::module_constants_metadata::WeightToFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h0dab10ca3ef8f0b8 $::fmt::h0eb88d155f309d07 $::fmt::hb335de686120cc23 $<&T_as_core::fmt::Debug>::fmt::h8101c35a67e6bf55) --- > (elem (;0;) (i32.const 1) $core::fmt::num::imp::::fmt::hf1508a55b24cdfdd $core::ops::function::FnOnce::call_once::h7d8f7cd2e849e998 $<&T_as_core::fmt::Debug>::fmt::h662237685ce856fd $<&T_as_core::fmt::Display>::fmt::h48b4a665fa21fec5 $<&T_as_core::fmt::Display>::fmt::h2518d79259772b68 $_as_core::fmt::Debug>::fmt::h18c36e8b48fc966f $::fmt::h7aa3f14289d08ba6 $<&T_as_core::fmt::Display>::fmt::h089f31b2e14c601c $<&T_as_core::fmt::Debug>::fmt::h1807dbe60573f06c $::fmt::h3b095babf939f2cb $<&T_as_core::fmt::Debug>::fmt::h19b5e8a9d1541022 $<&T_as_core::fmt::Debug>::fmt::h3de89613f50851c2 $<&T_as_core::fmt::Debug>::fmt::h1091fd04fa8f540a $<&T_as_core::fmt::Display>::fmt::hbcd0436ff711495d $core::ptr::drop_in_place::h00e5c48868f74798 $<&mut_W_as_core::fmt::Write>::write_str::h89aa693014ded9be $<&mut_W_as_core::fmt::Write>::write_char::h48fda0fc55b7bf31 $<&mut_W_as_core::fmt::Write>::write_fmt::hc087a648cf1151b3 $::fmt::ha019935b7b3a3d4e $::type_id::h00ebb145f422501e $::write_str::h60b6ecc71abab556 $core::fmt::Write::write_char::hc76f83659b8cda4e $core::fmt::Write::write_fmt::ha720439f8e5cc3e0 $<&mut_W_as_core::fmt::Write>::write_str::hf98c9fadd33ac675 $<&mut_W_as_core::fmt::Write>::write_char::hd4a7c1b421246e30 $<&mut_W_as_core::fmt::Write>::write_fmt::h571b8b076927c908 $<&mut_W_as_core::fmt::Write>::write_str::h074cae7eb496dfaa $<&mut_W_as_core::fmt::Write>::write_char::hd4d96b6ddf8cfcee $<&mut_W_as_core::fmt::Write>::write_fmt::hdedeeda8132b9a49 $::enabled::h82cc7d641407ed9e $::log::h69673d2f980df08d $::flush::hb5dba739d051c721 $::enabled::h36061f824516a64b $::log::hfcf1390640681584 $_as_frame_metadata::DefaultByte>::default_byte::hdb27bd2d02ec8020 $_as_frame_metadata::DefaultByte>::default_byte::h48528fe703a36a05 $_as_frame_metadata::DefaultByte>::default_byte::hce231997b235ae68 $_as_frame_metadata::DefaultByte>::default_byte::h9352c81c11ee1e09 $_as_frame_metadata::DefaultByte>::default_byte::h84d463b65928768f $_as_frame_metadata::DefaultByte>::default_byte::ha573cb2ab798d7ca $_as_frame_metadata::DefaultByte>::default_byte::h0dca1a5800f8defe $::module_constants_metadata::BlockHashCountDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hf3a703ffc1616ccb $::module_constants_metadata::MaximumBlockWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hfcb0f0788e903bbd $::module_constants_metadata::DbWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h175e312e37d79b93 $::module_constants_metadata::BlockExecutionWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h675de16ddb652e95 $::module_constants_metadata::ExtrinsicBaseWeightDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h01c4d2a17f4c4490 $::module_constants_metadata::MaximumBlockLengthDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hbdf1aaa8958254cf $<&mut_W_as_core::fmt::Write>::write_fmt::h770a545ec3c3e311 $::fmt::h44fead6c04f2ddaa $_as_frame_metadata::DefaultByte>::default_byte::h8904559737e441e7 $::module_constants_metadata::MinimumPeriodDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h4754d04c099d349c $core::ptr::drop_in_place::h159f1cd896d99124 $::fmt::h26f943c87fc5dc17 $frame_system::Module::storage_metadata::hcf2dbb9126f1428f $frame_system::Module::call_functions::hd5f1bd9041c7eef6 $node_template_runtime::Runtime::__module_events_system::h0ee5a677e69557b7 $frame_system::Module::module_constants_metadata::h2bd54f092669c724 $_as_frame_metadata::ModuleErrorMetadata>::metadata::ha62dad0eda6931e7 $pallet_randomness_collective_flip::Module::storage_metadata::he0696bc200f3053b $_as_frame_metadata::ModuleErrorMetadata>::metadata::ha90fe3b10258de5b $pallet_timestamp::Module::storage_metadata::h1e1b7416453a52e8 $pallet_timestamp::Module::call_functions::hc0f2af4134a575b0 $pallet_timestamp::Module::module_constants_metadata::h337d24814ad70455 $pallet_grandpa::Module::storage_metadata::hff905e0b84dd7bcd $pallet_grandpa::Module::call_functions::hf39b345299d18dc2 $node_template_runtime::Runtime::__module_events_grandpa::h6bd47d695d6433c6 $_as_frame_metadata::ModuleErrorMetadata>::metadata::h5526f0f8ea703b55 $pallet_balances::Module::storage_metadata::h52cfbadd7e5ae8aa $pallet_balances::Module::call_functions::hd9f800723ea6c30c $node_template_runtime::Runtime::__module_events_balances::hc144c49fa3ef310c $pallet_balances::Module::module_constants_metadata::h040fd011cab17e6f $_as_frame_metadata::ModuleErrorMetadata>::metadata::h1d492edb0768a5a3 $pallet_transaction_payment::Module::storage_metadata::h7b82dd76b9165adc $pallet_transaction_payment::Module::module_constants_metadata::h0d5cbf74f119784a $pallet_sudo::Module::storage_metadata::hf73c9cb7a0852a4a $pallet_sudo::Module::call_functions::h113d323b4c1caf13 $node_template_runtime::Runtime::__module_events_sudo::h886049f41261ace7 $_as_frame_metadata::ModuleErrorMetadata>::metadata::h82714e7dc71da524 $pallet_template::Module::storage_metadata::h3c0e53ac449d1d36 $pallet_template::Module::call_functions::hdeb1d4516f89de93 $node_template_runtime::Runtime::__module_events_template::h8e069aae7e25237e $_as_frame_metadata::ModuleErrorMetadata>::metadata::hb6baecc864733585 $_as_frame_metadata::DefaultByte>::default_byte::hb36ed4faefa6d397 $_as_frame_metadata::DefaultByte>::default_byte::h21c1a28ae9c758d6 $_as_frame_metadata::DefaultByte>::default_byte::h9540b7a812df67f1 $_as_frame_metadata::DefaultByte>::default_byte::h599e5bd663bcaef3 $::module_constants_metadata::ExistentialDepositDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h5ceeeb730a5854e8 $_as_frame_metadata::DefaultByte>::default_byte::h618d621cb652a97b $::module_constants_metadata::TransactionByteFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::h7ea5f9485c2f63e7 $::module_constants_metadata::WeightToFeeDefaultByteGetter_as_frame_metadata::DefaultByte>::default_byte::hb83283f5c102f717 $::fmt::h0eb88d155f309d07 $::fmt::hb335de686120cc23 $<&T_as_core::fmt::Debug>::fmt::h42ad3802bc218c0c) ```
bkchr commented 4 years ago

This is the reason you need to distribute the raw chain spec. Like we do it for Kusama/Polkadot etc. This makes sure that everybody gets the same genesis.

dvc94ch commented 4 years ago

Yes, kind of figured. But I've been running into more issues. Is this the right place to ask questions? For example I had to disable checking the extrinsic root for blocks to be synced between the light client and the node.

diff --git a/client/service/src/client/light/fetcher.rs b/client/service/src/client/light/fetcher.rs
index 542255496..20c0dd5d1 100644
--- a/client/service/src/client/light/fetcher.rs
+++ b/client/service/src/client/light/fetcher.rs
@@ -287,14 +287,15 @@ impl<E, Block, H, S> FetchChecker<Block> for LightDataChecker<E, H, Block, S>
                let extrinsics_root = HashFor::<Block>::ordered_trie_root(
                        body.iter().map(Encode::encode).collect(),
                );
-               if *request.header.extrinsics_root() == extrinsics_root {
+               Ok(body)
+               /*if *request.header.extrinsics_root() == extrinsics_root {
                        Ok(body)
                } else {
                        Err(format!("RemoteBodyRequest: invalid extrinsics root expected: {} but got {}",
                                *request.header.extrinsics_root(),
                                extrinsics_root,
                        ).into())
-               }
+               }*/

        }
 }
bkchr commented 4 years ago

Light client sync works here without any required modifications. Not sure, did you modified more?

bkchr commented 4 years ago

If you have a way to reproduce, we can take a look

dvc94ch commented 4 years ago

I pushed all my changes. The changes to substrate are trivial:

To reproduce (assumes the substrate/substrate-subxt are side by side):

cd substrate-subxt/light-client
./gen-chain-spec.sh
./run.sh
cargo test -- test_light_client --ignored
dvc94ch commented 4 years ago

I guess you didn't have time yet. I'll probably have time to look into this more after the polkadot launch hackathon is over.

bkchr commented 4 years ago

Yeah sorry