From 180c76882243c8d56fde02ba0150edf175312a76 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 11 Oct 2022 19:14:32 +0200 Subject: [PATCH] docs(txpool): add note for minimal protocol base fee (#47) --- crates/transaction-pool/src/pool/txpool.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/transaction-pool/src/pool/txpool.rs b/crates/transaction-pool/src/pool/txpool.rs index 38d7f5a4b..edd5a4781 100644 --- a/crates/transaction-pool/src/pool/txpool.rs +++ b/crates/transaction-pool/src/pool/txpool.rs @@ -20,6 +20,11 @@ use std::{ sync::Arc, }; +/// The minimal value the basefee can decrease to +/// +/// The `BASE_FEE_MAX_CHANGE_DENOMINATOR` (https://eips.ethereum.org/EIPS/eip-1559) is `8`, or 12.5%, once the base fee has dropped to `7` WEI it cannot decrease further because 12.5% of 7 is less than 1. +const MIN_PROTOCOL_BASE_FEE: U256 = U256([7, 0, 0, 0]); + /// A pool that manages transactions. /// /// This pool maintains the state of all transactions and stores them accordingly. @@ -585,8 +590,7 @@ impl Default for AllTransactions { fn default() -> Self { Self { pending_basefee: Default::default(), - // TODO(mattsse): document - minimal_protocol_basefee: 7u64.into(), + minimal_protocol_basefee: MIN_PROTOCOL_BASE_FEE, block_gas_limit: 30_000_000, by_hash: Default::default(), txs: Default::default(),