3

I've written a on-chain program with Rust and compile it via cargo build-sbf. Then I check the size of the .so file, it's 156960 bytes.

After I deploy it on devnet via solana program deploy, I check its size on Solana Explorer, and the size of the executable data account is 313965 bytes! Almost doubled. I'm wondering why.

Here is the program account, and here is the program data account.

1 Answer 1

4

The solana CLI over allocates the account so you can upgrade your program without having to resize the account. Historically it has been useful since the possibility to resize program accounts is relatively new.

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.