-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathlib.rs
44 lines (32 loc) · 1.16 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use std::{sync::Arc, time::Duration};
use batch_builder::batch::TransactionBatch;
use miden_objects::transaction::ProvenTransaction;
use tokio::sync::RwLock;
#[cfg(test)]
pub mod test_utils;
mod batch_builder;
mod block_builder;
mod errors;
mod state_view;
mod store;
mod txqueue;
pub mod block;
pub mod cli;
pub mod config;
pub mod server;
// TYPE ALIASES
// =================================================================================================
/// A proven transaction that can be shared across threads
pub(crate) type SharedRwVec<T> = Arc<RwLock<Vec<T>>>;
// CONSTANTS
// =================================================================================================
/// The name of the block producer component
pub const COMPONENT: &str = "miden-block-producer";
/// The number of transactions per batch
const SERVER_BATCH_SIZE: usize = 2;
/// The frequency at which blocks are produced
const SERVER_BLOCK_FREQUENCY: Duration = Duration::from_secs(10);
/// The frequency at which batches are built
const SERVER_BUILD_BATCH_FREQUENCY: Duration = Duration::from_secs(2);
/// Maximum number of batches per block
const SERVER_MAX_BATCHES_PER_BLOCK: usize = 4;