Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
3
votes
Accepted
Working with the OptionSerializer
You were very close! OptionSerializer implements From on Option: https://docs.rs/solana-transaction-status/1.14.7/solana_transaction_status/option_serializer/enum.OptionSerializer.html#impl-From%3COp …
3
votes
Accepted
Why does Solana Dev Team always add `#[repr(C)]` to structs and enums
As the answer mentions, the Rust team reserves the right to change what repr(rust) means at any time, so structs that use repr(rust) do not have a stable layout in memory. … Otherwise, if a program is upgraded between two versions of Rust with a breaking change to repr(rust), it might not be able to deserialize its own account data. …
2
votes
Accepted
Only want to initialize the second function if the first one is satisfied the statement
If you want them to be dependent on each other, you'll need to include both of them in the same instruction, meaning:
#[program]
mod hello_anchor {
use super::*;
pub fn init_all(ctx: Context<I …
1
vote
Modified RPC node
There's no way to cut down on hardware requirements for the node, but there are many services that rent nodes out if you need.
In the longterm, the best option is to use a Geyser plugin, but the ecosy …
1
vote
Accepted
how to get transaction hash status & signer details using rust anchor framework
You mention the Rust Anchor Framework, but that's only used for on-chain programs. If you're trying to fetch a past transaction, you don't need Anchor, just the JSON RPC API. …
1
vote
Accepted
Not tradable custom SPL-token
If you want to manage the tokens entirely, you can go with the managed-token approach, which keeps the token frozen at all times, and must pass through your program, which thaws, does something (burn …
1
vote
How do equality proofs work mathematically?
Your best bet is to read through the confidential token documentation, which provides all of the required proofs and further documentation.
Here's the documentation on the equality proofs: https://spl …
3
votes
Why does rebuilding programs with `cargo build-bpf` take so long in a workspace?
In normal cases, the build artifacts are cached, like with normal cargo.
For example, if you try to build the SPL token program at https://github.com/solana-labs/solana-program-library/tree/master/tok …
1
vote
sum of account balances before and after instruction do not match
Make sure that player has at least bet_amount, otherwise you'll be doing an overflowing subtraction, which means that you could be setting player's lamports to a huge number close to u64::MAX!
Also, b …
2
votes
Program logged: "Error: memory allocation failed, out of memory"
When you use a vector in your program, you're using the heap provided by the runtime, which maxes out at 32KB.
So when you keep pushing to data, you can eventually run out of heap space. Normally, the …
1
vote
Accepted
Here i want to serialize and deserialize the Tree struct but the not able to do
The MerkleTree in your Tree struct also needs to implement the BorshSerialize and BorshDeserialize traits in order to work.
You may need to create a new struct that can convert between the external Me …
1
vote
cannot transmute between types of different sizes, or dependently-sized types
This is a guess, since the error message is confusing, but you should try to make sure that your type aligns on an address of 1 using arrays, ie:
#[zero_copy]
#[repr(C)]
#[derive(Debug, Default)]
pub …
1
vote
Accepted
Set And Verify Sized Collection Item in Solana Rust
The error that you're getting is unfortunately a bit vague: Data type mismatch: https://github.com/metaplex-foundation/mpl-token-metadata/blob/64ba3cb8937dff668a5e1926d3beaf694ea6f3dc/programs/token-m …
1
vote
After I add mpl-token-metadata I'm not able to build the program
You're seeing this error because of a breaking change in the Solana SDK in version 1.16. The older versions of mpl-token-metadata don't support 1.16 yet, so mixing them will cause build errors.
In the …
0
votes
Accepted
TpuClient.send_transaction gets dropped occasionally
This is totally normal unfortunately. If you're using the TPU client directly, then you're sending the transactions directly to the leader to try and get your transaction included in the block.
Your T …