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

Scale codec error: Not enough data to fill buffer #399

Closed
shekohex opened this issue Jan 18, 2022 · 5 comments
Closed

Scale codec error: Not enough data to fill buffer #399

shekohex opened this issue Jan 18, 2022 · 5 comments
Assignees

Comments

@shekohex
Copy link

Hello, I started to face this issue whenever I try to read from the Storage in the latest Substrate master.

Here is a simple example to reproduce the issue:

Ok, I've made the minimal Example, please follow these steps:

Tip: Clone everything in /tmp if you don't want to keep them on your drive.

  1. Clone the node locally
git clone --depth 1  https://github.com/webb-tools/dkg-substrate.git

then check out the commit where we updated Substrate:

git checkout 1192013487c9580dcfb1656b504f486bb29c8592
  1. Build the node into release mode (should take less than 10min).
cargo build --release -p dkg-standalone-node
  1. Then, Run the script that will run (3 nodes, for bootstrapping)
./scripts/run-standalone.sh
  1. once it is working, you can clone the SDK and run the test
git clone --depth 1 https://github.com/webb-tools/webb-rs.git
  1. Running the read_chain_nonce test
cargo test read_chain_nonce

You will get that error, similar to this:

Codec(Error { cause: None, desc: "Not enough data to fill buffer" })

Meta

Substrate Version: https://github.com/paritytech/substrate/commit/9eddaec3b8f15eec0c458e7bb3a1c16db91d8199
Subxt Version: https://github.com/paritytech/subxt/commit/d99cb9f4c3b93fdf6a082f60993556016dabc90c
@shekohex
Copy link
Author

@ascjones do you think this is related to this? paritytech/polkadot-sdk#323

@ascjones
Copy link
Contributor

Hi @shekohex, just back from holiday I can take a look tomorrow at this

@ascjones ascjones self-assigned this Jan 25, 2022
@ascjones
Copy link
Contributor

The return type for chain_nonces is u64 https://github.com/webb-tools/webb-rs/blob/main/src/substrate/dkg_runtime.rs#L5768, where it should be u32https://github.com/webb-tools/dkg-substrate/blob/fb480df7f7fa12602e3dc3cc005e2dd96907bfbf/dkg-runtime-primitives/src/proposal.rs#L10.

Regenerating dkg_runtime.rs should fix this.

@shekohex
Copy link
Author

Thank you very much @ascjones !

@icodezjb
Copy link

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

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

No branches or pull requests

3 participants