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
8 changes: 4 additions & 4 deletions core/src/banking_simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,22 +274,22 @@ impl SimulatorLoopLogger {

fn log_frozen_bank_cost(&self, bank: &Bank, bank_elapsed: Duration) {
info!(
"simulated bank slot+delta: {}+{}ms costs: {:?} fees: {} txs: {} (frozen)",
"simulated bank slot+delta: {}+{}ms costs: {:?} fees: {:?} txs: {} (frozen)",
bank.slot(),
bank_elapsed.as_millis(),
Self::bank_costs(bank),
bank.collector_fees(),
Comment thread
apfitzge marked this conversation as resolved.
bank.get_collector_fee_details(),
bank.executed_transaction_count(),
);
}

fn log_ongoing_bank_cost(&self, bank: &Bank, bank_elapsed: Duration) {
info!(
"simulated bank slot+delta: {}+{}ms costs: {:?} fees: {} txs: {} (ongoing)",
"simulated bank slot+delta: {}+{}ms costs: {:?} fees: {:?} txs: {} (ongoing)",
bank.slot(),
bank_elapsed.as_millis(),
Self::bank_costs(bank),
bank.collector_fees(),
bank.get_collector_fee_details(),
bank.executed_transaction_count(),
);
}
Expand Down
16 changes: 0 additions & 16 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ pub struct BankFieldsToDeserialize {
pub(crate) epoch: Epoch,
pub(crate) block_height: u64,
pub(crate) leader_id: Pubkey,
pub(crate) collector_fees: u64,
pub(crate) fee_rate_governor: FeeRateGovernor,
pub(crate) rent_collector: RentCollector,
pub(crate) epoch_schedule: EpochSchedule,
Expand Down Expand Up @@ -519,7 +518,6 @@ pub struct BankFieldsToSerialize {
pub epoch: Epoch,
pub block_height: u64,
pub leader_id: Pubkey,
pub collector_fees: u64,
pub fee_rate_governor: FeeRateGovernor,
pub rent_collector: RentCollector,
pub epoch_schedule: EpochSchedule,
Expand Down Expand Up @@ -568,7 +566,6 @@ impl PartialEq for Bank {
epoch,
block_height,
leader_id,
collector_fees,
fee_rate_governor,
rent_collector,
epoch_schedule,
Expand Down Expand Up @@ -630,7 +627,6 @@ impl PartialEq for Bank {
&& epoch == &other.epoch
&& block_height == &other.block_height
&& leader_id == &other.leader_id
&& collector_fees.load(Relaxed) == other.collector_fees.load(Relaxed)
&& fee_rate_governor == &other.fee_rate_governor
&& rent_collector == &other.rent_collector
&& epoch_schedule == &other.epoch_schedule
Expand Down Expand Up @@ -673,7 +669,6 @@ impl BankFieldsToSerialize {
epoch: Epoch::default(),
block_height: u64::default(),
leader_id: Pubkey::default(),
collector_fees: u64::default(),
fee_rate_governor: FeeRateGovernor::default(),
rent_collector: RentCollector::default(),
epoch_schedule: EpochSchedule::default(),
Expand Down Expand Up @@ -840,9 +835,6 @@ pub struct Bank {
/// The validator identity of the leader who produced this block.
leader_id: Pubkey,

/// Fees that have been collected
collector_fees: AtomicU64,
Comment on lines -843 to -844
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are zero writers to this field in the repo. And since it is private, it would require a helper fn to write to it. There isn't a helper fn that exposes the field in a way that would allow writing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This field stopped being used with the activation of this: #583"


/// Track cluster signature throughput and adjust fee rate
pub(crate) fee_rate_governor: FeeRateGovernor,

Expand Down Expand Up @@ -1127,7 +1119,6 @@ impl Bank {
epoch: Epoch::default(),
block_height: u64::default(),
leader_id: Pubkey::default(),
collector_fees: AtomicU64::default(),
fee_rate_governor: FeeRateGovernor::default(),
rent_collector: RentCollector::default(),
epoch_schedule: EpochSchedule::default(),
Expand Down Expand Up @@ -1370,7 +1361,6 @@ impl Bank {
parent_hash: parent.hash(),
parent_slot: parent.slot(),
leader_id: *leader_id,
collector_fees: AtomicU64::new(0),
ancestors: Ancestors::default(),
hash: RwLock::new(Hash::default()),
is_delta: AtomicBool::new(false),
Expand Down Expand Up @@ -1917,7 +1907,6 @@ impl Bank {
epoch: fields.epoch,
block_height: fields.block_height,
leader_id: fields.leader_id,
collector_fees: AtomicU64::new(fields.collector_fees),
fee_rate_governor: fields.fee_rate_governor,
// clone()-ing is needed to consider a gated behavior in rent_collector
rent_collector: Self::get_rent_collector_from(&fields.rent_collector, fields.epoch),
Expand Down Expand Up @@ -2038,7 +2027,6 @@ impl Bank {
epoch: self.epoch,
block_height: self.block_height,
leader_id: self.leader_id,
collector_fees: self.collector_fees.load(Relaxed),
fee_rate_governor: self.fee_rate_governor.clone(),
rent_collector: self.rent_collector.clone(),
epoch_schedule: self.epoch_schedule.clone(),
Expand Down Expand Up @@ -4888,10 +4876,6 @@ impl Bank {
hash
}

pub fn collector_fees(&self) -> u64 {
self.collector_fees.load(Relaxed)
}

/// Used by ledger tool to run a final hash calculation once all ledger replay has completed.
/// This should not be called by validator code.
pub fn run_final_hash_calc(&self) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/bank/serde_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ mod tests {
#[cfg_attr(
feature = "frozen-abi",
derive(AbiExample),
frozen_abi(digest = "FHeeuJgYyE1rqdLRycbJWC8PoTRZqYsRWZZCaP5A7DWb")
frozen_abi(digest = "EEwojKqUDSpYNeutW56K9bsJmsjCMZn8i4n3qgvJYRxf")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frozen abi digest changed due to renaming the field.

)]
#[derive(serde::Serialize)]
pub struct BankAbiTestWrapper {
Expand Down
7 changes: 3 additions & 4 deletions runtime/src/serde_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ struct DeserializableVersionedBank {
epoch: Epoch,
block_height: u64,
leader_id: Pubkey,
collector_fees: u64,
_unused_collector_fees: u64,
_unused_fee_calculator: u64,
fee_rate_governor: FeeRateGovernor,
_collected_rent: u64,
Expand Down Expand Up @@ -216,7 +216,6 @@ impl From<DeserializableVersionedBank> for BankFieldsToDeserialize {
epoch: dvb.epoch,
block_height: dvb.block_height,
leader_id: dvb.leader_id,
collector_fees: dvb.collector_fees,
fee_rate_governor: dvb.fee_rate_governor,
rent_collector: dvb.rent_collector,
epoch_schedule: dvb.epoch_schedule,
Expand Down Expand Up @@ -255,7 +254,7 @@ struct SerializableVersionedBank {
epoch: Epoch,
block_height: u64,
leader_id: Pubkey,
collector_fees: u64,
unused_collector_fees: u64,
unused_fee_calculator: u64,
fee_rate_governor: FeeRateGovernor,
collected_rent: u64,
Expand Down Expand Up @@ -293,7 +292,7 @@ impl From<BankFieldsToSerialize> for SerializableVersionedBank {
epoch: rhs.epoch,
block_height: rhs.block_height,
leader_id: rhs.leader_id,
collector_fees: rhs.collector_fees,
unused_collector_fees: 0,
unused_fee_calculator: 0,
fee_rate_governor: rhs.fee_rate_governor,
collected_rent: u64::default(),
Expand Down
Loading