Questions tagged [space]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
19 views

How to have PDA space size depending on instruction argument

I'm using anchor, so I define the space attribute in the Accounts struct, is there a way to make it depend on the instruction arg ? It's for a PDA storing a string, and I don't know string length ...
FluffyMuffin47's user avatar
0 votes
0 answers
38 views

How can I dynamically increase storage space for a program deployed on Solana using Solang?

I have a program that utilizes arrays and mappings, potentially requiring significant storage space. Is there a mechanism to dynamically augment the storage space of the account that deployed the ...
Tiago Soriano's user avatar
1 vote
1 answer
73 views

How to calculate space for an account dynamically using remaining_accounts

Is it possible to allocate space to an account based on account provided in remaining_accounts? I want to allocate enough space to store public key of the accounts provided in remaining_accounts in a ...
onurhb's user avatar
  • 113
4 votes
1 answer
79 views

How to allot 1 bit space for boolean in Anchor program?

Anchor requires the allotment of 1 byte of space for a boolean value even though only 1 bit is required. Is there a way to use only 1 bit for booleans while still using Anchor for the serialization/...
CryptoSar's user avatar
  • 389
2 votes
1 answer
108 views

Managing Space in the Zero Account

I am looking to use zero account (Anchor) for the first time in my program. I have read the example and from the look of it, it doesn't require the space constraint like init does. I wanted to use a ...
0xShuk's user avatar
  • 1,884
3 votes
1 answer
1k views

How can I determine a current size of Solana blockchain

I've seen a few discussions pointing out that in a year Solana's ledger grows up by ~2Tb. However, Solana produces ~2 blocks per second with an average size of 1.5Mb (taken from getBlock RPC request), ...
RowanStone's user avatar
3 votes
1 answer
102 views

What is the recommended way to calculate a account size, using sizeof or manually calculating it

As the title states, which method is recommended to calculate the size assuming types are non -zero copy hence alignment calculation is not needed or is the type aligned per say in this situation ...
Nabeel Naveed's user avatar
7 votes
1 answer
266 views

Is there a way to resize an account's data field?

I am pretty sure I remember reading somewhere that once the space is allocated for an account, it cannot be changed. Is this true? If so, can you delete the account and re-initialize it with a ...
TovarishFin's user avatar
8 votes
1 answer
277 views

How can I increase an existing account size?

ie. Initialize account with 255 byte space. Pay to double the space through anchor.
user2892730's user avatar