Skip to main content
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
Results tagged with
Search options answers only not deleted user 255
1 vote

Transaction too large

You don't really get a lot of bytes to play around with in the transaction, 1280 bytes, so if you're trying to pass in 7 game objects, each 118 bytes and 8 pubkeys, each 32 bytes, then you probably sh …
Henry E's user avatar
  • 2,949
1 vote

When to use UncheckedAccount in our program

The simple answer is that you're never supposed to use unchecked_account. The more complicated answer is that sometimes you're forced to use it because the account you're accessing doesn't conform to …
Henry E's user avatar
  • 2,949
1 vote

Anchor's `init_if_constraint` for the optional initialization of Accounts?

There is a new feature coming in v26 which you probably would want to check out. https://github.com/coral-xyz/anchor/pull/2101 They're called optional accounts. It should allow you to just omit an acc …
Henry E's user avatar
  • 2,949
0 votes

How can I create a PDA account dynamically or conditionally

It's best to have a separate functions for initializing accounts / PDAs using those accounts / PDAs Then typically you leave it up to your front end / client code to check whether or not it needs to …
Henry E's user avatar
  • 2,949
5 votes

can there be two signers in an anchor CPI

Yes, you can have multiple PDA signers. If you notice when passing in a single seed normally, it's wrapped in another array. This extra array allows you to pass in multiple seeds. It looks something l …
Henry E's user avatar
  • 2,949
2 votes
Accepted

Simultaneos transactions can cause race conditions in solana programs?

Because the update_counter function doesn't take an argument, only an account, each transaction in the same block will just increment the counter by 1. So if you call 5 update_counter instructions / t …
Henry E's user avatar
  • 2,949