svm-warp-program-upgrade
Skill76 starsChanged 20 days agoApache-2.0View on GitHub
Upgrade a deployed Sealevel warp-route token program (collateral/synthetic/native/cross-collateral) or IGP program to a newer on-chain contractVersion — most commonly to move an existing route onto a fee-enabled program build. The upgrade runs as part of hyperlane warp apply: when the expected contractVersion in the compiled program config differs from the on-chain version AND program bytes are supplied, the SVM token module calls prepareProgramUpgrade (typescript/svm-sdk/src/deploy/program-upgrade.ts) before its config-update step. prepareProgramUpgrade (verify against source before relying on details): So the run splits…
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
If any of these is missing, ask before proceeding.
- Very specific: line 58
Read the deployed program's config to capture the current contractVersion and confirm it is older than the target, so you can show the user …
- Distinctive: line 66
Use the Solana CLI to read the program's upgrade authority — whether it's immutable and who can sign the upgrade:
- Very specific: line 92
If the upgrade authority differs from the submitter key, supply a strategy with a file submitter for the Sealevel chain so the authority …
- Very specific: line 111
Stop it per /stop-http-registry, even on failure.
- Distinctive: line 116
Immutable programs can't be upgraded: If there's no upgrade authority, stop and escalate.
- Very specific: line 118
Version bump alone is inert: If the config carries a new contractVersion but no program bytes, prepareProgramUpgrade never runs a binary …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SVM Warp Program Upgrade
Upgrade a deployed Sealevel warp-route token program (collateral/synthetic/native/cross-collateral) or IGP program to a newer on-chain contractVersion — most commonly to move an existing route onto a fee-enabled program build.
The upgrade runs as part of hyperlane warp apply: when the expected contractVersion in the compiled program config differs from the on-chain version AND program bytes are supplied, the SVM token module calls prepareProgramUpgrade (typescript/svm-sdk/src/deploy/program-upgrade.ts) before its config-update step.
When to Use
- "upgrade the solanamainnet
<TOKEN>warp program to the fee-enabled version" - "bump the SVM IGP program to vX"
- "warp check says contractVersion mismatch on eclipsemainnet — upgrade it"
- Any request to migrate a deployed Sealevel warp/IGP program to a newer program build
What the Upgrade Actually Does
prepareProgramUpgrade (verify against source before relying on details):
- Version compare. Reads on-chain
contractVersion, compares to expected. Equal → no-op (returns null). Expected older → throws (no downgrades). Expected newer → proceeds. - Immutable check. Reads the program's upgrade authority. If the program has none (immutable), it asserts/throws — cannot upgrade.
- Extend program-data if needed. Computes
additionalBytes = newProgramBytes.length - currentMaxProgramLen. If> 0, emits a singleExtendProgramCheckedinstruction (getExtendProgramCheckedInstruction, loader.ts) sized to exactly the deficit. The checked variant is required on Agave 3.0+ (enable_extend_program_checkedgate). No fixed padding amount — it extends by exactly what the new binary needs. - Buffer create + write. Creates a buffer account and writes the new program bytes using the submitter/payer key (executed immediately; no upgrade authority needed for this part).
- Transfer buffer authority to the upgrade authority if payer ≠ upgrade authority.
- Emit the upgrade instruction as an authority transaction — this and the extend require the upgrade authority to sign.
So the run splits into two groups:
- Payer-executed immediately: buffer create/write (+ optional buffer-authority transfer).
- Authority transactions (need the upgrade authority signature):
ExtendProgramChecked(if any) + theUpgradeinstruction. These are surfaced asAnnotatedSvmTransactions. If the upgrade authority == the submitter key,warp applysubmits them; otherwise they are written for the authority to sign (e.g. via afilesubmitter / Squads).
Inputs
- Warp route ID (e.g.
USDC/solana-...) — required. - Chain(s) — which Sealevel chain(s) to upgrade.
- Submitter key for the chain (
--key.sealevel) — funds/writes the buffer. - Upgrade authority — who signs the extend + upgrade. If it is not the submitter key, expect a
file/Squads submitter and plan to route the authority txs to the owner. - Confirmation that the compiled config carries the new program bytes and the target
contractVersion(this is what the deploy/config pipeline resolves; a version bump without program bytes does nothing).
If any of these is missing, ask before proceeding.
Execution Flow
Step 1 — Start the HTTP registry
The upgrade needs private RPC overrides for the Sealevel chain, and the read/apply below target it. Start it per /start-http-registry with --writeMode (the upgrade persists on-chain), before the read so every command hits the same registry. Note the port + task ID.
Step 2 — Read current version and upgrade authority
Read the deployed program's config to capture the current contractVersion and confirm it is older than the target, so you can show the user current vs expected version.
cd <MONOREPO_ROOT>/typescript/cli && pnpm hyperlane warp read \
--registry http://localhost:<port> \
-w <WARP_ROUTE_ID>Use the Solana CLI to read the program's upgrade authority — whether it's immutable and who can sign the upgrade:
solana program show <PROGRAM_ID> # "Authority" field; "none" = immutableConfirm:
- expected version > current version (equal = nothing to do; expected older = will throw)
- the program has an upgrade authority (not immutable)
- who the upgrade authority is (submitter vs external owner)
Step 3 — Run the upgrade
Apply writes the new program bytes to a buffer account (spending SOL) while it builds the transactions, so running it is itself the spending action — confirm the version transition from Step 2 with the user first.
cd <MONOREPO_ROOT>/typescript/cli && pnpm --silent hyperlane warp apply \
--registry http://localhost:<port> \
--key.sealevel "$SEALEVEL_KEY_VAR" \
[--strategy ~/.hyperlane/strategies/<owner>-strategy.yaml] # if authority != submitter
--receipts-dir /tmp/<route>-svm-upgrade-txs \
-w <WARP_ROUTE_ID> \
--yesIf the upgrade authority differs from the submitter key, supply a strategy with a file submitter for the Sealevel chain so the authority (extend + upgrade) transactions are written out for the owner to sign.
The run annotates Extend <label>: +N bytes and Upgrade <label>: <old> → <new> — show these to the user. If no upgrade annotation appears, the version already matches or no program bytes were supplied — stop and report that. Buffer create/write is executed immediately by the submitter key; the extend + upgrade either execute (authority == submitter) or land in the receipts dir for the owner to sign.
Step 4 — Verify
Re-read the program and confirm on-chain contractVersion now equals the target. If the authority txs were written to a file, the version will only change after the owner executes them — say so explicitly.
cd <MONOREPO_ROOT>/typescript/cli && pnpm hyperlane warp read \
--registry http://localhost:<port> -w <WARP_ROUTE_ID>Step 5 — Recreate ALTs
A program upgrade can change the account set for transfers. After any successful upgrade, recreate the SVM Address Lookup Tables for the route — run /svm-warp-alt-manage (hyperlane warp alt create). Then hyperlane warp alt check to confirm no drift.
Step 6 — Stop the HTTP registry
Stop it per /stop-http-registry, even on failure.
Caveats
- No downgrades. Expected version older than on-chain → hard error. Don't try to "roll back" via this path.
- Immutable programs can't be upgraded. If there's no upgrade authority, stop and escalate.
- Two-key reality. The submitter/payer key pays for and writes the buffer; the upgrade authority must sign the extend + upgrade. These are frequently different (owner = Squads multisig). Plan for a
filesubmitter and owner execution. - Version bump alone is inert. If the config carries a new
contractVersionbut no program bytes,prepareProgramUpgradenever runs a binary upgrade — only the config-update path. Ensure the program build/bytes are wired in. - Extend sizing is exact, computed from the new binary vs current program-data capacity; it is not a fixed 10 KiB. If the binary shrank or fits, no extend instruction is emitted.
- Always follow with ALT recreation (Step 5) — stale ALTs after an account-layout change cause transfer failures.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-registry-changesetSkill
- build-docker-imageSkill
- classify-onchain-ownerSkill
- code-reviewSkill
- debug-messageSkill
- debug-rpc-providerSkill
- debug-validator-checkpoint-inconsistencySkill
- denylist-stuck-messagesSkill
- fetch-linear-ticketSkill
- fetch-safe-tx-batchSkill
- find-docker-imageSkill
- fix-merkle-root-mismatchSkill
- fix-rpc-urlsSkill
- gcp-logsSkill
- hyperlane-message-utilsSkill
- hyperlane-utilsSkill
- inline-pr-commentsSkill
- investigate-merkle-root-mismatchSkill
- investigate-stuck-messagesSkill
- registry-yaml-sort-policySkill
- security-reviewSkill
- self-relay-hyperlane-messageSkill
- set-moonpay-standing-quotesSkill
- start-http-registrySkill
- stop-http-registrySkill
- svm-warp-alt-manageSkill
- tob-reviewSkill
- verify-warp-contractsSkill
- warp-balancesSkill
- warp-deploy-fund-deployerSkill
- warp-deploy-init-routeSkill
- warp-deploy-nexusSkill
- warp-deploy-register-routeSkill
- warp-deploy-select-keysSkill
- warp-deploy-send-testSkill
- warp-deploy-update-ownersSkill
- warp-deploy-validate-ownersSkill
- warp-forkSkill
- warp-key-value-expansionSkill
- warp-manage-offchain-quotesSkill
- warp-route-checkSkill
- warp-run-logSkill
- warp-simulate-svm-txsSkill
- warp-update-extendSkill
- warp-update-proposeSkill
- warp-update-resolve-artifactsSkill
- warp-updateSkill
- warp-verify-onchain-configSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

