Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
/programs/loader-v4/ @anza-xyz/svm
/runtime-transaction/ @anza-xyz/tx-metadata
/svm-conformance/ @anza-xyz/svm
/svm-rent-collector/ @anza-xyz/svm
/svm-transaction/ @anza-xyz/svm
/svm/ @anza-xyz/svm
/svm/examples/Cargo.lock
/svm-callback/ @anza-xyz/svm
/transaction-context/ @anza-xyz/svm
/transaction-view/ @anza-xyz/tx-metadata
/transaction-view/ @anza-xyz/tx-metadata
17 changes: 0 additions & 17 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ members = [
"svm-callback",
"svm-conformance",
"svm-feature-set",
"svm-rent-collector",
"svm-transaction",
"syscalls",
"syscalls/gen-syscall-list",
Expand Down Expand Up @@ -527,7 +526,6 @@ solana-svm = { path = "svm", version = "=3.0.0" }
solana-svm-callback = { path = "svm-callback", version = "=3.0.0" }
solana-svm-conformance = { path = "svm-conformance", version = "=3.0.0" }
solana-svm-feature-set = { path = "svm-feature-set", version = "=3.0.0" }
solana-svm-rent-collector = { path = "svm-rent-collector", version = "=3.0.0" }
solana-svm-transaction = { path = "svm-transaction", version = "=3.0.0" }
solana-system-interface = "1.0"
solana-system-program = { path = "programs/system", version = "=3.0.0" }
Expand Down
2 changes: 1 addition & 1 deletion core/src/banking_stage/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl Consumer {
&mut fee_payer_account,
0,
error_counters,
bank.rent_collector(),
&bank.rent_collector().rent,
fee,
)
}
Expand Down
16 changes: 0 additions & 16 deletions programs/sbf/Cargo.lock

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

1 change: 0 additions & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ solana-stake-interface = { workspace = true }
solana-stake-program = { workspace = true }
solana-svm = { workspace = true }
solana-svm-callback = { workspace = true }
solana-svm-rent-collector = { workspace = true }
solana-svm-transaction = { workspace = true }
solana-system-interface = { workspace = true }
solana-system-program = { workspace = true, optional = true }
Expand Down
5 changes: 1 addition & 4 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use {
epoch_stakes::{NodeVoteAccounts, VersionedEpochStakes},
inflation_rewards::points::InflationPointCalculationEvent,
installed_scheduler_pool::{BankWithScheduler, InstalledSchedulerRwLock},
rent_collector::RentCollectorWithMetrics,
runtime_config::RuntimeConfig,
snapshot_hash::SnapshotHash,
stake_account::StakeAccount,
Expand Down Expand Up @@ -3266,14 +3265,12 @@ impl Bank {

let (blockhash, blockhash_lamports_per_signature) =
self.last_blockhash_and_lamports_per_signature();
let rent_collector_with_metrics =
RentCollectorWithMetrics::new(self.rent_collector.clone());
let processing_environment = TransactionProcessingEnvironment {
blockhash,
blockhash_lamports_per_signature,
epoch_total_stake: self.get_current_epoch_total_stake(),
feature_set: self.feature_set.runtime_features(),
rent_collector: Some(&rent_collector_with_metrics),
rent: self.rent_collector.rent.clone(),
};

let sanitized_output = self
Expand Down
13 changes: 7 additions & 6 deletions runtime/src/bank/fee_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use {
solana_pubkey::Pubkey,
solana_reward_info::{RewardInfo, RewardType},
solana_runtime_transaction::transaction_with_meta::TransactionWithMeta,
solana_svm_rent_collector::svm_rent_collector::SVMRentCollector,
solana_svm::rent_calculator::{get_account_rent_state, transition_allowed},
solana_system_interface::program as system_program,
std::{result::Result, sync::atomic::Ordering::Relaxed},
thiserror::Error,
Expand Down Expand Up @@ -153,16 +153,17 @@ impl Bank {
return Err(DepositFeeError::InvalidAccountOwner);
}

let recipient_pre_rent_state = self.rent_collector().get_account_rent_state(&account);
let recipient_pre_rent_state =
get_account_rent_state(&self.rent_collector().rent, &account);
let distribution = account.checked_add_lamports(fees);
if distribution.is_err() {
return Err(DepositFeeError::LamportOverflow);
}

let recipient_post_rent_state = self.rent_collector().get_account_rent_state(&account);
let rent_state_transition_allowed = self
.rent_collector()
.transition_allowed(&recipient_pre_rent_state, &recipient_post_rent_state);
let recipient_post_rent_state =
get_account_rent_state(&self.rent_collector().rent, &account);
let rent_state_transition_allowed =
transition_allowed(&recipient_pre_rent_state, &recipient_post_rent_state);
if !rent_state_transition_allowed {
return Err(DepositFeeError::InvalidRentPayingAccount);
}
Expand Down
1 change: 0 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub mod loader_utils;
pub mod non_circulating_supply;
pub mod prioritization_fee;
pub mod prioritization_fee_cache;
pub mod rent_collector;
Comment thread
buffalojoec marked this conversation as resolved.
pub mod root_bank_cache;
pub mod runtime_config;
pub mod serde_snapshot;
Expand Down
84 changes: 0 additions & 84 deletions runtime/src/rent_collector.rs

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/patch-crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ update_solana_dependencies() {
solana-storage-bigtable
solana-storage-proto
solana-streamer
solana-svm-rent-collector
solana-svm-rent-calculator
solana-svm-transaction
solana-test-validator
solana-thin-client
Expand Down
11 changes: 3 additions & 8 deletions svm-rent-collector/Cargo.toml → svm-rent-calculator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "solana-svm-rent-collector"
description = "Solana SVM Rent Collector"
documentation = "https://docs.rs/solana-svm-rent-collector"
name = "solana-svm-rent-calculator"
description = "Solana SVM Rent Calculator"
documentation = "https://docs.rs/solana-svm-rent-calculator"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
Expand All @@ -11,13 +11,8 @@ edition = { workspace = true }

[dependencies]
solana-account = { workspace = true }
solana-clock = { workspace = true }
solana-pubkey = { workspace = true }
solana-rent = { workspace = true }
solana-rent-collector = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-transaction-context = { workspace = true }
solana-transaction-error = { workspace = true }

[dev-dependencies]
solana-epoch-schedule = { workspace = true }
6 changes: 6 additions & 0 deletions svm-rent-calculator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! Solana SVM Rent Calculator.
//!
//! Rent management for SVM.

pub mod rent_state;
pub mod svm_rent_calculator;
Loading
Loading