Struct ethcore_miner::pool::scoring::NonceAndGasPrice
source · [−]pub struct NonceAndGasPrice {
pub strategy: PrioritizationStrategy,
pub block_base_fee: Option<U256>,
}
Expand description
Simple, gas-price based scoring for transactions.
NOTE: Currently penalization does not apply to new transactions that enter the pool. We might want to store penalization status in some persistent state.
Fields
strategy: PrioritizationStrategy
Strategy for prioritization
block_base_fee: Option<U256>
Block base fee. Exists if the EIP 1559 is activated.
Implementations
sourceimpl NonceAndGasPrice
impl NonceAndGasPrice
sourcepub fn should_reject_early(
&self,
old: &VerifiedTransaction,
new: &Transaction
) -> bool
pub fn should_reject_early(
&self,
old: &VerifiedTransaction,
new: &Transaction
) -> bool
Decide if the transaction should even be considered into the pool (if the pool is full).
Used by Verifier to quickly reject transactions that don’t have any chance to get into the pool later on, and save time on more expensive checks like sender recovery, etc.
NOTE The method is never called for zero-gas-price transactions or local transactions (such transactions are always considered to the pool and potentially rejected later on)
Trait Implementations
sourceimpl Clone for NonceAndGasPrice
impl Clone for NonceAndGasPrice
sourcefn clone(&self) -> NonceAndGasPrice
fn clone(&self) -> NonceAndGasPrice
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for NonceAndGasPrice
impl Debug for NonceAndGasPrice
sourceimpl<P> Scoring<P> for NonceAndGasPrice where
P: ScoredTransaction + VerifiedTransaction,
impl<P> Scoring<P> for NonceAndGasPrice where
P: ScoredTransaction + VerifiedTransaction,
type Event = ScoringEvent
type Event = ScoringEvent
Custom scoring update event type.
sourcefn compare(&self, old: &P, other: &P) -> Ordering
fn compare(&self, old: &P, other: &P) -> Ordering
Decides on ordering of T
s from a particular sender.
sourcefn choose(&self, old: &P, new: &P) -> Choice
fn choose(&self, old: &P, new: &P) -> Choice
Decides how to deal with two transactions from a sender that seem to occupy the same slot in the queue.
sourcefn update_scores(
&self,
txs: &[Transaction<P>],
scores: &mut [U256],
change: Change<ScoringEvent>
)
fn update_scores(
&self,
txs: &[Transaction<P>],
scores: &mut [U256],
change: Change<ScoringEvent>
)
Updates the transaction scores given a list of transactions and a change to previous scoring.
NOTE: you can safely assume that both slices have the same length.
(i.e. score at index i
represents transaction at the same index) Read more
sourcefn should_ignore_sender_limit(&self, new: &P) -> bool
fn should_ignore_sender_limit(&self, new: &P) -> bool
Decides if the transaction should ignore per-sender limit in the pool. Read more
Auto Trait Implementations
impl RefUnwindSafe for NonceAndGasPrice
impl Send for NonceAndGasPrice
impl Sync for NonceAndGasPrice
impl Unpin for NonceAndGasPrice
impl UnwindSafe for NonceAndGasPrice
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more