Move Bank to its own crate

Also:
* counters.rs to solana_metrics
* genesis_block.rs to solana_sdk
This commit is contained in:
Greg Fitzgerald
2019-02-18 23:26:22 -07:00
parent 781f7ef570
commit dde886f058
61 changed files with 409 additions and 382 deletions

View File

@ -9,6 +9,14 @@ pub const NUM_TICKS_PER_SECOND: usize = 10;
pub const DEFAULT_TICKS_PER_SLOT: u64 = 8;
pub const DEFAULT_SLOTS_PER_EPOCH: u64 = 64;
/// The number of most recent `last_id` values that the bank will track the signatures
/// of. Once the bank discards a `last_id`, it will reject any transactions that use
/// that `last_id` in a transaction. Lowering this value reduces memory consumption,
/// but requires clients to update its `last_id` more frequently. Raising the value
/// lengthens the time a client must wait to be certain a missing transaction will
/// not be processed by the network.
pub const MAX_ENTRY_IDS: usize = NUM_TICKS_PER_SECOND * 120;
pub fn duration_as_us(d: &Duration) -> u64 {
(d.as_secs() * 1000 * 1000) + (u64::from(d.subsec_nanos()) / 1_000)
}