reth_network::transactions::validation

Trait ValidateTx68

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Implementors§