Charge compute budget for bytes passed via cpi (#15874)

This commit is contained in:
Jack May
2021-03-15 22:41:44 -07:00
committed by GitHub
parent 8567b41d5f
commit ad9901d7c6
4 changed files with 35 additions and 7 deletions

View File

@@ -128,6 +128,8 @@ pub struct BpfComputeBudget {
pub log_pubkey_units: u64,
/// Maximum cross-program invocation instruction size
pub max_cpi_instruction_size: usize,
/// Number of account data bytes per conpute unit charged during a cross-program invocation
pub cpi_bytes_per_unit: u64,
}
impl Default for BpfComputeBudget {
fn default() -> Self {
@@ -149,6 +151,7 @@ impl BpfComputeBudget {
stack_frame_size: 4_096,
log_pubkey_units: 100,
max_cpi_instruction_size: 1280, // IPv6 Min MTU size
cpi_bytes_per_unit: 250, // ~50MB at 200,000 units
}
}
}