Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default_child_storage_get_version_1 #3457

Closed
EclesioMeloJunior opened this issue Aug 28, 2023 · 0 comments · Fixed by #3451
Closed

Fix default_child_storage_get_version_1 #3457

EclesioMeloJunior opened this issue Aug 28, 2023 · 0 comments · Fixed by #3451
Assignees

Comments

@EclesioMeloJunior
Copy link
Member

EclesioMeloJunior commented Aug 28, 2023

More informations about the error:

  • Log line
2023-07-27T11:31:31Z ERROR    block data processing for block with hash 0x03ff62c2f25209593b2fdf87b2206f6b09e5877f76026c7c7fa527b465453f61 failed: processing block data with header and body: handling block: failed to execute block 7165794: running runtime function: wasm error: unreachable
  • Stacktrace


2023-07-27T07:31:31.256-04:00 | wasm stack trace:
-- | --
  | 2023-07-27T07:31:31.256-04:00 | .rust_begin_unwind(i32)
  | 2023-07-27T07:31:31.256-04:00 | .core::panicking::panic_fmt::h3ab5417155b7ba3b(i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .core::result::unwrap_failed::h9bf99bca88ba05dc(i32,i32,i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .sp_runtime_interface::pass_by::<impl sp_runtime_interface::wasm::FromFFIValue for T>::from_ffi_value::hfd565fd4df947d4f(i32,i64)
  | 2023-07-27T07:31:31.256-04:00 | .sp_io::default_child_storage::extern_host_function_impls::get::h21da8c738e7613fc(i32,i32,i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .sp_core::crypto::_::<impl parity_scale_codec::codec::Encode for sp_core::crypto::AccountId32>::using_encoded::h5fcfff52f1e9f987(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .<polkadot_runtime_common::crowdloan::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::hc790666693726898(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .<westend_runtime::Call as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::heb0da3f3e33b67ca(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .<westend_runtime::Call as sp_runtime::traits::Dispatchable>::dispatch::h873b2480955b0374(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .pallet_proxy::<impl pallet_proxy::pallet::Pallet<T>>::do_proxy::h7cad1c97c939a9fb(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .<pallet_proxy::pallet::Call<T> as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h40d5d5fad355f593(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .<westend_runtime::Call as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::heb0da3f3e33b67ca(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .<westend_runtime::Call as sp_runtime::traits::Dispatchable>::dispatch::h873b2480955b0374(i32,i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPallets,COnRuntimeUpgrade>::apply_extrinsic::hb943e0c0fe4326cd(i32,i32)
  | 2023-07-27T07:31:31.256-04:00 | .Core_execute_block(i32,i32) i64 pkg=sync

2023-08-08T16:53:34Z CRITICAL target=runtime message=panicked at 'Host to wasm values are encoded correctly; qed: Error', /cargo-home/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/runtime-interface/src/pass_by.rs:255:38	ext_logging_log_version_1	pkg=runtime module=wazero

The problem is that the pallet is trying to retrieve a value from the host through the default child storage, as the value does not exist in the host the host should return None however Gossamer is returning the value 0 which is causing the problem since the runtime is expecting a Option<Vec<u8>>, to fix that we should return None or []byte{0x00} if we don't find the value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant