Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 04ec54c

Browse files
committed
added alt_bn syscalls
odered dependencies moved dependencies to not(target_os = "solana") refactored syscalls
1 parent 1224c54 commit 04ec54c

File tree

18 files changed

+1819
-41
lines changed

18 files changed

+1819
-41
lines changed

Cargo.lock

+112
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

program-runtime/src/compute_budget.rs

+12
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ pub struct ComputeBudget {
8686
pub mem_op_base_cost: u64,
8787
/// Number of compute units consumed per AccountPropertyUpdate
8888
pub account_property_update_cost: u64,
89+
/// Number of compute units consumed to call alt_bn128_addition
90+
pub alt_bn128_addition_cost: u64,
91+
/// Number of compute units consumed to call alt_bn128_multiplication.
92+
pub alt_bn128_multiplication_cost: u64,
93+
/// Total cost will be alt_bn128_pairing_one_pair_cost_first
94+
/// + alt_bn128_pairing_one_pair_cost_other * (num_elems - 1)
95+
pub alt_bn128_pairing_one_pair_cost_first: u64,
96+
pub alt_bn128_pairing_one_pair_cost_other: u64,
8997
}
9098

9199
impl Default for ComputeBudget {
@@ -126,6 +134,10 @@ impl ComputeBudget {
126134
heap_cost: 8,
127135
mem_op_base_cost: 10,
128136
account_property_update_cost: 10,
137+
alt_bn128_addition_cost: 334,
138+
alt_bn128_multiplication_cost: 3_840,
139+
alt_bn128_pairing_one_pair_cost_first: 36_364,
140+
alt_bn128_pairing_one_pair_cost_other: 12_121,
129141
}
130142
}
131143

0 commit comments

Comments
 (0)