Skip to content

Commit

Permalink
Bumps solana_rbpf to v0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Dec 2, 2024
1 parent dc57128 commit 9e667e9
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 165 deletions.
5 changes: 2 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ solana-zk-keygen = { path = "zk-keygen", version = "=2.2.0" }
solana-zk-sdk = { path = "zk-sdk", version = "=2.2.0" }
solana-zk-token-proof-program = { path = "programs/zk-token-proof", version = "=2.2.0" }
solana-zk-token-sdk = { path = "zk-token-sdk", version = "=2.2.0" }
solana_rbpf = "=0.8.5"
solana_rbpf = { git = "https://github.com/solana-labs/rbpf.git" }
spl-associated-token-account = "=6.0.0"
spl-instruction-padding = "0.3"
spl-memo = "=6.0.0"
Expand Down
6 changes: 3 additions & 3 deletions program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ impl<'a> InvokeContext<'a> {
.ok_or(InstructionError::UnsupportedProgramId)?;
let function = match &entry.program {
ProgramCacheEntryType::Builtin(program) => program
.get_function_registry()
.get_function_registry(SBPFVersion::V0)
.lookup_by_key(ENTRYPOINT_KEY)
.map(|(_name, function)| function),
_ => None,
Expand All @@ -560,13 +560,13 @@ impl<'a> InvokeContext<'a> {
// For now, only built-ins are invoked from here, so the VM and its Config are irrelevant.
let mock_config = Config::default();
let empty_memory_mapping =
MemoryMapping::new(Vec::new(), &mock_config, &SBPFVersion::V1).unwrap();
MemoryMapping::new(Vec::new(), &mock_config, SBPFVersion::V1).unwrap();
let mut vm = EbpfVm::new(
self.program_cache_for_tx_batch
.environments
.program_runtime_v2
.clone(),
&SBPFVersion::V1,
SBPFVersion::V0,
// Removes lifetime tracking
unsafe { std::mem::transmute::<&mut InvokeContext, &mut InvokeContext>(self) },
empty_memory_mapping,
Expand Down
2 changes: 1 addition & 1 deletion programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ macro_rules! mock_create_vm {
let executable = solana_rbpf::elf::Executable::<InvokeContext>::from_text_bytes(
&[0x95, 0, 0, 0, 0, 0, 0, 0],
loader,
SBPFVersion::V2,
SBPFVersion::V3,
function_registry,
)
.unwrap();
Expand Down
24 changes: 12 additions & 12 deletions programs/bpf_loader/src/syscalls/cpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ mod tests {
aligned_memory_mapping: false,
..Config::default()
};
let memory_mapping = MemoryMapping::new(vec![region], &config, &SBPFVersion::V2).unwrap();
let memory_mapping = MemoryMapping::new(vec![region], &config, SBPFVersion::V3).unwrap();

let ins = SyscallInvokeSignedRust::translate_instruction(
vm_addr,
Expand Down Expand Up @@ -1747,7 +1747,7 @@ mod tests {
aligned_memory_mapping: false,
..Config::default()
};
let memory_mapping = MemoryMapping::new(vec![region], &config, &SBPFVersion::V2).unwrap();
let memory_mapping = MemoryMapping::new(vec![region], &config, SBPFVersion::V3).unwrap();

let signers = SyscallInvokeSignedRust::translate_signers(
&program_id,
Expand Down Expand Up @@ -1783,7 +1783,7 @@ mod tests {
aligned_memory_mapping: false,
..Config::default()
};
let memory_mapping = MemoryMapping::new(vec![region], &config, &SBPFVersion::V2).unwrap();
let memory_mapping = MemoryMapping::new(vec![region], &config, SBPFVersion::V3).unwrap();

let account_info = translate_type::<AccountInfo>(&memory_mapping, vm_addr, false).unwrap();

Expand Down Expand Up @@ -1833,7 +1833,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -1891,7 +1891,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -2019,7 +2019,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -2194,7 +2194,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -2264,7 +2264,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -2320,7 +2320,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -2393,7 +2393,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -2481,7 +2481,7 @@ mod tests {
let memory_mapping = MemoryMapping::new(
mock_caller_account.regions.split_off(0),
&config,
&SBPFVersion::V2,
SBPFVersion::V3,
)
.unwrap();

Expand Down Expand Up @@ -2559,7 +2559,7 @@ mod tests {
aligned_memory_mapping: false,
..Config::default()
};
let memory_mapping = MemoryMapping::new(vec![region], &config, &SBPFVersion::V2).unwrap();
let memory_mapping = MemoryMapping::new(vec![region], &config, SBPFVersion::V3).unwrap();

mock_invoke_context!(
invoke_context,
Expand Down
Loading

0 comments on commit 9e667e9

Please sign in to comment.