How to Test a Solana Program Upgrade Against Its Known Callers
Contents
A successful transaction can still break a caller's expectations.

Overview. Two callers use one provider program through CPI calls; after it changes from B0 to B1, Caller A's exact-change requirement is violated and Caller C's increase requirement holds.
A successful call can still break an integration
Picture a vending machine that still works. You press the button and something drops, but now it drops two cans, and your bookkeeping assumed one. The machine worked; it just didn't do what you assumed. The experiment below is a small Solana version of it.
A successful Solana transaction isn't the same as a compatible one. A cross-program invocation (CPI) is one program calling an instruction on another. Programs are often built by different teams, and the caller relies on the result in its own logic, so a provider can change underneath an application it doesn't maintain.
My earlier post covers the formal method; this one explains the problem and what to do about it.
I ran a controlled example in LiteSVM, a local in-process Solana test environment. The provider's reference version (B0) left a counter at 3; its candidate version (B1) left it at 6. Program identity, instruction bytes, account privileges, starting state, and requested delta (3) were identical, and every test transaction and its CPI returned successfully.
For a consumer that expected the counter to move by exactly three, B1 changed what a successful call means. Transaction status can't show that, and the provider may not know the assumption exists.
Fig. 1. Controlled fixtures: two consumers call one provider through CPI, and B0 → B1 is the verified version change. The callouts mark what I would review before changing it.
Before changing a provider, I would check four things: the call still has the account privileges it needs, the instruction data still has the expected shape, existing state is still readable (or migrated), and each known consumer still gets the result it relies on.
A missing account, too few privileges, or malformed data usually makes execution fail. A semantic change is quieter. The call runs, writes valid state, and still breaks a consumer's rule.
The same provider result, two different answers
Two compiled consumer fixtures called the provider, each in a fresh LiteSVM instance.
Caller A requires that, starting from zero with a requested delta of three, the final value be three. Caller C only requires that the value increase.
Postcondition::ExactDelta => after == before + delta, // Caller A
Postcondition::MonotonicIncrease => after > before, // Caller CThe full evaluator is in the earlier post.
The same B1 breaks Caller A's declared requirement and satisfies Caller C's. Same program ID, same successful status, opposite answers.
It helps to separate three questions. Reachable: can the call reach the provider at the expected program ID? Executable: does the transaction run to completion? Compatible: does the result match what this caller assumed? Transaction status only answers the first two. I borrowed these terms from the earlier post, which defines them formally.
The counter is deliberately small. A version closer to real money: a provider quotes 100 and, after an upgrade, charges 103. Caller A accepts exactly 100, so it fails. Caller C accepts anything up to 105; Caller D accepts any positive amount. Both pass. Each requirement is a range of acceptable results, and the same 103 lands inside some ranges and outside others. The earlier post runs this case too.
Why this can happen on Solana
Solana programs act like shared libraries: many applications call the same deployed program. An upgradeable program can be replaced by its upgrade authority while keeping the same program ID, and a CPI names its target by program ID, so a caller gets whatever code is deployed there when it runs. Revoking the authority makes a program immutable. Callers' assumptions, meanwhile, are usually unwritten, so the provider can't see them. This is Hyrum's Law at work, and it applies to any upgradeable API: with enough users, every observable behavior of a system will be depended on by somebody.
What you can do today
If you call a program, check whether it is upgradeable and who holds the upgrade authority: solana program show <PROGRAM_ID> lists an Authority field. If the program is immutable, its behavior won't change under you; if not, know who can change it. Then write your assumption down as an explicit assertion, the way Caller A's exact-delta check does.
With one caller, an ordinary LiteSVM assertion is enough; an explicit postcondition catches Caller A's failure. With several consumers (say, a rewards program where one team expects an exact balance change and another only an increase), ask each what it relies on, collect those requirements, and run all of them against the candidate before upgrading. That shows which integration breaks, not just whether the suite passed. The same approach works for an instruction-format change or a state migration.
That's the idea behind my compatibility checker: a consumer's requirement lives in a small contract.toml — it names the consumer, the dependency, and the postcondition — and the checker runs those requirements against a candidate upgrade. The design goal is for each consumer to keep its own file, like a plugin the provider runs before upgrading. It's an early prototype; the earlier post shows how it works.
The checker only knows the requirements I give it. B0/B1 and Callers A/C are controlled fixtures, and I wrote their requirements. They ran locally, not as a replay of a public upgrade, and the checker doesn't replace integration tests. But when another team depends on your program, a green transaction says it ran—not which assumptions held.
