Skip to content

idl: Disallow multiple error definitions#4300

Merged
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:idl-disallow-multiple-error-definitions
Mar 12, 2026
Merged

idl: Disallow multiple error definitions#4300
acheroncrypto merged 3 commits into
otter-sec:masterfrom
acheroncrypto:idl-disallow-multiple-error-definitions

Conversation

@acheroncrypto

@acheroncrypto acheroncrypto commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

Having multiple error definitions is not supported, but you don't get any errors when you do have them. Instead, the compiler chooses one of the definitions and discards the rest.

Summary of changes

Make having multiple error definitions a hard error during IDL generation.

Progress

  • Add multiple-errors tests that checks for the desired behavior (error when there are multiple error definitions i.e. enums with #[error_code]) (CI):

    1) multiple-errors
         Returns 'multiple errors' error on builds:
       Error: No error on build
    
  • Disallow multiple error definitions

Fixes #3532

@vercel

vercel Bot commented Mar 9, 2026

Copy link
Copy Markdown

@acheroncrypto is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added breaking idl related to the IDL, either program or client side fix Bug fix PR labels Mar 9, 2026
@acheroncrypto acheroncrypto marked this pull request as ready for review March 10, 2026 03:47
@nutafrost nutafrost moved this to Security Review Required in Anchor 1.0 Mar 11, 2026
@acheroncrypto acheroncrypto merged commit 05cd028 into otter-sec:master Mar 12, 2026
168 of 173 checks passed
@github-project-automation github-project-automation Bot moved this from Security Review Required to Done in Anchor 1.0 Mar 12, 2026
@acheroncrypto acheroncrypto mentioned this pull request Mar 13, 2026
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

breaking fix Bug fix PR idl related to the IDL, either program or client side

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDL generation is not stable.

3 participants