Adjust default cluster signature fees (#6436)

This commit is contained in:
Michael Vines
2019-10-18 17:00:51 -07:00
committed by GitHub
parent f2fd53e773
commit 621c67a8cb
7 changed files with 19 additions and 20 deletions

View File

@ -25,10 +25,9 @@ pub struct FeeCalculator {
pub burn_percent: u8,
}
/// TODO: determine good values for these
pub const DEFAULT_TARGET_LAMPORTS_PER_SIGNATURE: u64 = 42;
pub const DEFAULT_TARGET_LAMPORTS_PER_SIGNATURE: u64 = 171_717;
pub const DEFAULT_TARGET_SIGNATURES_PER_SLOT: usize =
710_000 * DEFAULT_TICKS_PER_SLOT as usize / DEFAULT_TICKS_PER_SECOND as usize;
50_000 * DEFAULT_TICKS_PER_SLOT as usize / DEFAULT_TICKS_PER_SECOND as usize;
pub const DEFAULT_BURN_PERCENT: u8 = ((50usize * std::u8::MAX as usize) / 100usize) as u8;
impl Default for FeeCalculator {
@ -196,8 +195,14 @@ mod tests {
f1.target_signatures_per_slot,
DEFAULT_TARGET_SIGNATURES_PER_SLOT
);
assert_eq!(f1.target_lamports_per_signature, 42);
assert_eq!(f1.lamports_per_signature, 21); // min
assert_eq!(
f1.target_lamports_per_signature,
DEFAULT_TARGET_LAMPORTS_PER_SIGNATURE
);
assert_eq!(
f1.lamports_per_signature,
DEFAULT_TARGET_LAMPORTS_PER_SIGNATURE / 2
); // min
}
#[test]