pub enum MaxDustHTLCExposure {
FixedLimitMsat(u64),
FeeRateMultiplier(u64),
}Expand description
Options for how to set the max dust 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 ConfirmationTarget::MaximumFeeEstimate feerate (in
sats/KW) to determine the maximum allowed dust exposure. If this variant is used then the
maximum dust exposure in millisatoshis is calculated as:
feerate_per_kw * value. For example, with our default value
FeeRateMultiplier(10_000):
- 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 * 10_000 = 2,530,000 msats. - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
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.
Note that because zero-commitment-fee anchor channels do not allow for feerate updates (and
thus never experience dust exposure changes due to feerate shifts, resulting in no
force-closes due to dust exposure limits), such channels will calculate their maximum
dust exposure using a constant feerate of 250 sat/KW when using this variant.
See ChannelHandshakeConfig::negotiate_anchor_zero_fee_commitments to enable such channels.
§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§
Source§impl Clone for MaxDustHTLCExposure
impl Clone for MaxDustHTLCExposure
Source§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 moreSource§impl Debug for MaxDustHTLCExposure
impl Debug for MaxDustHTLCExposure
Source§impl PartialEq for MaxDustHTLCExposure
impl PartialEq for MaxDustHTLCExposure
Source§impl Readable for MaxDustHTLCExposure
impl Readable for MaxDustHTLCExposure
Source§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§
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Self in from the given LengthLimitedRead.