Double the chunk size for sending the program binary data in tx

(cherry picked from commit 03ed334ebb)

# Conflicts:
#	programs/bpf/tests/programs.rs
This commit is contained in:
Dmitri Makarov
2022-03-14 18:41:03 -07:00
committed by Dmitri Makarov
parent 643ae053ab
commit 2ae5b411f5
2 changed files with 22 additions and 3 deletions

View File

@ -111,7 +111,7 @@ fn write_bpf_program(
program_keypair: &Keypair,
elf: &[u8],
) {
let chunk_size = 256; // Size of chunk just needs to fit into tx
let chunk_size = 512; // Size of chunk just needs to fit into tx
let mut offset = 0;
for chunk in elf.chunks(chunk_size) {
let instruction =
@ -1412,6 +1412,7 @@ fn assert_instruction_count() {
{
programs.extend_from_slice(&[
("solana_bpf_rust_128bit", 584),
<<<<<<< HEAD
("solana_bpf_rust_alloc", 7388),
("solana_bpf_rust_custom_heap", 536),
("solana_bpf_rust_dep_crate", 47),
@ -1426,6 +1427,22 @@ fn assert_instruction_count() {
("solana_bpf_rust_sanity", 9128),
("solana_bpf_rust_secp256k1_recover", 25889),
("solana_bpf_rust_sha", 30692),
=======
("solana_bpf_rust_alloc", 4459),
("solana_bpf_rust_custom_heap", 469),
("solana_bpf_rust_dep_crate", 2),
("solana_bpf_rust_external_spend", 338),
("solana_bpf_rust_iter", 108),
("solana_bpf_rust_many_args", 1289),
("solana_bpf_rust_mem", 2118),
("solana_bpf_rust_membuiltins", 1539),
("solana_bpf_rust_noop", 326),
("solana_bpf_rust_param_passing", 146),
("solana_bpf_rust_rand", 429),
("solana_bpf_rust_sanity", 9139),
("solana_bpf_rust_secp256k1_recover", 25707),
("solana_bpf_rust_sha", 26390),
>>>>>>> 03ed334eb (Double the chunk size for sending the program binary data in tx)
]);
}

View File

@ -12,6 +12,8 @@ use {
},
};
const CHUNK_SIZE: usize = 512; // Size of chunk just needs to fit into tx
pub fn load_program<T: Client>(
bank_client: &T,
from_keypair: &Keypair,
@ -39,7 +41,7 @@ pub fn load_program<T: Client>(
)
.unwrap();
let chunk_size = 256; // Size of chunk just needs to fit into tx
let chunk_size = CHUNK_SIZE;
let mut offset = 0;
for chunk in program.chunks(chunk_size) {
let instruction =
@ -91,7 +93,7 @@ pub fn load_buffer_account<T: Client>(
)
.unwrap();
let chunk_size = 256; // Size of chunk just needs to fit into tx
let chunk_size = CHUNK_SIZE;
let mut offset = 0;
for chunk in program.chunks(chunk_size) {
let message = Message::new(