forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init builtins crate * port over migration configs * port over prototypes * port over builtins list * runtime: remove unnecessary dependencies * update crate comment * add some more doc comments
- Loading branch information
1 parent
2705f5e
commit 6c6c26e
Showing
16 changed files
with
594 additions
and
491 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[package] | ||
name = "solana-builtins" | ||
description = "Solana builtin programs" | ||
documentation = "https://docs.rs/solana-builtins" | ||
version = { workspace = true } | ||
authors = { workspace = true } | ||
repository = { workspace = true } | ||
homepage = { workspace = true } | ||
license = { workspace = true } | ||
edition = { workspace = true } | ||
|
||
[features] | ||
dev-context-only-utils = [] | ||
|
||
[dependencies] | ||
solana-address-lookup-table-program = { workspace = true } | ||
solana-bpf-loader-program = { workspace = true } | ||
solana-compute-budget-program = { workspace = true } | ||
solana-config-program = { workspace = true } | ||
solana-feature-set = { workspace = true } | ||
solana-loader-v4-program = { workspace = true } | ||
solana-program-runtime = { workspace = true } | ||
solana-pubkey = { workspace = true } | ||
solana-sdk-ids = { workspace = true } | ||
solana-stake-program = { workspace = true } | ||
solana-system-program = { workspace = true } | ||
solana-vote-program = { workspace = true } | ||
solana-zk-elgamal-proof-program = { workspace = true } | ||
solana-zk-token-proof-program = { workspace = true } | ||
|
||
[lints] | ||
workspace = true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use solana_pubkey::Pubkey; | ||
|
||
/// Identifies the type of built-in program targeted for Core BPF migration. | ||
/// The type of target determines whether the program should have a program | ||
/// account or not, which is checked before migration. | ||
#[allow(dead_code)] // Remove after first migration is configured. | ||
#[derive(Debug, PartialEq)] | ||
pub enum CoreBpfMigrationTargetType { | ||
/// A standard (stateful) builtin program must have a program account. | ||
Builtin, | ||
/// A stateless builtin must not have a program account. | ||
Stateless, | ||
} | ||
|
||
/// Configuration for migrating a built-in program to Core BPF. | ||
#[derive(Debug, PartialEq)] | ||
pub struct CoreBpfMigrationConfig { | ||
/// The address of the source buffer account to be used to replace the | ||
/// builtin. | ||
pub source_buffer_address: Pubkey, | ||
/// The authority to be used as the BPF program's upgrade authority. | ||
/// | ||
/// Note: If this value is set to `None`, then the migration will ignore | ||
/// the source buffer account's authority. If it's set to any `Some(..)` | ||
/// value, then the migration will perform a sanity check to ensure the | ||
/// source buffer account's authority matches the provided value. | ||
pub upgrade_authority_address: Option<Pubkey>, | ||
/// The feature gate to trigger the migration to Core BPF. | ||
/// Note: This feature gate should never be the same as any builtin's | ||
/// `enable_feature_id`. It should always be a feature gate that will be | ||
/// activated after the builtin is already enabled. | ||
pub feature_id: Pubkey, | ||
/// The type of target to replace. | ||
pub migration_target: CoreBpfMigrationTargetType, | ||
/// Static message used to emit datapoint logging. | ||
/// This is used to identify the migration in the logs. | ||
/// Should be unique to the migration, ie: | ||
/// "migrate_{builtin/stateless}_to_core_bpf_{program_name}". | ||
pub datapoint_name: &'static str, | ||
} |
Oops, something went wrong.