Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use serde provided serialization for atomics #10096

Merged
merged 2 commits into from
May 18, 2020
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
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.