Skip to content

lang: Fix cpi feature instructions not accounting for discriminator overrides#3376

Merged
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:lang-fix-cpi-feature-instructions-not-accounting-for-discriminator-overrides
Nov 20, 2024
Merged

lang: Fix cpi feature instructions not accounting for discriminator overrides#3376
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:lang-fix-cpi-feature-instructions-not-accounting-for-discriminator-overrides

Conversation

@acheroncrypto

Copy link
Copy Markdown
Collaborator

Problem

CPI instruction discriminators do not take into account the potential discriminator overrides from the #[interface] attribute (#2728) or the new custom discriminator support via #[instruction(discriminator = <VALUE>)] (#3137):

https://github.com/coral-xyz/anchor/blob/8ec7ec802a1a7d678b35501cccc7ea80fe24cc86/lang/syn/src/codegen/program/cpi.rs#L20

Summary of changes

  • Fix cpi feature instructions not accounting for discriminator overrides
  • Perform a small refactor to reduce cloning and code duplication of related code

@vercel

vercel Bot commented Nov 20, 2024

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added lang fix Bug fix PR labels Nov 20, 2024
@acheroncrypto acheroncrypto merged commit 94ed4e0 into otter-sec:master Nov 20, 2024
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix PR lang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant