Skip to main content

SpamFilterConfig

Struct SpamFilterConfig 

Source
pub struct SpamFilterConfig {
Show 26 fields pub filter_ordinals: bool, pub filter_dust: bool, pub filter_brc20: bool, pub filter_large_witness: bool, pub filter_low_fee_rate: bool, pub filter_high_size_value_ratio: bool, pub filter_many_small_outputs: bool, pub dust_threshold: i64, pub min_output_value: i64, pub min_fee_rate: u64, pub max_witness_size: usize, pub max_size_value_ratio: f64, pub max_small_outputs: usize, pub use_adaptive_thresholds: bool, pub adaptive_thresholds: WitnessSizeThresholds, pub filter_taproot_spam: bool, pub max_taproot_control_size: usize, pub reject_taproot_annexes: bool, pub filter_large_total_witness: bool, pub max_total_witness_size: usize, pub use_improved_envelope_detection: bool, pub use_json_validation_brc20: bool, pub require_utxo_for_fee_rate: bool, pub min_fee_rate_large_tx: u64, pub large_tx_threshold_bytes: usize, pub ordinals_strict_mode: bool,
}
Expand description

Spam filter configuration

Fields§

§filter_ordinals: bool

Filter Ordinals/Inscriptions

§filter_dust: bool

Filter dust outputs

§filter_brc20: bool

Filter BRC-20 patterns

§filter_large_witness: bool

Filter transactions with large witness data

§filter_low_fee_rate: bool

Filter transactions with low fee rate

§filter_high_size_value_ratio: bool

Filter transactions with high size-to-value ratio

§filter_many_small_outputs: bool

Filter transactions with many small outputs

§dust_threshold: i64

Minimum output value to consider non-dust (satoshis)

§min_output_value: i64

Minimum output value to include in filtered blocks (satoshis)

§min_fee_rate: u64

Minimum fee rate threshold (satoshis per vbyte)

§max_witness_size: usize

Maximum witness size before flagging (bytes) Note: This is now adaptive based on script type when use_adaptive_thresholds is enabled

§max_size_value_ratio: f64

Maximum size-to-value ratio (bytes per satoshi)

§max_small_outputs: usize

Maximum number of small outputs before flagging

§use_adaptive_thresholds: bool

Use adaptive witness size thresholds based on script type Default: true (enables data-driven thresholds)

§adaptive_thresholds: WitnessSizeThresholds

Adaptive threshold configuration

§filter_taproot_spam: bool

Filter Taproot-specific spam patterns (control blocks, annexes) Default: true

§max_taproot_control_size: usize

Maximum Taproot control block size (bytes) Control blocks: 33 bytes base + 32 bytes per tree level BIP-110 limits to 257 bytes (depth 7), we use 289 bytes (depth 8) for policy Default: 289 bytes (allows depth 8, more lenient than BIP-110)

§reject_taproot_annexes: bool

Reject Taproot annexes (last witness element starting with OP_RESERVED) Default: true

§filter_large_total_witness: bool

Filter transactions with large total witness size across all inputs Default: false (disabled by default, can be aggressive)

§max_total_witness_size: usize

Maximum total witness size across all inputs (bytes) Default: 5000 bytes

§use_improved_envelope_detection: bool

Use improved envelope protocol detection (checks for OP_ENDIF) Default: true

§use_json_validation_brc20: bool

Use JSON validation for BRC-20 detection (requires serde_json) Default: true (if serde_json available)

§require_utxo_for_fee_rate: bool

Require UTXO set for fee rate calculation (reject if unavailable) If false, falls back to heuristic when UTXO set unavailable Default: false (use heuristic fallback)

§min_fee_rate_large_tx: u64

Minimum fee rate for large transactions (satoshis per vbyte) Transactions larger than large_tx_threshold_bytes require this fee rate Default: 2 sat/vB (higher than standard 1 sat/vB)

§large_tx_threshold_bytes: usize

Large transaction threshold (bytes) Transactions larger than this require min_fee_rate_large_tx Default: 1000 bytes

§ordinals_strict_mode: bool

Ordinals detection mode: strict (envelope/pattern only) vs legacy (includes large witness heuristics) When true: Ordinals = envelope protocol, ordinal output patterns, Taproot annex/control-block. Large witness alone is NOT Ordinals (handled by LargeWitness category). When false: Legacy behavior - large witness and witness data patterns also trigger Ordinals. Default: true (minimize false positives; Miniscript/vaults no longer misclassified as Ordinals)

Trait Implementations§

Source§

impl Clone for SpamFilterConfig

Source§

fn clone(&self) -> SpamFilterConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpamFilterConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SpamFilterConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<SpamFilterConfig> for SpamFilterConfigSerializable

Source§

fn from(config: SpamFilterConfig) -> Self

Converts to this type from the input type.
Source§

impl From<SpamFilterConfigSerializable> for SpamFilterConfig

Source§

fn from(serializable: SpamFilterConfigSerializable) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more