pub trait ValidateTx68 {
// Required methods
fn should_fetch(
&self,
ty: u8,
hash: &TxHash,
size: usize,
tx_types_counter: &mut TxTypesCounter,
) -> ValidationOutcome;
fn max_encoded_tx_length(&self, ty: TxType) -> Option<usize>;
fn strict_max_encoded_tx_length(&self, ty: TxType) -> Option<usize>;
fn min_encoded_tx_length(&self, ty: TxType) -> Option<usize>;
fn strict_min_encoded_tx_length(&self, ty: TxType) -> Option<usize>;
}
Expand description
Interface for validating a (ty, size, hash)
tuple from a
NewPooledTransactionHashes68
..
Required Methods§
Sourcefn should_fetch(
&self,
ty: u8,
hash: &TxHash,
size: usize,
tx_types_counter: &mut TxTypesCounter,
) -> ValidationOutcome
fn should_fetch( &self, ty: u8, hash: &TxHash, size: usize, tx_types_counter: &mut TxTypesCounter, ) -> ValidationOutcome
Validates a NewPooledTransactionHashes68
entry. Returns ValidationOutcome
which signals to the caller whether to fetch the
transaction or to drop it, and whether the sender of the announcement should be
penalized.
Sourcefn max_encoded_tx_length(&self, ty: TxType) -> Option<usize>
fn max_encoded_tx_length(&self, ty: TxType) -> Option<usize>
Returns the reasonable maximum encoded transaction length configured for this network, if any. This property is not spec’ed out but can be inferred by looking how much data can be packed into a transaction for any given transaction type.
Sourcefn strict_max_encoded_tx_length(&self, ty: TxType) -> Option<usize>
fn strict_max_encoded_tx_length(&self, ty: TxType) -> Option<usize>
Returns the strict maximum encoded transaction length for the given transaction type, if any.
Sourcefn min_encoded_tx_length(&self, ty: TxType) -> Option<usize>
fn min_encoded_tx_length(&self, ty: TxType) -> Option<usize>
Returns the reasonable minimum encoded transaction length, if any. This property is not
spec’ed out but can be inferred by looking at which
[reth_primitives::PooledTransaction
] will successfully pass decoding
for any given transaction type.
Sourcefn strict_min_encoded_tx_length(&self, ty: TxType) -> Option<usize>
fn strict_min_encoded_tx_length(&self, ty: TxType) -> Option<usize>
Returns the strict minimum encoded transaction length for the given transaction type, if any.