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

cargo run -p ac-examples --example get_blocks -- panics #560

Closed
zabuxx opened this issue May 2, 2023 · 3 comments
Closed

cargo run -p ac-examples --example get_blocks -- panics #560

zabuxx opened this issue May 2, 2023 · 3 comments
Labels
Z6-question Further information is requested

Comments

@zabuxx
Copy link

zabuxx commented May 2, 2023

Hi,

I've tried different versions against different chains, but always run into the following issue:

$ cargo run -p ac-examples --example get_blocks
Finished dev [unoptimized + debuginfo] target(s) in 0.33s
Running target/debug/examples/get_blocks
Genesis block:
Some(Block { header: Header { parent_hash: 0x0000000000000000000000000000000000000000000000000000000000000000, number: 0, state_root: 0x29d0d972cd27cbc511e9589fcb7a4506d5eb6a9e8df205f00472e5ab354a4e17, extrinsics_root: 0x03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314, digest: Digest { logs: [] } }, extrinsics: [] })

Latest Finalized Header Hash:
0x3c28…c277

Finalized header:
Header { parent_hash: 0xedddc2d013a9a1ad2946def4c578e0026edda9960d263275246e6acc23691dc0, number: 15345290, state_root: 0x55c43740239db883cfa9456d5ee6f771ceed7d4c71314651d6e35912bd007f7e, extrinsics_root: 0x6ece67934523b31324ac7e6149d66a6d59e253ce0544994f8ecae854750a569f, digest: Digest { logs: [DigestItem::PreRuntime([66, 65, 66, 69], [3, 52, 0, 0, 0, 119, 41, 184, 16, 0, 0, 0, 0, 174, 201, 4, 236, 83, 108, 176, 95, 70, 13, 147, 97, 179, 183, 36, 165, 160, 195, 254, 94, 113, 94, 109, 212, 154, 228, 197, 149, 248, 4, 170, 89, 60, 54, 119, 24, 28, 83, 43, 155, 210, 87, 223, 10, 55, 252, 100, 103, 20, 0, 26, 25, 71, 29, 58, 18, 200, 74, 133, 42, 146, 37, 161, 10, 161, 83, 120, 40, 73, 42, 197, 235, 155, 45, 105, 101, 172, 199, 111, 150, 241, 40, 15, 174, 201, 249, 229, 77, 79, 173, 30, 30, 195, 158, 24, 4]), DigestItem::Seal([66, 65, 66, 69], [130, 95, 130, 100, 250, 117, 101, 90, 232, 10, 41, 50, 185, 242, 192, 139, 3, 66, 145, 185, 104, 120, 66, 187, 253, 255, 17, 196, 102, 204, 14, 80, 6, 246, 46, 127, 64, 68, 66, 0, 113, 189, 179, 204, 210, 175, 82, 241, 213, 168, 42, 93, 102, 246, 45, 205, 155, 241, 26, 202, 160, 131, 113, 129])] } }

thread 'main' panicked at 'called Result::unwrap() on an Err value: RpcClient(Client(ParseError(Error("Decode error: Could not decode RuntimeCall::AllianceMotion.0:\n\tCould not decode Call::set_members::prime:\n\t\tunexpected first byte decoding Option\n", line: 0, column: 0))))', examples/examples/get_blocks.rs:44:53
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@haerdib
Copy link
Contributor

haerdib commented May 2, 2023

Hey @zabuxx

That's interesting indeed. As it is only the block fetching that fails, some follow-up questions:

  1. The Block contains extrinsics which vary according to the Runtime and the included pallets. Therefore, the Block type must match the Runtime of your node ( if you're interested where the block the gets assigned, check out this code)
    In the example, the Runtime gets taken from the kitchsink_runtime of Substrate, because that's the node our CI runs the example against:

    use kitchensink_runtime::Runtime;

    Have you tried running the example against a kitchensink_runtime, and if not, have you adapted the Runtime import to match your node?
    FYI: We're currently working on making this a little more simple in tag v0.12.0. An extra Runtime assignment will not be necessary by then aynmore (see this PR) .

  2. If the above was not the problem, are the substrate-api-client and node version matching? E.g. similarly dated substrate commit or matching polkadot branch (e.g polkadot-v0.9.40 branch in the api-client and the node as well? You can check this in the Cargo.lock file of the node). If you're unsure, feel free to post the GitHub link of your node and the api-client version you're using.

@haerdib haerdib added the Z6-question Further information is requested label May 2, 2023
@masapr
Copy link
Collaborator

masapr commented Jun 20, 2023

Hi @zabuxx, is the issue resolved for you? Is it ok, if we close this issue?

@masapr
Copy link
Collaborator

masapr commented Jul 5, 2023

Closing issue due to inactivity, feel free to reopen if needed.

@masapr masapr closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z6-question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants