Enum MaxDustHTLCExposure
pub enum MaxDustHTLCExposure {
FixedLimitMsat(u64),
FeeRateMultiplier(u64),
}
Expand description
Options for how to set the max dust HTLC exposure allowed on a channel. See
ChannelConfig::max_dust_htlc_exposure
for details.
Variants§
FixedLimitMsat(u64)
This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this limit is very important to prevent stealing of large amounts of dust HTLCs by miners through fee griefing attacks.
Note that if the feerate increases significantly, without a manual increase to this maximum the channel may be unable to send/receive HTLCs between the maximum dust exposure and the new minimum value for HTLCs to be economically viable to claim.
FeeRateMultiplier(u64)
This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
FeeEstimator
) to determine the maximum allowed dust exposure. If this variant is used
then the maximum dust exposure in millisatoshis is calculated as:
high_priority_feerate_per_kw * value
. For example, with our default value
FeeRateMultiplier(5000)
:
- For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
defaults to 253 sats/KW for rounding, see
FeeEstimator
), the max dust exposure would be 253 * 5000 = 1,265,000 msats. - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be 7500 * 5000 = 37,500,000 msats.
This allows the maximum dust exposure to automatically scale with fee rate changes.
Note, if you’re using a third-party fee estimator, this may leave you more exposed to a fee griefing attack, where your fee estimator may purposely overestimate the fee rate, causing you to accept more dust HTLCs than you would otherwise.
This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included on HTLC outputs means your channel may be subject to more dust exposure in the event of increases in fee rate.
§Backwards Compatibility
This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
by default this will be set to a Self::FixedLimitMsat
of 5,000,000 msat.
Trait Implementations§
§impl Clone for MaxDustHTLCExposure
impl Clone for MaxDustHTLCExposure
§fn clone(&self) -> MaxDustHTLCExposure
fn clone(&self) -> MaxDustHTLCExposure
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for MaxDustHTLCExposure
impl Debug for MaxDustHTLCExposure
§impl PartialEq for MaxDustHTLCExposure
impl PartialEq for MaxDustHTLCExposure
§impl Readable for MaxDustHTLCExposure
impl Readable for MaxDustHTLCExposure
§fn read<R>(reader: &mut R) -> Result<MaxDustHTLCExposure, DecodeError>where
R: Read,
fn read<R>(reader: &mut R) -> Result<MaxDustHTLCExposure, DecodeError>where
R: Read,
Self
in from the given Read
.§impl Writeable for MaxDustHTLCExposure
impl Writeable for MaxDustHTLCExposure
impl Copy for MaxDustHTLCExposure
impl Eq for MaxDustHTLCExposure
impl StructuralPartialEq for MaxDustHTLCExposure
Auto Trait Implementations§
impl Freeze for MaxDustHTLCExposure
impl RefUnwindSafe for MaxDustHTLCExposure
impl Send for MaxDustHTLCExposure
impl Sync for MaxDustHTLCExposure
impl Unpin for MaxDustHTLCExposure
impl UnwindSafe for MaxDustHTLCExposure
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request