Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk: add Immutable and IncorrectAuthority to ProgramError #35113

Merged

Conversation

buffalojoec
Copy link
Contributor

Problem

Two error variants from solana_sdk::instruction::InstructionError are used in the Address Lookup Table's processor. However, as we prepare to port this program to BPF, we will require these error counterparts to exist in solana_program::program_error::ProgramError.

Variants:

  • InstructionError::Immutable
  • InstructionError::IncorrectAuthority

Summary of Changes

Add the variants to solana_program::program_error::ProgramError.

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (99760e5) 81.6% compared to head (ba2a416) 81.6%.
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #35113     +/-   ##
=========================================
- Coverage    81.6%    81.6%   -0.1%     
=========================================
  Files         830      830             
  Lines      224955   224963      +8     
=========================================
- Hits       183752   183728     -24     
- Misses      41203    41235     +32     

@buffalojoec buffalojoec added the v1.18 PRs that should be backported to v1.18 label Feb 6, 2024
Copy link
Contributor

mergify bot commented Feb 6, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

@buffalojoec buffalojoec merged commit 3ddd235 into solana-labs:master Feb 7, 2024
46 checks passed
mergify bot pushed a commit that referenced this pull request Feb 7, 2024
buffalojoec added a commit to solana-program/address-lookup-table that referenced this pull request Mar 13, 2024
This PR introduces the Core BPF implementation of Address Lookup Table.

There are a few caveats with the implementation so far. You can find them in the
source code by searching for comments prefixed with:

```
[Core BPF]:
```

The following caveats will be solved in the next Solana release, and a
discussion can be had for backporting any of these changes:

- `InstructionError::Immutable` has no `ProgramError` counterpart
  ([#35113](solana-labs/solana#35113)).
- `InstructionError::IncorrectAuthority` has no `ProgramError` counterpart
  ([#35113](solana-labs/solana#35113)).
- `solana-program-test` will not overwrite a builtin if the BPF program you've
  provided shares the same address as an existing builtin
  ([#35233](solana-labs/solana#35233)).

The following caveat seems to be unavoidable:

- The `build.rs` script and annotations in `lib.rs` are required for 
  `solana-frozen-abi-macro` (See #3).

Finally, I've implemented a cooldown period based on `Clock`, but this will
likely not be sufficient. I think we should consider merging this initial
implementation and leaving #1 unfinished until the proper research is completed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.18 PRs that should be backported to v1.18
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants