Git Product home page Git Product logo

Comments (10)

buffalojoec avatar buffalojoec commented on July 20, 2024

Hey @Ai-Artsca you'll have to provide a little context here to describe why you think this is a bug with one of the SPL crates, and not a test panic you're hitting with the example test suite.

from solana-program-library.

Ai-Artsca avatar Ai-Artsca commented on July 20, 2024

Hey @Ai-Artsca you'll have to provide a little context here to describe why you think this is a bug with one of the SPL crates, and not a test panic you're hitting with the example test suite.

I encountered a runtime panic while running the spl-transfer-hook create-extra-metas command from the Solana Program Library (SPL) token transfer-hook example. The error arises due to an unwrapped Result returning an Err value. Below is the command and error output for reference.

../../../target/debug/spl-transfer-hook create-extra-metas HookqC4zUVMzYkVVZiGz9vu13XHc9XTBcqgtMb9yUtHt TokDibMzhbqs833NcxTFq7J6pfb6mB6hhCRiydHCgcv
Error Output

thread 'main' panicked at token/transfer-hook/cli/src/main.rs:447:18:
called Result::unwrap() on an Err value: Downcast { actual: solana_clap_v3_utils::keypair::SignerSource, expected: alloc::string::String }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Context
This issue occurred while attempting to run one of the provided example commands in the SPL token transfer-hook example. It seems the error originates from an incorrect type expectation during unwrapping.

Attempted Resolution
I attempted running the command with RUST_BACKTRACE=1 for a more detailed backtrace, confirming the issue is consistent and replicable:

Backtrace Excerpt

0: rust_begin_unwind
...
15: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
Request for Assistance
Can someone help clarify if this is a bug within the SPL crates, or if there might be a mistake in how the example test suite is being executed? Any guidance on how to properly handle or prevent this panic would be greatly appreciated.

Thank you for your time and assistance!

from solana-program-library.

buffalojoec avatar buffalojoec commented on July 20, 2024

Gotcha! Thanks. I can re-produce your issue. Looks like a bug!

from solana-program-library.

buffalojoec avatar buffalojoec commented on July 20, 2024

Looks like this PR caused the breakage.
#6525

If I revert back to the deprecated functions, everything works fine.

@samkim-crypto have you seen this at all with the new Clap v3 stuff?

from solana-program-library.

samkim-crypto avatar samkim-crypto commented on July 20, 2024

Yeah, sorry about that! The new clap-v3-utils parsers are used when declaring the arguments, but the original incompatible parsers are used when actually parsing the arguments. I think we will need to upgrade to the latest solana-clap-v3-utils = 1.18.11 to fix this, but I'll fix it once we do.

from solana-program-library.

buffalojoec avatar buffalojoec commented on July 20, 2024

Yeah, sorry about that! The new clap-v3-utils parsers are used when declaring the arguments, but the original incompatible parsers are used when actually parsing the arguments. I think we will need to upgrade to the latest solana-clap-v3-utils = 1.18.11 to fix this, but I'll fix it once we do.

Great, thanks! Saw your PR to bump to 1.18.11. Let me know if you need anything!

from solana-program-library.

Ai-Artsca avatar Ai-Artsca commented on July 20, 2024

Thanks again for the help! Could you please specify which version of solana-clap-v3-utils does not have this bug, so I can continue with my tutorial? Also, would updating the cargo.toml file in the cli folder to this version and running cargo update be the correct steps to resolve this issue? Any guidance on the easiest steps to update would be greatly appreciated!

from solana-program-library.

samkim-crypto avatar samkim-crypto commented on July 20, 2024

The fix requires both an upgrade to solana-clap-v3-utils = 1.18.11 (#6624) and the removal of pubkey_of_signer (#6625). The first PR is merged, so you can checkout branch from the second PR and continue with the tutorial. Alternatively, you can also wait until the second PR is also merged to master.

from solana-program-library.

Ai-Artsca avatar Ai-Artsca commented on July 20, 2024

I've updated the main.rs and modified the cargo.toml in the cli folder as discussed, and then ran cargo build for the CLI. Afterward, I executed the following command:

../../../target/debug/spl-transfer-hook create-extra-metas HookSNukpeokYkzRdKwK1d4LYMmNXGPkotw5cwqnwVyz TokkZcu8RTE46yWjF7LMTqqKa6LzTVM438qZDfz3qZH

However, I encountered a new error related to transaction simulation:
error: send transaction: error: send transaction: RPC response error -32002: Transaction simulation failed: Error processing Instruction 1: invalid account data for instruction [7 log messages]

solana config get:
RPC URL: https://api.devnet.solana.com

Could you help me understand what might be causing this new issue? Any advice on how to troubleshoot or correct this would be greatly appreciated. Thank you!

from solana-program-library.

buffalojoec avatar buffalojoec commented on July 20, 2024

Hey @Ai-Artsca the original issue you've reported here has been fixed with #6625, so I'm going to close the issue. The error you're reporting now is not a bug with the CLI, it likely means you need to configure your "extra account metas" account and/or hook program.

Feel free to ask for assistance with the Transfer Hook example on Stack Exchange!

from solana-program-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.