coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

cli: Fix upgradeable program clones #3010

Closed acheroncrypto closed 3 weeks ago

acheroncrypto commented 4 weeks ago

Problem

Upgradeable program clones e.g.

[test.validator]
url = "https://api.mainnet-beta.solana.com"

[[test.validator.clone]]
address = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"

broke after https://github.com/solana-labs/solana/pull/34407 (since 1.17.12), and there was a fix in https://github.com/anza-xyz/agave/pull/501 (1.18.10), but it requires using the new --clone-upgradeable-program option, and doesn't work if you use --clone (which is what Anchor does currently).

Upstream issue: https://github.com/anza-xyz/agave/issues/522

Summary of changes

Use the new --clone-upgradeable-program option when the given account in Anchor.toml is owned by the BPF Upgradeable Loader program.

Note

This requires solana-cli >=1.18.10 since the implementation was broken before that version.

You can load the program binary directly as a workaround to this issue:

solana program dump <ADDRESS> <PATH>

and in Anchor.toml:

[[test.genesis]]
address = <ADDRESS>
program = <PATH>
vercel[bot] commented 4 weeks ago

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.