Skip to content

[size-hack] Remove clear account #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2023
Merged

[size-hack] Remove clear account #362

merged 2 commits into from
May 2, 2023

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented May 1, 2023

I need to make to program smaller again. This is one idea.

Everytime we create a new account, we manually zero it.
I think this is and has always been unnecessary. Being able to create non-zero accounts belonging to a given program would break solana.

@guibescos guibescos changed the title Remove clear account [size-hack] Remove clear account May 1, 2023
@guibescos guibescos marked this pull request as ready for review May 1, 2023 22:28
@@ -109,7 +113,6 @@ pub trait PythAccount: Pod {
)?;

check_valid_fresh_account(account)?;
clear_account(account)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth a code comment that the solana runtime guarantees that the account content is all zero here.

(feel free to do in a later pr because i know the CI takes forever here)

@guibescos guibescos merged commit 923e4ae into main May 2, 2023
@guibescos guibescos deleted the remove-clear-account branch May 2, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants