Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@LucasSte
Copy link
Contributor

Problem

We are introducing a new account layout for the SVM. We'll also have "view" structs that do not own the fields for when programs borrow an account. Those structs implement ReadableAccount, but cannot be converted into AccountSharedData without losing references to the underlying data.

Solution

Remove the to_account_shared_data from ReadableAccount.

@LucasSte LucasSte marked this pull request as ready for review October 17, 2025 20:10
@LucasSte LucasSte requested a review from buffalojoec October 17, 2025 20:10
Copy link
Contributor

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

@joncinque can weigh in, but I believe you should do one PR to deprecate it and then another to remove it with the "Breaking" label.

Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

If we remove this from the sdk, then agave won't be able to upgrade to this new version until we replace all the call sites.

What is the migration path for agave?

@LucasSte
Copy link
Contributor Author

If we remove this from the sdk, then agave won't be able to upgrade to this new version until we replace all the call sites.

What is the migration path for agave?

Since the change is simple, I was thinking of bumping the version and upgrading the call sites in the same PR. I can do the latter first if that is what you prefer.

@brooksprumo
Copy link
Contributor

Since the change is simple

I haven't looked at doing this myself, but I think it would be good to update the call sites first and bump the sdk second. This makes a (hopefully unnecessary) revert less painful (in case there are other PRs that build on the sdk bump).

Copy link
Collaborator

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

git grep tells me there are 33 call sites in Agave currently of to_account_shared_data, in accounts-db and runtime. I agree that it's better to add the new method and deprecate the old method first, then remove the old method.

What's the new method, and where will it live?

@LucasSte
Copy link
Contributor Author

What's the new method, and where will it live?

We don't want to allow the conversion to AccountSharedData inside runtime, since we are introducing a new account layout that implements ReadableAccount, but does not allow the conversion.

The idea I discussed with @brooksprumo was to have the new method internal to accounts-db.

I agree that it's better to add the new method and deprecate the old method first, then remove the old method.

Sure, I'll create the new method and remove the old usages first.

@brooksprumo
Copy link
Contributor

Yeah, I think in accounts-db is the right place.

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.

5 participants