Runtime: Expose builtin program IDs to crate#318
Merged
buffalojoec merged 2 commits intoanza-xyz:masterfrom Mar 22, 2024
Merged
Runtime: Expose builtin program IDs to crate#318buffalojoec merged 2 commits intoanza-xyz:masterfrom
buffalojoec merged 2 commits intoanza-xyz:masterfrom
Conversation
Author
|
A case can be made for making this method completely public, as suggested in #316. |
CriesofCarrots
left a comment
There was a problem hiding this comment.
One comment about the metric name. Otherwise this lgtm.
However, it would be good to confirm with @Lichtso that we aren't missing some rationale for removing a similar bank method in solana-labs#31654 (aside from the convenience of using the static list directly).
b451c9f to
34308e2
Compare
This was referenced Mar 21, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #318 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 838 838
Lines 226927 226934 +7
=========================================
- Hits 185901 185899 -2
- Misses 41026 41035 +9 |
CriesofCarrots
approved these changes
Mar 21, 2024
There was a problem hiding this comment.
Wfm, but please check in with @Lichtso /the runtime team before merge.
Lichtso
approved these changes
Mar 22, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is chunk 2/7 of the broken-up PR #79.
Problem
As we prepare to migrate builtin programs to Core BPF, it's important to decouple
components such as snapshot minimization from the static
BUILTINSlist.By adding a crate-only method to
Bankthat will allow a caller to immutablyborrow the bank's list of builtin program IDs, other runtime components can
get the bank's current list of supported builtins.
Summary of Changes
Two commits:
builtin_programsfield tobuiltin_program_idssince the term "builtin" is heavily overloaded as it is, and this field is only the IDs, not theBuiltinPrototypeelements, as seen elsewhere inbank.rs.get_builtin_program_ids(&self) -> &HashSet<Pubkey>on the bank and use it in the snapshot minimizer.