JoshOrndorff / recipes

A Hands-On Cookbook for Aspiring Blockchain Chefs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad input data provided to validate_transaction: Codec error

mrcnski opened this issue · comments

I'm trying to run the ocw example but every time I submit a transaction I get:

2021-09-12 14:34:15.755 ERROR     txpool-verifier1 runtime: panicked at 'Bad input data provided to validate_transaction: Codec error', /Users/marcin/Sync/Repos/github.com/substrate-developer-hub/recipes/runtimes/super-runtime/src/lib.rs:412:1    
2021-09-12 14:34:15.755  WARN tokio-runtime-worker sc_rpc::author: Failed to submit extrinsic: Extrinsic verification error: Runtime error: Execution failed: Wasmi(Trap(Trap { kind: Unreachable }))  

Version: version 3.0.0-98d3625-x86_64-macos
Runtime: Native runtime: ocw-runtime-1 (ocw-runtime-1.tx1.au1)

This sounds wrong. If you're running the ocw runtime the super-runtime should not be used.

One source of failing transactions is type incompatibility.
Make sure you're using the correct types.json if you're using Polkadot-js to interact with the chain.
(i.e. https://github.com/substrate-developer-hub/recipes/blob/master/runtimes/ocw-runtime/types.json for the ocw runtime)

Thanks. I did specify the ocw runtime -- I followed the instructions in the docs and commented out the super-runtime:

https://substrate.dev/recipes/off-chain-workers/transactions.html

The runtime in the output is:

Native runtime: ocw-runtime-1 (ocw-runtime-1.tx1.au1)

Make sure you're using the correct types.json if you're using Polkadot-js to interact with the chain.

How do I do this? I didn't see this mentioned in the docs.

Yeah, sorry it's not mentioned explicitly.
You copy and paste the contents of the types.json into Settings > Developer (e.g. https://polkadot.js.org/apps/#/settings/developer)

Thanks, that resolved my issue!

It seems is issue is resolved. Closing it now. Please open this issue if there is still any problem. Thanks.

I had a similar problem.
Using the wrong or outdated polkadot.js types via polkadot.js.org.
Resolved it by cleaning and configuring the correct type