Skip to content

cli: add command to cancel in-flight SVM ownership transfer#864

Open
kcsongor wants to merge 2 commits into
mainfrom
cli/cancel-ownership-transfer
Open

cli: add command to cancel in-flight SVM ownership transfer#864
kcsongor wants to merge 2 commits into
mainfrom
cli/cancel-ownership-transfer

Conversation

@kcsongor

Copy link
Copy Markdown
Contributor

The Solana contract implements a 2-step ownership transfer whereby the new owner has to claim ownership. If for whatever reason the previous owner wants to cancel the transfer, they can do so by invoking the claim ownership instruction themselves. This PR exposes a convenience CLI function to execute that transaction.

@kcsongor
kcsongor force-pushed the cli/cancel-ownership-transfer branch from 2128c01 to 1e65e36 Compare May 20, 2026 01:56
@tonyjin
tonyjin requested review from bengtlofgren, evan-gray and kev1n-peters and removed request for bengtlofgren May 20, 2026 04:15
Comment on lines +494 to +509
const tx = new Transaction().add(ix);
tx.feePayer = payerKeypair.publicKey;
const { blockhash, lastValidBlockHeight } =
await connection.getLatestBlockhash();
tx.recentBlockhash = blockhash;
tx.sign(payerKeypair);

const signature = await connection.sendRawTransaction(
tx.serialize()
);
console.log(`Transaction signature: ${signature}`);
console.log(`Waiting for finalization...`);
await connection.confirmTransaction(
{ signature, blockhash, lastValidBlockHeight },
"finalized"
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

consider using signSendWait like the rest of the CLI

solanaNtt.program,
solanaNtt.pdas
);
if (refreshed.pendingOwner === null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder how useful this sanity check is afterwards - it could possibly read stale state from a load balanced endpoint but maybe unlikely and worth keeping.

Comment thread cli/src/commands/push.ts
import { options, EXCLUDED_DIFF_PATHS } from "./shared";
import { pullDeployments, checkConfigErrors, pushDeployment } from "../index";

function hasPendingChanges(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems like it'd be worth some unit tests?

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.

4 participants