Skip to content

Commit

Permalink
Bump solana_rbpf to v0.5.0 (#31943)
Browse files Browse the repository at this point in the history
* Renames RBPF BuiltIn to Builtin.

* Bump solana_rbpf to v0.5.0

(cherry picked from commit 3792204)

# Conflicts:
#	Cargo.toml
#	programs/sbf/Cargo.toml
  • Loading branch information
Lichtso authored and mergify[bot] committed Jun 2, 2023
1 parent 1934004 commit 65bfaaf
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ signal-hook = "0.3.15"
smpl_jwt = "0.7.1"
socket2 = "0.4.9"
soketto = "0.7"
<<<<<<< HEAD
solana_rbpf = "=0.4.0"
solana-account-decoder = { path = "account-decoder", version = "=1.16.1" }
solana-address-lookup-table-program = { path = "programs/address-lookup-table", version = "=1.16.1" }
Expand Down Expand Up @@ -359,6 +360,79 @@ solana-vote-program = { path = "programs/vote", version = "=1.16.1" }
solana-zk-keygen = { path = "zk-keygen", version = "=1.16.1" }
solana-zk-token-proof-program = { path = "programs/zk-token-proof", version = "=1.16.1" }
solana-zk-token-sdk = { path = "zk-token-sdk", version = "=1.16.1" }
=======
solana_rbpf = "=0.5.0"
solana-account-decoder = { path = "account-decoder", version = "=1.17.0" }
solana-address-lookup-table-program = { path = "programs/address-lookup-table", version = "=1.17.0" }
solana-banks-client = { path = "banks-client", version = "=1.17.0" }
solana-banks-interface = { path = "banks-interface", version = "=1.17.0" }
solana-banks-server = { path = "banks-server", version = "=1.17.0" }
solana-bench-tps = { path = "bench-tps", version = "=1.17.0" }
solana-bloom = { path = "bloom", version = "=1.17.0" }
solana-bpf-loader-program = { path = "programs/bpf_loader", version = "=1.17.0" }
solana-bucket-map = { path = "bucket_map", version = "=1.17.0" }
solana-connection-cache = { path = "connection-cache", version = "=1.17.0", default-features = false }
solana-clap-utils = { path = "clap-utils", version = "=1.17.0" }
solana-clap-v3-utils = { path = "clap-v3-utils", version = "=1.17.0" }
solana-cli = { path = "cli", version = "=1.17.0" }
solana-cli-config = { path = "cli-config", version = "=1.17.0" }
solana-cli-output = { path = "cli-output", version = "=1.17.0" }
solana-client = { path = "client", version = "=1.17.0" }
solana-compute-budget-program = { path = "programs/compute-budget", version = "=1.17.0" }
solana-config-program = { path = "programs/config", version = "=1.17.0" }
solana-core = { path = "core", version = "=1.17.0" }
solana-download-utils = { path = "download-utils", version = "=1.17.0" }
solana-entry = { path = "entry", version = "=1.17.0" }
solana-faucet = { path = "faucet", version = "=1.17.0" }
solana-frozen-abi = { path = "frozen-abi", version = "=1.17.0" }
solana-frozen-abi-macro = { path = "frozen-abi/macro", version = "=1.17.0" }
solana-genesis = { path = "genesis", version = "=1.17.0" }
solana-genesis-utils = { path = "genesis-utils", version = "=1.17.0" }
solana-geyser-plugin-interface = { path = "geyser-plugin-interface", version = "=1.17.0" }
solana-geyser-plugin-manager = { path = "geyser-plugin-manager", version = "=1.17.0" }
solana-gossip = { path = "gossip", version = "=1.17.0" }
solana-loader-v4-program = { path = "programs/loader-v4", version = "=1.17.0" }
solana-ledger = { path = "ledger", version = "=1.17.0" }
solana-local-cluster = { path = "local-cluster", version = "=1.17.0" }
solana-logger = { path = "logger", version = "=1.17.0" }
solana-measure = { path = "measure", version = "=1.17.0" }
solana-merkle-tree = { path = "merkle-tree", version = "=1.17.0" }
solana-metrics = { path = "metrics", version = "=1.17.0" }
solana-net-utils = { path = "net-utils", version = "=1.17.0" }
solana-notifier = { path = "notifier", version = "=1.17.0" }
solana-perf = { path = "perf", version = "=1.17.0" }
solana-poh = { path = "poh", version = "=1.17.0" }
solana-program = { path = "sdk/program", version = "=1.17.0" }
solana-program-runtime = { path = "program-runtime", version = "=1.17.0" }
solana-program-test = { path = "program-test", version = "=1.17.0" }
solana-pubsub-client = { path = "pubsub-client", version = "=1.17.0" }
solana-quic-client = { path = "quic-client", version = "=1.17.0" }
solana-rayon-threadlimit = { path = "rayon-threadlimit", version = "=1.17.0" }
solana-remote-wallet = { path = "remote-wallet", version = "=1.17.0", default-features = false }
solana-rpc = { path = "rpc", version = "=1.17.0" }
solana-rpc-client = { path = "rpc-client", version = "=1.17.0", default-features = false }
solana-rpc-client-api = { path = "rpc-client-api", version = "=1.17.0" }
solana-rpc-client-nonce-utils = { path = "rpc-client-nonce-utils", version = "=1.17.0" }
solana-runtime = { path = "runtime", version = "=1.17.0" }
solana-sdk = { path = "sdk", version = "=1.17.0" }
solana-sdk-macro = { path = "sdk/macro", version = "=1.17.0" }
solana-send-transaction-service = { path = "send-transaction-service", version = "=1.17.0" }
solana-stake-program = { path = "programs/stake", version = "=1.17.0" }
solana-storage-bigtable = { path = "storage-bigtable", version = "=1.17.0" }
solana-storage-proto = { path = "storage-proto", version = "=1.17.0" }
solana-streamer = { path = "streamer", version = "=1.17.0" }
solana-system-program = { path = "programs/system", version = "=1.17.0" }
solana-test-validator = { path = "test-validator", version = "=1.17.0" }
solana-thin-client = { path = "thin-client", version = "=1.17.0" }
solana-tpu-client = { path = "tpu-client", version = "=1.17.0", default-features = false }
solana-transaction-status = { path = "transaction-status", version = "=1.17.0" }
solana-udp-client = { path = "udp-client", version = "=1.17.0" }
solana-version = { path = "version", version = "=1.17.0" }
solana-vote-program = { path = "programs/vote", version = "=1.17.0" }
solana-zk-keygen = { path = "zk-keygen", version = "=1.17.0" }
solana-zk-token-proof-program = { path = "programs/zk-token-proof", version = "=1.17.0" }
solana-zk-token-sdk = { path = "zk-token-sdk", version = "=1.17.0" }
>>>>>>> 379220459 (Bump solana_rbpf to v0.5.0 (#31943))
spl-associated-token-account = "=1.1.3"
spl-instruction-padding = "0.1"
spl-memo = "=3.0.1"
Expand Down
4 changes: 2 additions & 2 deletions program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use {
solana_rbpf::{
ebpf::MM_HEAP_START,
memory_region::MemoryMapping,
vm::{BuiltInFunction, Config, ContextObject, ProgramResult},
vm::{BuiltinFunction, Config, ContextObject, ProgramResult},
},
solana_sdk::{
account::{AccountSharedData, ReadableAccount},
Expand Down Expand Up @@ -43,7 +43,7 @@ use {
},
};

pub type ProcessInstructionWithContext = BuiltInFunction<InvokeContext<'static>>;
pub type ProcessInstructionWithContext = BuiltinFunction<InvokeContext<'static>>;

/// Adapter so we can unify the interfaces of built-in programs and syscalls
#[macro_export]
Expand Down
14 changes: 7 additions & 7 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
log::{debug, log_enabled, trace},
percentage::PercentageInteger,
solana_measure::measure::Measure,
solana_rbpf::{elf::Executable, verifier::RequisiteVerifier, vm::BuiltInProgram},
solana_rbpf::{elf::Executable, verifier::RequisiteVerifier, vm::BuiltinProgram},
solana_sdk::{
bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, clock::Slot, loader_v4,
pubkey::Pubkey, saturating_add_assign,
Expand Down Expand Up @@ -71,7 +71,7 @@ pub enum LoadedProgramType {
Typed(Executable<RequisiteVerifier, InvokeContext<'static>>),
#[cfg(test)]
TestLoaded,
Builtin(BuiltInProgram<InvokeContext<'static>>),
Builtin(BuiltinProgram<InvokeContext<'static>>),
}

impl Debug for LoadedProgramType {
Expand Down Expand Up @@ -217,7 +217,7 @@ impl LoadedProgram {
/// Creates a new user program
pub fn new(
loader_key: &Pubkey,
program_runtime_environment: Arc<BuiltInProgram<InvokeContext<'static>>>,
program_runtime_environment: Arc<BuiltinProgram<InvokeContext<'static>>>,
deployment_slot: Slot,
effective_slot: Slot,
maybe_expiration_slot: Option<Slot>,
Expand Down Expand Up @@ -286,7 +286,7 @@ impl LoadedProgram {
account_size: usize,
entrypoint: ProcessInstructionWithContext,
) -> Self {
let mut program = BuiltInProgram::default();
let mut program = BuiltinProgram::default();
program
.register_function(b"entrypoint", entrypoint)
.unwrap();
Expand Down Expand Up @@ -351,7 +351,7 @@ pub struct LoadedPrograms {
/// Pubkey is the address of a program, multiple versions can coexists simultaneously under the same address (in different slots).
entries: HashMap<Pubkey, Vec<Arc<LoadedProgram>>>,
/// Globally shared RBPF config and syscall registry
pub program_runtime_environment_v1: Arc<BuiltInProgram<InvokeContext<'static>>>,
pub program_runtime_environment_v1: Arc<BuiltinProgram<InvokeContext<'static>>>,
latest_root: Slot,
pub stats: Stats,
}
Expand Down Expand Up @@ -740,7 +740,7 @@ mod tests {
LoadedPrograms, LoadedProgramsForTxBatch, WorkingSlot, DELAY_VISIBILITY_SLOT_OFFSET,
},
percentage::Percentage,
solana_rbpf::vm::BuiltInProgram,
solana_rbpf::vm::BuiltinProgram,
solana_sdk::{clock::Slot, pubkey::Pubkey},
std::{
ops::ControlFlow,
Expand All @@ -753,7 +753,7 @@ mod tests {

fn new_test_builtin_program(deployment_slot: Slot, effective_slot: Slot) -> Arc<LoadedProgram> {
Arc::new(LoadedProgram {
program: LoadedProgramType::Builtin(BuiltInProgram::default()),
program: LoadedProgramType::Builtin(BuiltinProgram::default()),
account_size: 0,
deployment_slot,
effective_slot,
Expand Down
8 changes: 4 additions & 4 deletions programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use {
error::EbpfError,
memory_region::{AccessType, MemoryCowCallback, MemoryMapping, MemoryRegion},
verifier::RequisiteVerifier,
vm::{BuiltInProgram, ContextObject, EbpfVm, ProgramResult},
vm::{BuiltinProgram, ContextObject, EbpfVm, ProgramResult},
},
solana_sdk::{
account::WritableAccount,
Expand Down Expand Up @@ -71,7 +71,7 @@ pub fn load_program_from_bytes(
loader_key: &Pubkey,
account_size: usize,
deployment_slot: Slot,
program_runtime_environment: Arc<BuiltInProgram<InvokeContext<'static>>>,
program_runtime_environment: Arc<BuiltinProgram<InvokeContext<'static>>>,
) -> Result<LoadedProgram, InstructionError> {
let effective_slot = if feature_set.is_active(&delay_visibility_of_program_deployment::id()) {
deployment_slot.saturating_add(DELAY_VISIBILITY_SLOT_OFFSET)
Expand Down Expand Up @@ -100,7 +100,7 @@ pub fn load_program_from_account(
log_collector: Option<Rc<RefCell<LogCollector>>>,
program: &BorrowedAccount,
programdata: &BorrowedAccount,
program_runtime_environment: Arc<BuiltInProgram<InvokeContext<'static>>>,
program_runtime_environment: Arc<BuiltinProgram<InvokeContext<'static>>>,
) -> Result<(Arc<LoadedProgram>, LoadProgramMetrics), InstructionError> {
if !check_loader_id(program.get_owner()) {
ic_logger_msg!(
Expand Down Expand Up @@ -352,7 +352,7 @@ macro_rules! create_vm {
#[macro_export]
macro_rules! mock_create_vm {
($vm:ident, $additional_regions:expr, $orig_account_lengths:expr, $invoke_context:expr $(,)?) => {
let loader = std::sync::Arc::new(BuiltInProgram::new_loader(
let loader = std::sync::Arc::new(BuiltinProgram::new_loader(
solana_rbpf::vm::Config::default(),
));
let function_registry = solana_rbpf::vm::FunctionRegistry::default();
Expand Down
10 changes: 5 additions & 5 deletions programs/bpf_loader/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use {
},
solana_rbpf::{
memory_region::{AccessType, MemoryMapping},
vm::{BuiltInProgram, Config, ProgramResult, PROGRAM_ENVIRONMENT_KEY_SHIFT},
vm::{BuiltinProgram, Config, ProgramResult, PROGRAM_ENVIRONMENT_KEY_SHIFT},
},
solana_sdk::{
account::{ReadableAccount, WritableAccount},
Expand Down Expand Up @@ -146,7 +146,7 @@ pub fn create_program_runtime_environment<'a>(
compute_budget: &ComputeBudget,
reject_deployment_of_broken_elfs: bool,
debugging_features: bool,
) -> Result<BuiltInProgram<InvokeContext<'a>>, Error> {
) -> Result<BuiltinProgram<InvokeContext<'a>>, Error> {
use rand::Rng;
let config = Config {
max_call_depth: compute_budget.max_call_depth,
Expand Down Expand Up @@ -186,7 +186,7 @@ pub fn create_program_runtime_environment<'a>(
let disable_deploy_of_alloc_free_syscall = reject_deployment_of_broken_elfs
&& feature_set.is_active(&disable_deploy_of_alloc_free_syscall::id());

let mut result = BuiltInProgram::new_loader(config);
let mut result = BuiltinProgram::new_loader(config);

// Abort
result.register_function(b"abort", SyscallAbort::call)?;
Expand Down Expand Up @@ -1786,7 +1786,7 @@ mod tests {
solana_rbpf::{
error::EbpfError,
memory_region::MemoryRegion,
vm::{BuiltInFunction, Config},
vm::{BuiltinFunction, Config},
},
solana_sdk::{
account::{create_account_shared_data_for_test, AccountSharedData},
Expand Down Expand Up @@ -3341,7 +3341,7 @@ mod tests {
seeds: &[&[u8]],
program_id: &Pubkey,
overlap_outputs: bool,
syscall: BuiltInFunction<InvokeContext<'b>>,
syscall: BuiltinFunction<InvokeContext<'b>>,
) -> Result<(Pubkey, u8), Error> {
const SEEDS_VA: u64 = 0x100000000;
const PROGRAM_ID_VA: u64 = 0x200000000;
Expand Down
4 changes: 2 additions & 2 deletions programs/loader-v4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use {
memory_region::{MemoryMapping, MemoryRegion},
verifier::RequisiteVerifier,
vm::{
BuiltInProgram, Config, ContextObject, EbpfVm, ProgramResult,
BuiltinProgram, Config, ContextObject, EbpfVm, ProgramResult,
PROGRAM_ENVIRONMENT_KEY_SHIFT,
},
},
Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn load_program_from_account(
aligned_memory_mapping: true,
// Warning, do not use `Config::default()` so that configuration here is explicit.
};
let loader = BuiltInProgram::new_loader(config);
let loader = BuiltinProgram::new_loader(config);
let state = get_state(program.get_data())?;
let programdata = program
.get_data()
Expand Down
4 changes: 2 additions & 2 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions programs/sbf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ num-traits = "0.2"
rand = "0.7"
serde = "1.0.112"
serde_json = "1.0.56"
<<<<<<< HEAD
solana_rbpf = "=0.4.0"
solana-account-decoder = { path = "../../account-decoder", version = "=1.16.1" }
solana-address-lookup-table-program = { path = "../../programs/address-lookup-table", version = "=1.16.1" }
Expand All @@ -48,6 +49,32 @@ solana-sdk = { path = "../../sdk", version = "=1.16.1" }
solana-transaction-status = { path = "../../transaction-status", version = "=1.16.1" }
solana-validator = { path = "../../validator", version = "=1.16.1" }
solana-zk-token-sdk = { path = "../../zk-token-sdk", version = "=1.16.1" }
=======
solana_rbpf = "=0.5.0"
solana-account-decoder = { path = "../../account-decoder", version = "=1.17.0" }
solana-address-lookup-table-program = { path = "../../programs/address-lookup-table", version = "=1.17.0" }
solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.17.0" }
solana-cli-output = { path = "../../cli-output", version = "=1.17.0" }
solana-ledger = { path = "../../ledger", version = "=1.17.0" }
solana-logger = { path = "../../logger", version = "=1.17.0" }
solana-measure = { path = "../../measure", version = "=1.17.0" }
solana-program = { path = "../../sdk/program", version = "=1.17.0" }
solana-program-runtime = { path = "../../program-runtime", version = "=1.17.0" }
solana-program-test = { path = "../../program-test", version = "=1.17.0" }
solana-runtime = { path = "../../runtime", version = "=1.17.0" }
solana-sbf-rust-128bit-dep = { path = "rust/128bit_dep", version = "=1.17.0" }
solana-sbf-rust-invoke = { path = "rust/invoke", version = "=1.17.0" }
solana-sbf-rust-invoked = { path = "rust/invoked", version = "=1.17.0", default-features = false }
solana-sbf-rust-many-args-dep = { path = "rust/many_args_dep", version = "=1.17.0" }
solana-sbf-rust-mem = { path = "rust/mem", version = "=1.17.0" }
solana-sbf-rust-param-passing-dep = { path = "rust/param_passing_dep", version = "=1.17.0" }
solana-sbf-rust-realloc = { path = "rust/realloc", version = "=1.17.0", default-features = false }
solana-sbf-rust-realloc-invoke = { path = "rust/realloc_invoke", version = "=1.17.0" }
solana-sdk = { path = "../../sdk", version = "=1.17.0" }
solana-transaction-status = { path = "../../transaction-status", version = "=1.17.0" }
solana-validator = { path = "../../validator", version = "=1.17.0" }
solana-zk-token-sdk = { path = "../../zk-token-sdk", version = "=1.17.0" }
>>>>>>> 379220459 (Bump solana_rbpf to v0.5.0 (#31943))
static_assertions = "1.1.0"
thiserror = "1.0"

Expand Down

0 comments on commit 65bfaaf

Please sign in to comment.