pub struct SVMTransactionExecutionCost {Show 37 fields
pub log_64_units: u64,
pub create_program_address_units: u64,
pub invoke_units: u64,
pub sha256_base_cost: u64,
pub sha256_byte_cost: u64,
pub log_pubkey_units: u64,
pub cpi_bytes_per_unit: u64,
pub sysvar_base_cost: u64,
pub secp256k1_recover_cost: u64,
pub syscall_base_cost: u64,
pub curve25519_edwards_validate_point_cost: u64,
pub curve25519_edwards_add_cost: u64,
pub curve25519_edwards_subtract_cost: u64,
pub curve25519_edwards_multiply_cost: u64,
pub curve25519_edwards_msm_base_cost: u64,
pub curve25519_edwards_msm_incremental_cost: u64,
pub curve25519_ristretto_validate_point_cost: u64,
pub curve25519_ristretto_add_cost: u64,
pub curve25519_ristretto_subtract_cost: u64,
pub curve25519_ristretto_multiply_cost: u64,
pub curve25519_ristretto_msm_base_cost: u64,
pub curve25519_ristretto_msm_incremental_cost: u64,
pub heap_cost: u64,
pub mem_op_base_cost: u64,
pub alt_bn128_addition_cost: u64,
pub alt_bn128_multiplication_cost: u64,
pub alt_bn128_pairing_one_pair_cost_first: u64,
pub alt_bn128_pairing_one_pair_cost_other: u64,
pub big_modular_exponentiation_base_cost: u64,
pub big_modular_exponentiation_cost_divisor: u64,
pub poseidon_cost_coefficient_a: u64,
pub poseidon_cost_coefficient_c: u64,
pub get_remaining_compute_units_cost: u64,
pub alt_bn128_g1_compress: u64,
pub alt_bn128_g1_decompress: u64,
pub alt_bn128_g2_compress: u64,
pub alt_bn128_g2_decompress: u64,
}agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Fields§
§log_64_units: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed by a log_u64 call
create_program_address_units: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed by a create_program_address call
invoke_units: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed by an invoke call (not including the cost incurred by the called program)
sha256_base_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Base number of compute units consumed to call SHA256
sha256_byte_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Incremental number of units consumed by SHA256 (based on bytes)
log_pubkey_units: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed by logging a Pubkey
cpi_bytes_per_unit: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of account data bytes per compute unit charged during a cross-program invocation
sysvar_base_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Base number of compute units consumed to get a sysvar
secp256k1_recover_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to call secp256k1_recover
syscall_base_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to do a syscall without any work
curve25519_edwards_validate_point_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to validate a curve25519 edwards point
curve25519_edwards_add_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to add two curve25519 edwards points
curve25519_edwards_subtract_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to subtract two curve25519 edwards points
curve25519_edwards_multiply_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to multiply a curve25519 edwards point
curve25519_edwards_msm_base_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed for a multiscalar multiplication (msm) of edwards points.
The total cost is calculated as msm_base_cost + (length - 1) * msm_incremental_cost.
curve25519_edwards_msm_incremental_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed for a multiscalar multiplication (msm) of edwards points.
The total cost is calculated as msm_base_cost + (length - 1) * msm_incremental_cost.
curve25519_ristretto_validate_point_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to validate a curve25519 ristretto point
curve25519_ristretto_add_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to add two curve25519 ristretto points
curve25519_ristretto_subtract_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to subtract two curve25519 ristretto points
curve25519_ristretto_multiply_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to multiply a curve25519 ristretto point
curve25519_ristretto_msm_base_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed for a multiscalar multiplication (msm) of ristretto points.
The total cost is calculated as msm_base_cost + (length - 1) * msm_incremental_cost.
curve25519_ristretto_msm_incremental_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed for a multiscalar multiplication (msm) of ristretto points.
The total cost is calculated as msm_base_cost + (length - 1) * msm_incremental_cost.
heap_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units per additional 32k heap above the default (~.5 us per 32k at 15 units/us rounded up)
mem_op_base_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Memory operation syscall base cost
alt_bn128_addition_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to call alt_bn128_addition
alt_bn128_multiplication_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to call alt_bn128_multiplication.
alt_bn128_pairing_one_pair_cost_first: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Total cost will be alt_bn128_pairing_one_pair_cost_first
- alt_bn128_pairing_one_pair_cost_other * (num_elems - 1)
alt_bn128_pairing_one_pair_cost_other: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.big_modular_exponentiation_base_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Big integer modular exponentiation base cost
big_modular_exponentiation_cost_divisor: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Big integer moduler exponentiation cost divisor
The modular exponentiation cost is computed as
input_length/big_modular_exponentiation_cost_divisor + big_modular_exponentiation_base_cost
poseidon_cost_coefficient_a: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Coefficient a of the quadratic function which determines the number
of compute units consumed to call poseidon syscall for a given number
of inputs.
poseidon_cost_coefficient_c: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Coefficient c of the quadratic function which determines the number
of compute units consumed to call poseidon syscall for a given number
of inputs.
get_remaining_compute_units_cost: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed for accessing the remaining compute units.
alt_bn128_g1_compress: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to call alt_bn128_g1_compress.
alt_bn128_g1_decompress: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to call alt_bn128_g1_decompress.
alt_bn128_g2_compress: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to call alt_bn128_g2_compress.
alt_bn128_g2_decompress: u64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Number of compute units consumed to call alt_bn128_g2_decompress.
Implementations§
Source§impl SVMTransactionExecutionCost
impl SVMTransactionExecutionCost
pub fn new_with_defaults(simd_0339_active: bool) -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Sourcepub fn poseidon_cost(&self, nr_inputs: u64) -> Option<u64>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn poseidon_cost(&self, nr_inputs: u64) -> Option<u64>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Returns cost of the Poseidon hash function for the given number of inputs is determined by the following quadratic function:
61*n^2 + 542
Which aproximates the results of benchmarks of light-posiedon library[0]. These results assume 1 CU per 33 ns. Examples:
- 1 input
- light-poseidon benchmark:
18,303 / 33 ≈ 555 - function:
61*1^2 + 542 = 603
- light-poseidon benchmark:
- 2 inputs
- light-poseidon benchmark:
25,866 / 33 ≈ 784 - function:
61*2^2 + 542 = 786
- light-poseidon benchmark:
- 3 inputs
- light-poseidon benchmark:
37,549 / 33 ≈ 1,138 - function;
61*3^2 + 542 = 1091
- light-poseidon benchmark:
[0] https://github.com/Lightprotocol/light-poseidon#performance
Trait Implementations§
Source§impl Clone for SVMTransactionExecutionCost
impl Clone for SVMTransactionExecutionCost
Source§fn clone(&self) -> SVMTransactionExecutionCost
fn clone(&self) -> SVMTransactionExecutionCost
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SVMTransactionExecutionCost
impl Debug for SVMTransactionExecutionCost
impl Copy for SVMTransactionExecutionCost
impl Eq for SVMTransactionExecutionCost
impl StructuralPartialEq for SVMTransactionExecutionCost
Auto Trait Implementations§
impl Freeze for SVMTransactionExecutionCost
impl RefUnwindSafe for SVMTransactionExecutionCost
impl Send for SVMTransactionExecutionCost
impl Sync for SVMTransactionExecutionCost
impl Unpin for SVMTransactionExecutionCost
impl UnwindSafe for SVMTransactionExecutionCost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more