Skip to content

Commit

Permalink
Use serde provided serialization for atomics (solana-labs#10096)
Browse files Browse the repository at this point in the history
automerge
  • Loading branch information
svenski123 authored May 18, 2020
1 parent bfcfbab commit 4ca352a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 82 deletions.
17 changes: 0 additions & 17 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ use crate::{
message_processor::{MessageProcessor, ProcessInstruction},
nonce_utils,
rent_collector::RentCollector,
serde_utils::{
deserialize_atomicbool, deserialize_atomicu64, serialize_atomicbool, serialize_atomicu64,
},
stakes::Stakes,
status_cache::{SlotDelta, StatusCache},
system_instruction_processor::{self, get_system_account_kind, SystemAccountKind},
Expand Down Expand Up @@ -271,23 +268,15 @@ pub struct Bank {
hard_forks: Arc<RwLock<HardForks>>,

/// The number of transactions processed without error
#[serde(serialize_with = "serialize_atomicu64")]
#[serde(deserialize_with = "deserialize_atomicu64")]
transaction_count: AtomicU64,

/// Bank tick height
#[serde(serialize_with = "serialize_atomicu64")]
#[serde(deserialize_with = "deserialize_atomicu64")]
tick_height: AtomicU64,

/// The number of signatures from valid transactions in this slot
#[serde(serialize_with = "serialize_atomicu64")]
#[serde(deserialize_with = "deserialize_atomicu64")]
signature_count: AtomicU64,

/// Total capitalization, used to calculate inflation
#[serde(serialize_with = "serialize_atomicu64")]
#[serde(deserialize_with = "deserialize_atomicu64")]
capitalization: AtomicU64,

// Bank max_tick_height
Expand Down Expand Up @@ -324,8 +313,6 @@ pub struct Bank {
collector_id: Pubkey,

/// Fees that have been collected
#[serde(serialize_with = "serialize_atomicu64")]
#[serde(deserialize_with = "deserialize_atomicu64")]
collector_fees: AtomicU64,

/// Latest transaction fees for transactions processed by this bank
Expand All @@ -335,8 +322,6 @@ pub struct Bank {
fee_rate_governor: FeeRateGovernor,

/// Rent that have been collected
#[serde(serialize_with = "serialize_atomicu64")]
#[serde(deserialize_with = "deserialize_atomicu64")]
collected_rent: AtomicU64,

/// latest rent collector, knows the epoch
Expand All @@ -360,8 +345,6 @@ pub struct Bank {

/// A boolean reflecting whether any entries were recorded into the PoH
/// stream for the slot == self.slot
#[serde(serialize_with = "serialize_atomicbool")]
#[serde(deserialize_with = "deserialize_atomicbool")]
is_delta: AtomicBool,

/// The Message processor
Expand Down
1 change: 0 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub mod message_processor;
mod native_loader;
pub mod nonce_utils;
pub mod rent_collector;
mod serde_utils;
pub mod stakes;
pub mod status_cache;
mod system_instruction_processor;
Expand Down
64 changes: 0 additions & 64 deletions runtime/src/serde_utils.rs

This file was deleted.

0 comments on commit 4ca352a

Please sign in to comment.