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

Deprecate is_builtin_key_or_sysvar function #788

Merged
merged 4 commits into from
Apr 16, 2024

Conversation

jstarry
Copy link

@jstarry jstarry commented Apr 13, 2024

Problem

The public is_builtin_key_or_sysvar function uses static lists of sdk keys and should be removed in favor of using the new ReservedAccountKeys struct.

Summary of Changes

  • Deprecated is_builtin_key_or_sysvar
  • Updated is_maybe_writable methods to accept an optional set of reserved keys. The reason it's optional is so that clients can opt out of providing the reserved key set if they don't care about it. Note that this method isn't to be used by the runtime so there's no need to enforce that a reserved key set is passed.

Breaking Changes

  • v0::Message::is_maybe_writable has an additional param for passing reserved account keys
  • VersionedMessage::is_maybe_writable has an additional param for passing reserved account keys

Fixes #

@codecov-commenter
Copy link

codecov-commenter commented Apr 13, 2024

Codecov Report

Attention: Patch coverage is 97.43590% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 81.8%. Comparing base (2c0bea0) to head (f86c195).
Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #788     +/-   ##
=========================================
- Coverage    81.9%    81.8%   -0.2%     
=========================================
  Files         851      851             
  Lines      231480   231678    +198     
=========================================
- Hits       189728   189580    -148     
- Misses      41752    42098    +346     

@jstarry jstarry requested review from joncinque and CriesofCarrots and removed request for joncinque April 13, 2024 10:53
@jstarry jstarry force-pushed the deprecate-is-builtin branch from a191136 to deda637 Compare April 13, 2024 11:52
Copy link

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

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

Generally lgtm. Just one small thought to make is_account_maybe_reserved() more readable to my brain.

sdk/program/src/message/legacy.rs Outdated Show resolved Hide resolved
Copy link

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks good to me overall! Just a couple of questions

sdk/program/src/message/legacy.rs Outdated Show resolved Hide resolved
sdk/program/src/message/legacy.rs Outdated Show resolved Hide resolved
sdk/program/src/message/versions/v0/mod.rs Outdated Show resolved Hide resolved
@jstarry jstarry force-pushed the deprecate-is-builtin branch from deda637 to 2c1a280 Compare April 15, 2024 22:38
@jstarry jstarry merged commit 2e91155 into anza-xyz:master Apr 16, 2024
48 checks passed
@jstarry jstarry deleted the deprecate-is-builtin branch April 16, 2024 02:03
michaelschem pushed a commit to michaelschem/agave that referenced this pull request Apr 20, 2024
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