protocol.rs (1988B)
1 pub type Amount = u64; 2 3 pub const MICRO_IUNA: Amount = 1_000_000; 4 pub const BLOCK_REWARD: Amount = MICRO_IUNA; 5 pub const MINE_REWARD: Amount = MICRO_IUNA; 6 pub const MINE_FINALIZER_FEE: Amount = MICRO_IUNA; 7 pub const DEFAULT_MINE_FEE: Amount = MINE_FINALIZER_FEE; 8 pub const DEFAULT_TRANSACTION_FEE: Amount = MICRO_IUNA; 9 pub const DEFAULT_FEE_PER_BYTE: Amount = 1; 10 pub const MAX_BLOCK_BYTES: usize = 100_000; 11 pub const VDF_TARGET_BLOCK_MS: u64 = 5 * 60 * 1_000; 12 pub const RECOVERY_BLOCK_DELAY_MS: u64 = VDF_TARGET_BLOCK_MS * 6; 13 pub const MAX_VDF_ROUNDS: u64 = i64::MAX as u64; 14 pub const MINE_DIFFICULTY_BITS: u32 = 12; 15 pub const MINE_ACTIONS_PER_ANCHOR_LIMIT: usize = 2; 16 pub const MAX_BLINDED_TRANSACTION_EXPIRY_HEIGHTS: u64 = 20; 17 pub const REVEAL_COMMITTEE_SIZE: usize = 3; 18 pub const MAX_REVEAL_BUNDLE_BYTES: usize = 10_000; 19 pub const BLINDED_FEE_BPS_DENOMINATOR: u64 = 10_000; 20 pub const BLINDED_COMMITTER_FEE_BPS: u64 = 3_500; 21 pub const BLINDED_REVEAL_FINALIZER_FEE_BPS: u64 = 3_500; 22 pub const BLINDED_REVEAL_BUNDLE_SIGNER_FEE_BPS: u64 = 1_000; 23 24 pub const MAX_PENDING_TRANSACTIONS: usize = 10_000; 25 pub(super) const MAX_ORPHAN_TRANSACTIONS: usize = 1_024; 26 pub(super) const MAX_BLOCK_TRANSACTIONS: usize = 1_000; 27 pub(super) const DEFAULT_TICKET_MATURITY_DELAY: u64 = 3; 28 pub(super) const DEFAULT_TICKET_EXPIRY_WINDOW: u64 = 3; 29 pub(super) const MAX_BLOCK_TIMESTAMP_FUTURE_DRIFT_MS: u64 = 2 * 60 * 1_000; 30 pub(super) const BLOCK_MEDIAN_TIME_PAST_WINDOW: usize = 11; 31 pub(super) const FORK_FINALITY_DEPTH: u64 = 6; 32 pub(super) const PUBLIC_KEY_BYTES: usize = 32; 33 pub(super) const HASH_BYTES: usize = 32; 34 pub(super) const SIGNATURE_BYTES: usize = 64; 35 pub(super) const BLINDED_KEY_BYTES: usize = 32; 36 pub(super) const BLINDED_NONCE_BYTES: usize = 12; 37 38 #[derive(Clone, Copy, Debug, Eq, PartialEq)] 39 pub enum TransactionSubmitOutcome { 40 Added, 41 AlreadyKnown, 42 ConflictsWithPending, 43 } 44 45 impl TransactionSubmitOutcome { 46 pub fn added(self) -> bool { 47 matches!(self, Self::Added) 48 } 49 }