Skip to content

Commit 676f242

Browse files
authored
Merge pull request #3046 from TheBlueMatt/2024-03-fees-are-dust
Fix the `full_stack_target` breakage test and doc feerate requests
2 parents d1ac071 + 28d85af commit 676f242

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

fuzz/src/full_stack.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,8 @@ mod tests {
971971

972972
// create the funding transaction (client should send funding_created now)
973973
ext_from_hex("0a", &mut test);
974+
// Two feerate requests to check the dust exposure on the initial commitment tx
975+
ext_from_hex("00fd00fd", &mut test);
974976

975977
// inbound read from peer id 1 of len 18
976978
ext_from_hex("030112", &mut test);
@@ -1019,6 +1021,9 @@ mod tests {
10191021
// end of update_add_htlc from 0 to 1 via client and mac
10201022
ext_from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ab00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
10211023

1024+
// Two feerate requests to check dust exposure
1025+
ext_from_hex("00fd00fd", &mut test);
1026+
10221027
// inbound read from peer id 0 of len 18
10231028
ext_from_hex("030012", &mut test);
10241029
// message header indicating message length 100
@@ -1040,6 +1045,8 @@ mod tests {
10401045

10411046
// process the now-pending HTLC forward
10421047
ext_from_hex("07", &mut test);
1048+
// Two feerate requests to check dust exposure
1049+
ext_from_hex("00fd00fd", &mut test);
10431050
// client now sends id 1 update_add_htlc and commitment_signed (CHECK 7: UpdateHTLCs event for node 03020000 with 1 HTLCs for channel 3f000000)
10441051

10451052
// we respond with commitment_signed then revoke_and_ack (a weird, but valid, order)
@@ -1115,6 +1122,9 @@ mod tests {
11151122
// end of update_add_htlc from 0 to 1 via client and mac
11161123
ext_from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ab00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
11171124

1125+
// Two feerate requests to check dust exposure
1126+
ext_from_hex("00fd00fd", &mut test);
1127+
11181128
// now respond to the update_fulfill_htlc+commitment_signed messages the client sent to peer 0
11191129
// inbound read from peer id 0 of len 18
11201130
ext_from_hex("030012", &mut test);
@@ -1146,6 +1156,10 @@ mod tests {
11461156

11471157
// process the now-pending HTLC forward
11481158
ext_from_hex("07", &mut test);
1159+
1160+
// Two feerate requests to check dust exposure
1161+
ext_from_hex("00fd00fd", &mut test);
1162+
11491163
// client now sends id 1 update_add_htlc and commitment_signed (CHECK 7 duplicate)
11501164
// we respond with revoke_and_ack, then commitment_signed, then update_fail_htlc
11511165

@@ -1243,6 +1257,9 @@ mod tests {
12431257
// end of update_add_htlc from 0 to 1 via client and mac
12441258
ext_from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 5300000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
12451259

1260+
// Two feerate requests to check dust exposure
1261+
ext_from_hex("00fd00fd", &mut test);
1262+
12461263
// inbound read from peer id 0 of len 18
12471264
ext_from_hex("030012", &mut test);
12481265
// message header indicating message length 164
@@ -1264,6 +1281,8 @@ mod tests {
12641281

12651282
// process the now-pending HTLC forward
12661283
ext_from_hex("07", &mut test);
1284+
// Two feerate requests to check dust exposure
1285+
ext_from_hex("00fd00fd", &mut test);
12671286
// client now sends id 1 update_add_htlc and commitment_signed (CHECK 7 duplicate)
12681287

12691288
// connect a block with one transaction of len 125

lightning/src/chain/chaininterface.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ pub enum ConfirmationTarget {
147147
///
148148
/// Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
149149
/// called from inside the library in response to chain events, P2P events, or timer events).
150+
///
151+
/// LDK may generate a substantial number of fee-estimation calls in some cases. You should
152+
/// pre-calculate and cache the fee estimate results to ensure you don't substantially slow HTLC
153+
/// handling.
150154
pub trait FeeEstimator {
151155
/// Gets estimated satoshis of fee required per 1000 Weight-Units.
152156
///

0 commit comments

Comments
 (0)