Add ecrecover syscall (backport #17720) (#18500)

* Add ecrecover syscall (#17720)

Co-authored-by: Anton Lisanin <lisanin.anton@gmail.com>
(cherry picked from commit 1f288ce527)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/Cargo.toml
#	programs/bpf_loader/src/syscalls.rs
#	sdk/program/Cargo.toml

* resolve conflicts

Co-authored-by: s-medvedev <40623263+s-medvedev@users.noreply.github.com>
Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2021-07-08 21:56:19 +00:00
committed by GitHub
parent 030a97d098
commit 8c328316ae
16 changed files with 504 additions and 8 deletions

View File

@@ -179,6 +179,8 @@ pub struct BpfComputeBudget {
pub cpi_bytes_per_unit: u64,
/// Base number of compute units consumed to get a sysvar
pub sysvar_base_cost: u64,
/// Number of compute units consumed to call secp256k1_recover
pub secp256k1_recover_cost: u64,
}
impl Default for BpfComputeBudget {
fn default() -> Self {
@@ -202,6 +204,7 @@ impl BpfComputeBudget {
max_cpi_instruction_size: 1280, // IPv6 Min MTU size
cpi_bytes_per_unit: 250, // ~50MB at 200,000 units
sysvar_base_cost: 100,
secp256k1_recover_cost: 25_000,
}
}
}