Comments (10)
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.
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.
Gotcha! Thanks. I can re-produce your issue. Looks like a bug!
from solana-program-library.
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.
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.
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.
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.
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.
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.
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)
- transfer-hook: Unable to use seed to generate an ExtraAccountMeta that isn't a PDA HOT 4
- Cannot close frozen token account because of its assets. HOT 1
- Suggestion: Add new authority for 'spl-token withdraw-excess-lamports' HOT 3
- Suggestion : disable transfering tokens between same token accounts HOT 2
- Suggestion: customized token gas fee
- Feature Proposal: Confidential Mint & Burn Extension HOT 7
- Feature Proposal: Confidential Permanent-Delegate Extension HOT 1
- Unable to withdraw withheld fees for a Token-2022 contract with 1% Transfer Fees HOT 3
- Customized token gas fee
- `2.0.0` `solana-program` release causing issues due to `<=2.0.0` on patch upgrades. HOT 26
- Question/Bug: Solana 1.18.17 crates don't build | Spl-pod 0.1.0 needed for older version of solana HOT 6
- Question (Bug?): Upgrade of @solana/spl-token from 0.4.6->0.4.7 throws ERR_REQUIRE_ESM error HOT 4
- createMint Throwing TypeError: Cannot read properties of null (reading 'toBuffer') HOT 2
- Feature: Allow permanent delegate to close ata's for mint HOT 2
- @solana/[email protected] causing ESM import errors HOT 1
- Token Account HOT 1
- Issue: `invoke_transfer_checked` failed with out of memory for 2 transfers with hook HOT 3
- getOrCreateAssociatedTokenAccount throws error despite payer has enough SOL and account exists already. HOT 1
- Getting 'error: failed to compile `spl-token-cli v4.0.0`, intermediate artifacts can be found...' HOT 2
- token-cli: `set-transfer-fee` has different granularity than `create-token`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solana-program-library.