add sha256 syscall (#12569)

This commit is contained in:
Jack May
2020-09-29 23:29:20 -07:00
committed by GitHub
parent 89424b29bf
commit 058bca6632
16 changed files with 321 additions and 6 deletions

View File

@@ -87,6 +87,10 @@ pub struct ComputeBudget {
pub invoke_units: u64,
/// Maximum cross-program invocation depth allowed including the orignal caller
pub max_invoke_depth: usize,
/// Base number of compute units consumed to call sha256
pub sha256_base_cost: u64,
/// Incremental number of units consumed by sha256 (based on bytes)
pub sha256_byte_cost: u64,
}
impl Default for ComputeBudget {
fn default() -> Self {
@@ -98,6 +102,8 @@ impl Default for ComputeBudget {
create_program_address_units: 1500,
invoke_units: 1000,
max_invoke_depth: 2,
sha256_base_cost: 85,
sha256_byte_cost: 1,
}
}
}