mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
primitive-traits: use alloy MIN_PROTOCOL_BASE_FEE constant (#12037)
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
//! Transaction pool arguments
|
||||
|
||||
use crate::cli::config::RethTransactionPoolConfig;
|
||||
use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT;
|
||||
use alloy_eips::eip1559::{ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE};
|
||||
use alloy_primitives::Address;
|
||||
use clap::Args;
|
||||
use reth_primitives::constants::MIN_PROTOCOL_BASE_FEE;
|
||||
use reth_transaction_pool::{
|
||||
blobstore::disk::DEFAULT_MAX_CACHED_BLOBS,
|
||||
pool::{NEW_TX_LISTENER_BUFFER_SIZE, PENDING_TX_LISTENER_BUFFER_SIZE},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
//! Ethereum protocol-related constants
|
||||
|
||||
use alloy_primitives::{address, b256, Address, B256, U256};
|
||||
use alloy_primitives::{address, b256, Address, B256};
|
||||
|
||||
/// Gas units, for example [`GIGAGAS`].
|
||||
pub mod gas_units;
|
||||
@ -9,20 +9,6 @@ pub use gas_units::{GIGAGAS, KILOGAS, MEGAGAS};
|
||||
/// The client version: `reth/v{major}.{minor}.{patch}`
|
||||
pub const RETH_CLIENT_VERSION: &str = concat!("reth/v", env!("CARGO_PKG_VERSION"));
|
||||
|
||||
/// The minimum tx fee below which the txpool will reject the transaction.
|
||||
///
|
||||
/// Configured to `7` WEI which is the lowest possible value of base fee under mainnet EIP-1559
|
||||
/// parameters. `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.
|
||||
///
|
||||
/// Note that min base fee under different 1559 parameterizations may differ, but there's no
|
||||
/// significant harm in leaving this setting as is.
|
||||
pub const MIN_PROTOCOL_BASE_FEE: u64 = 7;
|
||||
|
||||
/// Same as [`MIN_PROTOCOL_BASE_FEE`] but as a U256.
|
||||
pub const MIN_PROTOCOL_BASE_FEE_U256: U256 = U256::from_limbs([7u64, 0, 0, 0]);
|
||||
|
||||
/// Base fee max change denominator as defined in [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)
|
||||
pub const EIP1559_DEFAULT_BASE_FEE_MAX_CHANGE_DENOMINATOR: u64 = 8;
|
||||
|
||||
@ -79,13 +65,3 @@ pub const OP_SYSTEM_TX_TO_ADDR: Address = address!("4200000000000000000000000000
|
||||
/// Unwind depth of `3` blocks significantly reduces the chance that the reorged block is kept in
|
||||
/// the database.
|
||||
pub const BEACON_CONSENSUS_REORG_UNWIND_DEPTH: u64 = 3;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn min_protocol_sanity() {
|
||||
assert_eq!(MIN_PROTOCOL_BASE_FEE_U256.to::<u64>(), MIN_PROTOCOL_BASE_FEE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,8 @@ use crate::{
|
||||
PoolSize, TransactionOrigin,
|
||||
};
|
||||
use alloy_consensus::constants::EIP4844_TX_TYPE_ID;
|
||||
use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT;
|
||||
use alloy_eips::eip1559::{ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE};
|
||||
use alloy_primitives::Address;
|
||||
use reth_primitives::constants::MIN_PROTOCOL_BASE_FEE;
|
||||
use std::{collections::HashSet, ops::Mul};
|
||||
|
||||
/// Guarantees max transactions for one sender, compatible with geth/erigon
|
||||
|
||||
@ -22,9 +22,9 @@ use alloy_consensus::constants::{
|
||||
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
|
||||
LEGACY_TX_TYPE_ID,
|
||||
};
|
||||
use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT;
|
||||
use alloy_eips::eip1559::{ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE};
|
||||
use alloy_primitives::{Address, TxHash, B256};
|
||||
use reth_primitives::constants::{eip4844::BLOB_TX_MIN_BLOB_GASPRICE, MIN_PROTOCOL_BASE_FEE};
|
||||
use reth_primitives::constants::eip4844::BLOB_TX_MIN_BLOB_GASPRICE;
|
||||
use rustc_hash::FxHashMap;
|
||||
use smallvec::SmallVec;
|
||||
use std::{
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
use crate::EthPooledTransaction;
|
||||
use alloy_consensus::{TxEip1559, TxEip4844, TxLegacy};
|
||||
use alloy_eips::{eip2718::Encodable2718, eip2930::AccessList};
|
||||
use alloy_eips::{eip1559::MIN_PROTOCOL_BASE_FEE, eip2718::Encodable2718, eip2930::AccessList};
|
||||
use alloy_primitives::{Address, Bytes, TxKind, B256, U256};
|
||||
use rand::Rng;
|
||||
use reth_chainspec::MAINNET;
|
||||
use reth_primitives::{
|
||||
constants::MIN_PROTOCOL_BASE_FEE, sign_message, Transaction, TransactionSigned,
|
||||
};
|
||||
use reth_primitives::{sign_message, Transaction, TransactionSigned};
|
||||
|
||||
/// A generator for transactions for testing purposes.
|
||||
#[derive(Debug)]
|
||||
|
||||
@ -11,7 +11,7 @@ use alloy_consensus::{
|
||||
constants::{EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID},
|
||||
TxEip1559, TxEip2930, TxEip4844, TxLegacy,
|
||||
};
|
||||
use alloy_eips::eip2930::AccessList;
|
||||
use alloy_eips::{eip1559::MIN_PROTOCOL_BASE_FEE, eip2930::AccessList};
|
||||
use alloy_primitives::{Address, Bytes, ChainId, TxHash, TxKind, B256, U256};
|
||||
use paste::paste;
|
||||
use rand::{
|
||||
@ -19,8 +19,7 @@ use rand::{
|
||||
prelude::Distribution,
|
||||
};
|
||||
use reth_primitives::{
|
||||
constants::{eip4844::DATA_GAS_PER_BLOB, MIN_PROTOCOL_BASE_FEE},
|
||||
transaction::TryFromRecoveredTransactionError,
|
||||
constants::eip4844::DATA_GAS_PER_BLOB, transaction::TryFromRecoveredTransactionError,
|
||||
BlobTransactionSidecar, BlobTransactionValidationError, PooledTransactionsElementEcRecovered,
|
||||
Signature, Transaction, TransactionSigned, TransactionSignedEcRecovered, TxType,
|
||||
};
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
//! Transaction pool eviction tests.
|
||||
|
||||
use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT;
|
||||
use alloy_eips::eip1559::{ETHEREUM_BLOCK_GAS_LIMIT, MIN_PROTOCOL_BASE_FEE};
|
||||
use alloy_primitives::{Address, B256};
|
||||
use rand::distributions::Uniform;
|
||||
use reth_primitives::constants::MIN_PROTOCOL_BASE_FEE;
|
||||
use reth_transaction_pool::{
|
||||
error::PoolErrorKind,
|
||||
test_utils::{
|
||||
|
||||
Reference in New Issue
Block a user