Skip to content
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

test-validator: Cloned program data accounts don't work as expected #522

Closed
acheroncrypto opened this issue Apr 1, 2024 · 2 comments · Fixed by #1706
Closed

test-validator: Cloned program data accounts don't work as expected #522

acheroncrypto opened this issue Apr 1, 2024 · 2 comments · Fixed by #1706

Comments

@acheroncrypto
Copy link

Problem

This is similar to #436 — which was fixed by #501 — however, the fix only includes programs that are cloned using the --clone-upgradeable-program option. If an account is cloned using --clone — which is what Anchor does — the problem of not being able to interact with the programs still persist. Anchor can switch to use --clone-upgradeable-program but it will still be broken on all existing Anchor versions.

Solution

Always set deployment slot of cloned program data accounts to 0.

@jacobcreech
Copy link

@joncinque Any reason not to do the proposed solution? This is one I'm considering bountying out for devex improvements.

@joncinque
Copy link

The solution requires special-casing program data accounts during --clone, which is redundant because that's special-cased with --clone-upgradeable-program, and people should use that instead.

On the flipside, I can't think of a situation where someone would actually want the deployment slot for a program on their solana-test-validator. If they do need it, they can setup more specific test fixtures for their use-case. So yep, I think we can include this!

At the same time, Anchor should probably switch to --clone-upgradeable-program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants