bump solana_rbpf from 0.2.5 to 0.2.7 (#16515)

This commit is contained in:
Michael Vines 2021-04-13 14:49:09 -07:00 committed by GitHub
parent ccb11a939f
commit f7eadd9d70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 52 deletions

4
Cargo.lock generated
View File

@ -5461,9 +5461,9 @@ dependencies = [
[[package]] [[package]]
name = "solana_rbpf" name = "solana_rbpf"
version = "0.2.5" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e3089d0175f975358b602072a02bd327a154399d2b54a8cf0f8f21108a4de4c" checksum = "14e36c51d5aa290416c5dea3c43ac467cb57c0b643184af23e6bdab7434710fb"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"combine", "combine",

View File

@ -38,7 +38,7 @@ solana-config-program = { path = "../programs/config", version = "=1.7.0" }
solana-faucet = { path = "../faucet", version = "=1.7.0" } solana-faucet = { path = "../faucet", version = "=1.7.0" }
solana-logger = { path = "../logger", version = "=1.7.0" } solana-logger = { path = "../logger", version = "=1.7.0" }
solana-net-utils = { path = "../net-utils", version = "=1.7.0" } solana-net-utils = { path = "../net-utils", version = "=1.7.0" }
solana_rbpf = "=0.2.5" solana_rbpf = "=0.2.7"
solana-remote-wallet = { path = "../remote-wallet", version = "=1.7.0" } solana-remote-wallet = { path = "../remote-wallet", version = "=1.7.0" }
solana-sdk = { path = "../sdk", version = "=1.7.0" } solana-sdk = { path = "../sdk", version = "=1.7.0" }
solana-stake-program = { path = "../programs/stake", version = "=1.7.0" } solana-stake-program = { path = "../programs/stake", version = "=1.7.0" }

View File

@ -3563,9 +3563,9 @@ dependencies = [
[[package]] [[package]]
name = "solana_rbpf" name = "solana_rbpf"
version = "0.2.5" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e3089d0175f975358b602072a02bd327a154399d2b54a8cf0f8f21108a4de4c" checksum = "14e36c51d5aa290416c5dea3c43ac467cb57c0b643184af23e6bdab7434710fb"
dependencies = [ dependencies = [
"byteorder 1.3.4", "byteorder 1.3.4",
"combine", "combine",

View File

@ -29,7 +29,7 @@ solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.7.0" }
solana-cli-output = { path = "../../cli-output", version = "=1.7.0" } solana-cli-output = { path = "../../cli-output", version = "=1.7.0" }
solana-logger = { path = "../../logger", version = "=1.7.0" } solana-logger = { path = "../../logger", version = "=1.7.0" }
solana-measure = { path = "../../measure", version = "=1.7.0" } solana-measure = { path = "../../measure", version = "=1.7.0" }
solana_rbpf = "=0.2.5" solana_rbpf = "=0.2.7"
solana-runtime = { path = "../../runtime", version = "=1.7.0" } solana-runtime = { path = "../../runtime", version = "=1.7.0" }
solana-sdk = { path = "../../sdk", version = "=1.7.0" } solana-sdk = { path = "../../sdk", version = "=1.7.0" }
solana-transaction-status = { path = "../../transaction-status", version = "=1.7.0" } solana-transaction-status = { path = "../../transaction-status", version = "=1.7.0" }

View File

@ -20,7 +20,7 @@ rand_core = "0.6.2"
solana-measure = { path = "../../measure", version = "=1.7.0" } solana-measure = { path = "../../measure", version = "=1.7.0" }
solana-runtime = { path = "../../runtime", version = "=1.7.0" } solana-runtime = { path = "../../runtime", version = "=1.7.0" }
solana-sdk = { path = "../../sdk", version = "=1.7.0" } solana-sdk = { path = "../../sdk", version = "=1.7.0" }
solana_rbpf = "=0.2.5" solana_rbpf = "=0.2.7"
thiserror = "1.0" thiserror = "1.0"
[dev-dependencies] [dev-dependencies]

View File

@ -1917,7 +1917,7 @@ fn call<'a>(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use solana_rbpf::{memory_region::MemoryRegion, vm::Config}; use solana_rbpf::{memory_region::MemoryRegion, user_error::UserError, vm::Config};
use solana_sdk::{ use solana_sdk::{
bpf_loader, bpf_loader,
fee_calculator::FeeCalculator, fee_calculator::FeeCalculator,
@ -1948,10 +1948,11 @@ mod tests {
const LENGTH: u64 = 1000; const LENGTH: u64 = 1000;
let data = vec![0u8; LENGTH as usize]; let data = vec![0u8; LENGTH as usize];
let addr = data.as_ptr() as u64; let addr = data.as_ptr() as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion::new_from_slice(&data, START, 0, false)], vec![MemoryRegion::new_from_slice(&data, START, 0, false)],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let cases = vec![ let cases = vec![
(true, START, 0, addr), (true, START, 0, addr),
@ -1986,7 +1987,7 @@ mod tests {
// Pubkey // Pubkey
let pubkey = solana_sdk::pubkey::new_rand(); let pubkey = solana_sdk::pubkey::new_rand();
let addr = &pubkey as *const _ as u64; let addr = &pubkey as *const _ as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -1995,7 +1996,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let translated_pubkey = let translated_pubkey =
translate_type::<Pubkey>(&memory_mapping, 100, &bpf_loader::id()).unwrap(); translate_type::<Pubkey>(&memory_mapping, 100, &bpf_loader::id()).unwrap();
assert_eq!(pubkey, *translated_pubkey); assert_eq!(pubkey, *translated_pubkey);
@ -2007,7 +2009,7 @@ mod tests {
vec![AccountMeta::new(solana_sdk::pubkey::new_rand(), false)], vec![AccountMeta::new(solana_sdk::pubkey::new_rand(), false)],
); );
let addr = &instruction as *const _ as u64; let addr = &instruction as *const _ as u64;
let mut memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 96, vm_addr: 96,
@ -2016,12 +2018,15 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let translated_instruction = let translated_instruction =
translate_type::<Instruction>(&memory_mapping, 96, &bpf_loader::id()).unwrap(); translate_type::<Instruction>(&memory_mapping, 96, &bpf_loader::id()).unwrap();
assert_eq!(instruction, *translated_instruction); assert_eq!(instruction, *translated_instruction);
memory_mapping.resize_region::<BpfError>(0, 1).unwrap(); // TODO: Reenable when solana_rbpf is bumped to "0.2.8" or higher
assert!(translate_type::<Instruction>(&memory_mapping, 100, &bpf_loader::id()).is_err()); // Text search anchor so that it is easier to find: solana_rbpf = "=0.2.7"
// memory_mapping.resize_region::<BpfError>(0, 1).unwrap();
// assert!(translate_type::<Instruction>(&memory_mapping, 100, &bpf_loader::id()).is_err());
} }
#[test] #[test]
@ -2031,7 +2036,7 @@ mod tests {
let data: Vec<u8> = vec![]; let data: Vec<u8> = vec![];
assert_eq!(0x1 as *const u8, data.as_ptr()); assert_eq!(0x1 as *const u8, data.as_ptr());
let addr = good_data.as_ptr() as *const _ as u64; let addr = good_data.as_ptr() as *const _ as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -2040,7 +2045,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let translated_data = let translated_data =
translate_slice::<u8>(&memory_mapping, data.as_ptr() as u64, 0, &bpf_loader::id()) translate_slice::<u8>(&memory_mapping, data.as_ptr() as u64, 0, &bpf_loader::id())
.unwrap(); .unwrap();
@ -2050,7 +2056,7 @@ mod tests {
// u8 // u8
let mut data = vec![1u8, 2, 3, 4, 5]; let mut data = vec![1u8, 2, 3, 4, 5];
let addr = data.as_ptr() as *const _ as u64; let addr = data.as_ptr() as *const _ as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -2059,7 +2065,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let translated_data = let translated_data =
translate_slice::<u8>(&memory_mapping, 100, data.len() as u64, &bpf_loader::id()) translate_slice::<u8>(&memory_mapping, 100, data.len() as u64, &bpf_loader::id())
.unwrap(); .unwrap();
@ -2085,7 +2092,7 @@ mod tests {
// u64 // u64
let mut data = vec![1u64, 2, 3, 4, 5]; let mut data = vec![1u64, 2, 3, 4, 5];
let addr = data.as_ptr() as *const _ as u64; let addr = data.as_ptr() as *const _ as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 96, vm_addr: 96,
@ -2094,7 +2101,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let translated_data = let translated_data =
translate_slice::<u64>(&memory_mapping, 96, data.len() as u64, &bpf_loader::id()) translate_slice::<u64>(&memory_mapping, 96, data.len() as u64, &bpf_loader::id())
.unwrap(); .unwrap();
@ -2106,7 +2114,7 @@ mod tests {
// Pubkeys // Pubkeys
let mut data = vec![solana_sdk::pubkey::new_rand(); 5]; let mut data = vec![solana_sdk::pubkey::new_rand(); 5];
let addr = data.as_ptr() as *const _ as u64; let addr = data.as_ptr() as *const _ as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -2115,7 +2123,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let translated_data = let translated_data =
translate_slice::<Pubkey>(&memory_mapping, 100, data.len() as u64, &bpf_loader::id()) translate_slice::<Pubkey>(&memory_mapping, 100, data.len() as u64, &bpf_loader::id())
.unwrap(); .unwrap();
@ -2128,7 +2137,7 @@ mod tests {
fn test_translate_string_and_do() { fn test_translate_string_and_do() {
let string = "Gaggablaghblagh!"; let string = "Gaggablaghblagh!";
let addr = string.as_ptr() as *const _ as u64; let addr = string.as_ptr() as *const _ as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -2137,7 +2146,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
assert_eq!( assert_eq!(
42, 42,
translate_string_and_do( translate_string_and_do(
@ -2157,7 +2167,9 @@ mod tests {
#[test] #[test]
#[should_panic(expected = "UserError(SyscallError(Abort))")] #[should_panic(expected = "UserError(SyscallError(Abort))")]
fn test_syscall_abort() { fn test_syscall_abort() {
let memory_mapping = MemoryMapping::new(vec![MemoryRegion::default()], &DEFAULT_CONFIG); let memory_mapping =
MemoryMapping::new::<UserError>(vec![MemoryRegion::default()], &DEFAULT_CONFIG)
.unwrap();
let mut result: Result<u64, EbpfError<BpfError>> = Ok(0); let mut result: Result<u64, EbpfError<BpfError>> = Ok(0);
SyscallAbort::call( SyscallAbort::call(
&mut SyscallAbort {}, &mut SyscallAbort {},
@ -2177,7 +2189,7 @@ mod tests {
fn test_syscall_sol_panic() { fn test_syscall_sol_panic() {
let string = "Gaggablaghblagh!"; let string = "Gaggablaghblagh!";
let addr = string.as_ptr() as *const _ as u64; let addr = string.as_ptr() as *const _ as u64;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -2186,7 +2198,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let compute_meter: Rc<RefCell<dyn ComputeMeter>> = let compute_meter: Rc<RefCell<dyn ComputeMeter>> =
Rc::new(RefCell::new(MockComputeMeter { Rc::new(RefCell::new(MockComputeMeter {
@ -2249,7 +2262,7 @@ mod tests {
logger, logger,
loader_id: &bpf_loader::id(), loader_id: &bpf_loader::id(),
}; };
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -2258,7 +2271,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let mut result: Result<u64, EbpfError<BpfError>> = Ok(0); let mut result: Result<u64, EbpfError<BpfError>> = Ok(0);
syscall_sol_log.call( syscall_sol_log.call(
@ -2360,7 +2374,7 @@ mod tests {
compute_meter, compute_meter,
logger, logger,
}; };
let memory_mapping = MemoryMapping::new(vec![], &DEFAULT_CONFIG); let memory_mapping = MemoryMapping::new::<UserError>(vec![], &DEFAULT_CONFIG).unwrap();
let mut result: Result<u64, EbpfError<BpfError>> = Ok(0); let mut result: Result<u64, EbpfError<BpfError>> = Ok(0);
syscall_sol_log_u64.call(1, 2, 3, 4, 5, &memory_mapping, &mut result); syscall_sol_log_u64.call(1, 2, 3, 4, 5, &memory_mapping, &mut result);
@ -2386,7 +2400,7 @@ mod tests {
logger, logger,
loader_id: &bpf_loader::id(), loader_id: &bpf_loader::id(),
}; };
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: addr, host_addr: addr,
vm_addr: 100, vm_addr: 100,
@ -2395,7 +2409,8 @@ mod tests {
is_writable: false, is_writable: false,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let mut result: Result<u64, EbpfError<BpfError>> = Ok(0); let mut result: Result<u64, EbpfError<BpfError>> = Ok(0);
syscall_sol_pubkey.call(100, 0, 0, 0, 0, &memory_mapping, &mut result); syscall_sol_pubkey.call(100, 0, 0, 0, 0, &memory_mapping, &mut result);
@ -2431,10 +2446,11 @@ mod tests {
// large alloc // large alloc
{ {
let heap = vec![0_u8; 100]; let heap = vec![0_u8; 100];
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)], vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let mut syscall = SyscallAllocFree { let mut syscall = SyscallAllocFree {
aligned: true, aligned: true,
allocator: BpfAllocator::new(heap, MM_HEAP_START), allocator: BpfAllocator::new(heap, MM_HEAP_START),
@ -2452,10 +2468,11 @@ mod tests {
// many small unaligned allocs // many small unaligned allocs
{ {
let heap = vec![0_u8; 100]; let heap = vec![0_u8; 100];
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)], vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let mut syscall = SyscallAllocFree { let mut syscall = SyscallAllocFree {
aligned: false, aligned: false,
allocator: BpfAllocator::new(heap, MM_HEAP_START), allocator: BpfAllocator::new(heap, MM_HEAP_START),
@ -2472,10 +2489,11 @@ mod tests {
// many small aligned allocs // many small aligned allocs
{ {
let heap = vec![0_u8; 100]; let heap = vec![0_u8; 100];
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)], vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let mut syscall = SyscallAllocFree { let mut syscall = SyscallAllocFree {
aligned: true, aligned: true,
allocator: BpfAllocator::new(heap, MM_HEAP_START), allocator: BpfAllocator::new(heap, MM_HEAP_START),
@ -2493,10 +2511,11 @@ mod tests {
fn check_alignment<T>() { fn check_alignment<T>() {
let heap = vec![0_u8; 100]; let heap = vec![0_u8; 100];
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)], vec![MemoryRegion::new_from_slice(&heap, MM_HEAP_START, 0, true)],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let mut syscall = SyscallAllocFree { let mut syscall = SyscallAllocFree {
aligned: true, aligned: true,
allocator: BpfAllocator::new(heap, MM_HEAP_START), allocator: BpfAllocator::new(heap, MM_HEAP_START),
@ -2544,7 +2563,7 @@ mod tests {
let ro_len = bytes_to_hash.len() as u64; let ro_len = bytes_to_hash.len() as u64;
let ro_va = 96; let ro_va = 96;
let rw_va = 192; let rw_va = 192;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![ vec![
MemoryRegion { MemoryRegion {
host_addr: bytes1.as_ptr() as *const _ as u64, host_addr: bytes1.as_ptr() as *const _ as u64,
@ -2576,7 +2595,8 @@ mod tests {
}, },
], ],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let compute_meter: Rc<RefCell<dyn ComputeMeter>> = let compute_meter: Rc<RefCell<dyn ComputeMeter>> =
Rc::new(RefCell::new(MockComputeMeter { Rc::new(RefCell::new(MockComputeMeter {
remaining: (bytes1.len() + bytes2.len()) as u64, remaining: (bytes1.len() + bytes2.len()) as u64,
@ -2644,7 +2664,7 @@ mod tests {
let got_clock = Clock::default(); let got_clock = Clock::default();
let got_clock_va = 2048; let got_clock_va = 2048;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: &got_clock as *const _ as u64, host_addr: &got_clock as *const _ as u64,
vm_addr: got_clock_va, vm_addr: got_clock_va,
@ -2653,7 +2673,8 @@ mod tests {
is_writable: true, is_writable: true,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let src_clock = Clock { let src_clock = Clock {
slot: 1, slot: 1,
@ -2685,7 +2706,7 @@ mod tests {
let got_epochschedule = EpochSchedule::default(); let got_epochschedule = EpochSchedule::default();
let got_epochschedule_va = 2048; let got_epochschedule_va = 2048;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: &got_epochschedule as *const _ as u64, host_addr: &got_epochschedule as *const _ as u64,
vm_addr: got_epochschedule_va, vm_addr: got_epochschedule_va,
@ -2694,7 +2715,8 @@ mod tests {
is_writable: true, is_writable: true,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let src_epochschedule = EpochSchedule { let src_epochschedule = EpochSchedule {
slots_per_epoch: 1, slots_per_epoch: 1,
@ -2734,7 +2756,7 @@ mod tests {
let got_fees = Fees::default(); let got_fees = Fees::default();
let got_fees_va = 2048; let got_fees_va = 2048;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: &got_fees as *const _ as u64, host_addr: &got_fees as *const _ as u64,
vm_addr: got_fees_va, vm_addr: got_fees_va,
@ -2743,7 +2765,8 @@ mod tests {
is_writable: true, is_writable: true,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let src_fees = Fees { let src_fees = Fees {
fee_calculator: FeeCalculator { fee_calculator: FeeCalculator {
@ -2773,7 +2796,7 @@ mod tests {
let got_rent = Rent::default(); let got_rent = Rent::default();
let got_rent_va = 2048; let got_rent_va = 2048;
let memory_mapping = MemoryMapping::new( let memory_mapping = MemoryMapping::new::<UserError>(
vec![MemoryRegion { vec![MemoryRegion {
host_addr: &got_rent as *const _ as u64, host_addr: &got_rent as *const _ as u64,
vm_addr: got_rent_va, vm_addr: got_rent_va,
@ -2782,7 +2805,8 @@ mod tests {
is_writable: true, is_writable: true,
}], }],
&DEFAULT_CONFIG, &DEFAULT_CONFIG,
); )
.unwrap();
let src_rent = Rent { let src_rent = Rent {
lamports_per_byte_year: 1, lamports_per_byte_year: 1,