BPF loader message nits (#5870)
This commit is contained in:
parent
ee4266bc59
commit
008dcd71b9
|
@ -2,7 +2,6 @@
|
|||
|
||||
extern crate solana_sdk;
|
||||
use solana_sdk::entrypoint::SUCCESS;
|
||||
use solana_sdk::info;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
||||
|
@ -48,6 +47,5 @@ pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
|||
);
|
||||
assert_eq!(x, 0x0001_ffff_ffff_ffff_fffe);
|
||||
|
||||
info!("Success");
|
||||
SUCCESS
|
||||
}
|
||||
|
|
|
@ -100,6 +100,5 @@ pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
|||
assert_eq!(v.len(), ITERS);
|
||||
}
|
||||
|
||||
info!("Success");
|
||||
SUCCESS
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
extern crate solana_sdk;
|
||||
use byteorder::{ByteOrder, LittleEndian};
|
||||
use solana_sdk::entrypoint::SUCCESS;
|
||||
use solana_sdk::info;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
||||
|
@ -15,6 +14,5 @@ pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
|||
LittleEndian::write_i16(&mut buf, -5_000);
|
||||
assert_eq!(-5_000, LittleEndian::read_i16(&buf));
|
||||
|
||||
info!("Success");
|
||||
SUCCESS
|
||||
}
|
||||
|
|
|
@ -16,6 +16,5 @@ pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
|||
info!(0xff, 0, 0, 0, sum);
|
||||
assert_eq!(sum, ITERS as u64);
|
||||
|
||||
info!("Success");
|
||||
SUCCESS
|
||||
}
|
||||
|
|
|
@ -24,6 +24,5 @@ pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
|||
}
|
||||
);
|
||||
|
||||
info!("Success");
|
||||
SUCCESS
|
||||
}
|
||||
|
|
|
@ -54,7 +54,6 @@ fn process_instruction(program_id: &Pubkey, accounts: &mut [AccountInfo], data:
|
|||
panic!();
|
||||
}
|
||||
|
||||
info!("Success");
|
||||
SUCCESS
|
||||
}
|
||||
|
||||
|
|
|
@ -20,5 +20,6 @@ pub extern "C" fn entrypoint(_input: *mut u8) -> u32 {
|
|||
let test_dep = TestDep::new(&data, 1, 2, 3, 4, 5);
|
||||
info!(0, 0, 0, 0, test_dep.thirty);
|
||||
assert!(test_dep.thirty == 30);
|
||||
|
||||
SUCCESS
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ pub fn helper_sol_log(
|
|||
if i == len - 1 || c == 0 {
|
||||
let message =
|
||||
from_utf8(from_raw_parts(host_addr as *const u8, len as usize)).unwrap();
|
||||
println!("info!: {}", message);
|
||||
info!("info!: {}", message);
|
||||
return Ok(0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ pub fn process_instruction(
|
|||
}
|
||||
let offset = offset as usize;
|
||||
let len = bytes.len();
|
||||
debug!("Write: offset={} length={}", offset, len);
|
||||
trace!("Write: offset={} length={}", offset, len);
|
||||
if keyed_accounts[0].account.data.len() < offset + len {
|
||||
warn!(
|
||||
"Write overflow: {} < {}",
|
||||
|
@ -126,7 +126,6 @@ pub fn process_instruction(
|
|||
}
|
||||
let (progs, params) = keyed_accounts.split_at_mut(1);
|
||||
let prog = &progs[0].account.data;
|
||||
info!("Call BPF program");
|
||||
let (mut vm, heap_region) = match create_vm(prog) {
|
||||
Ok(info) => info,
|
||||
Err(e) => {
|
||||
|
@ -136,6 +135,7 @@ pub fn process_instruction(
|
|||
};
|
||||
let mut v = serialize_parameters(program_id, params, &data);
|
||||
|
||||
info!("Call BPF program");
|
||||
match vm.execute_program(v.as_mut_slice(), &[], &[heap_region]) {
|
||||
Ok(status) => match u32::try_from(status) {
|
||||
Ok(status) => {
|
||||
|
@ -155,10 +155,7 @@ pub fn process_instruction(
|
|||
}
|
||||
}
|
||||
deserialize_parameters(params, &v);
|
||||
info!(
|
||||
"BPF program executed {} instructions",
|
||||
vm.get_last_instruction_count()
|
||||
);
|
||||
info!("BPF program success");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue