Skip to content

Commit

Permalink
Reduce public visibile APIs in solana-fee (#4588)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 authored Jan 23, 2025
1 parent 441619d commit 4f98820
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ license = { workspace = true }
edition = { workspace = true }

[dependencies]
qualifier_attr = { workspace = true }
solana-feature-set = { workspace = true }
solana-fee-structure = { workspace = true }
solana-svm-transaction = { workspace = true }

[features]
svm-internal = []
21 changes: 15 additions & 6 deletions fee/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(feature = "svm-internal")]
use qualifier_attr::field_qualifiers;
use {
solana_feature_set::{
enable_secp256r1_precompile, remove_rounding_in_fee_calculation, FeatureSet,
Expand All @@ -13,9 +15,16 @@ use {
// instead of removing, since fees will naturally be changed via feature-gates
// in the future. Keeping this struct will help keep things organized.
#[derive(Copy, Clone)]
#[cfg_attr(
feature = "svm-internal",
field_qualifiers(
remove_rounding_in_fee_calculation(pub),
enable_secp256r1_precompile(pub)
)
)]
pub struct FeeFeatures {
pub remove_rounding_in_fee_calculation: bool,
pub enable_secp256r1_precompile: bool,
remove_rounding_in_fee_calculation: bool,
enable_secp256r1_precompile: bool,
}

impl From<&FeatureSet> for FeeFeatures {
Expand Down Expand Up @@ -89,10 +98,10 @@ fn calculate_signature_fee(
}

struct SignatureCounts {
pub num_transaction_signatures: u64,
pub num_ed25519_signatures: u64,
pub num_secp256k1_signatures: u64,
pub num_secp256r1_signatures: u64,
num_transaction_signatures: u64,
num_ed25519_signatures: u64,
num_secp256k1_signatures: u64,
num_secp256r1_signatures: u64,
}

impl<Tx: SVMMessage> From<&Tx> for SignatureCounts {
Expand Down
1 change: 1 addition & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion svm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ solana-clock = { workspace = true }
solana-compute-budget = { workspace = true }
solana-compute-budget-instruction = { workspace = true }
solana-feature-set = { workspace = true }
solana-fee = { workspace = true }
solana-fee = { workspace = true, features = ["svm-internal"] }
solana-fee-structure = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true, features = [
"frozen-abi",
Expand Down
1 change: 1 addition & 0 deletions svm/examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f98820

Please sign in to comment.