0

I wanted to know if I can modify the Pda owned by the same program when not mentioned in the account struct.

what i want to do is modify several PDAs at once like more than 50, So I can't pass more than 32 account keys. Is there any idea on how to do that?

1 Answer 1

2

Currently Solana supports accessing at most 64 accounts per transaction meaning your ask of 50 PDAs falls within that. I assume you mentioned 32 accounts because that's how many accounts fit into a transaction at most if you directly refer to them by their pubkey. The way to get around that, is to use a LUT to compress some of your accounts to only requiring 1 byte in your transaction. Check out this article for more info on using LUTs.

3
  • Thanks for the reply, But the account lookup table only stores the pubkey of the pda, If i want to modify its data, How can i Do that? Commented Apr 22 at 6:39
  • Exactly the same way: When you build a transaction without a LUT you just, specify the pubkey of your PDA as well. In this case you do everything the same EXCEPT that you specify the pubkey using a byte referring to an index in a LUT containing your PDA. Solana handles the rest i.e. fetching the LUT and byte and turning that into the data your program expects.
    – McBain
    Commented Apr 22 at 9:24
  • can you share a example of that, I want to do that for 250 PDAs, Commented Apr 22 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.