Skip to content

fix(cli): validate deploy program id keypair match#4694

Open
fallintoplace wants to merge 1 commit into
otter-sec:masterfrom
fallintoplace:fix/program-id-keypair-assertion
Open

fix(cli): validate deploy program id keypair match#4694
fallintoplace wants to merge 1 commit into
otter-sec:masterfrom
fallintoplace:fix/program-id-keypair-assertion

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • Treat --program-id as an assertion when anchor program deploy also receives --program-keypair.
  • Reject mismatched values before RPC, wallet, or deployment work starts.
  • Keep the existing explicit error for --program-id without --program-keypair and add focused tests for both cases.

Why

The native deploy path loaded the requested program keypair and then unconditionally used that keypair pubkey as the target program ID. That meant a command with --program-id X --program-keypair Y silently targeted Y, even if the user was expecting X.

Validation

  • cargo fmt --package anchor-cli
  • cargo test -p anchor-cli program_id
  • cargo test -p anchor-cli program::tests::

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@fallintoplace is attempting to deploy a commit to the OtterSec Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant