@@ -1187,7 +1187,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1187
1187
// inbound read from peer id 1 of len 255
1188
1188
ext_from_hex ( "0301ff" , & mut test) ;
1189
1189
// beginning of accept_channel
1190
- ext_from_hex ( "0021 0000000000000000000000000000000000000000000000000000000000000e12 0000000000000162 00000000004c4b40 00000000000003e8 00000000000003e8 00000002 03f0 0005 030000000000000000000000000000000000000000000000000000000000000100 030000000000000000000000000000000000000000000000000000000000000200 030000000000000000000000000000000000000000000000000000000000000300 030000000000000000000000000000000000000000000000000000000000000400 030000000000000000000000000000000000000000000000000000000000000500 02660000000000000000000000000000" , & mut test) ;
1190
+ ext_from_hex ( "0021 0000000000000000000000000000000000000000000000000000000000000e05 0000000000000162 00000000004c4b40 00000000000003e8 00000000000003e8 00000002 03f0 0005 030000000000000000000000000000000000000000000000000000000000000100 030000000000000000000000000000000000000000000000000000000000000200 030000000000000000000000000000000000000000000000000000000000000300 030000000000000000000000000000000000000000000000000000000000000400 030000000000000000000000000000000000000000000000000000000000000500 02660000000000000000000000000000" , & mut test) ;
1191
1191
// inbound read from peer id 1 of len 39
1192
1192
ext_from_hex ( "030127" , & mut test) ;
1193
1193
// rest of accept_channel and mac
@@ -1208,11 +1208,11 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1208
1208
// inbound read from peer id 1 of len 114
1209
1209
ext_from_hex ( "030172" , & mut test) ;
1210
1210
// funding_signed message and mac
1211
- ext_from_hex ( "0023 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000b90001000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1211
+ ext_from_hex ( "0023 3a00000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000007c0001000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1212
1212
1213
1213
// broadcast funding transaction
1214
1214
ext_from_hex ( "0b" , & mut test) ;
1215
- // by now client should have sent a channel_ready (CHECK 4: SendChannelReady to 03020000 for chan 2f000000 )
1215
+ // by now client should have sent a channel_ready (CHECK 4: SendChannelReady to 03020000 for chan 3f000000 )
1216
1216
1217
1217
// inbound read from peer id 1 of len 18
1218
1218
ext_from_hex ( "030112" , & mut test) ;
@@ -1221,7 +1221,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1221
1221
// inbound read from peer id 1 of len 83
1222
1222
ext_from_hex ( "030153" , & mut test) ;
1223
1223
// channel_ready and mac
1224
- ext_from_hex ( "0024 2900000000000000000000000000000000000000000000000000000000000000 026700000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1224
+ ext_from_hex ( "0024 3a00000000000000000000000000000000000000000000000000000000000000 026700000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1225
1225
1226
1226
// inbound read from peer id 0 of len 18
1227
1227
ext_from_hex ( "030012" , & mut test) ;
@@ -1274,7 +1274,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1274
1274
ext_from_hex ( "07" , & mut test) ;
1275
1275
// Four feerate requests to check dust exposure while forwarding the HTLC
1276
1276
ext_from_hex ( "00fd00fd00fd00fd" , & mut test) ;
1277
- // client now sends id 1 update_add_htlc and commitment_signed (CHECK 7: UpdateHTLCs event for node 03020000 with 1 HTLCs for channel 2f000000 )
1277
+ // client now sends id 1 update_add_htlc and commitment_signed (CHECK 7: UpdateHTLCs event for node 03020000 with 1 HTLCs for channel 3f000000 )
1278
1278
1279
1279
// we respond with commitment_signed then revoke_and_ack (a weird, but valid, order)
1280
1280
// inbound read from peer id 1 of len 18
@@ -1284,7 +1284,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1284
1284
// inbound read from peer id 1 of len 116
1285
1285
ext_from_hex ( "030174" , & mut test) ;
1286
1286
// commitment_signed and mac
1287
- ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000e40001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1287
+ ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000006a0001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1288
1288
//
1289
1289
// inbound read from peer id 1 of len 18
1290
1290
ext_from_hex ( "030112" , & mut test) ;
@@ -1293,7 +1293,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1293
1293
// inbound read from peer id 1 of len 115
1294
1294
ext_from_hex ( "030173" , & mut test) ;
1295
1295
// revoke_and_ack and mac
1296
- ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6600000000000000000000000000000000000000000000000000000000000000 026400000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1296
+ ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6600000000000000000000000000000000000000000000000000000000000000 026400000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1297
1297
//
1298
1298
// inbound read from peer id 1 of len 18
1299
1299
ext_from_hex ( "030112" , & mut test) ;
@@ -1302,7 +1302,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1302
1302
// inbound read from peer id 1 of len 90
1303
1303
ext_from_hex ( "03015a" , & mut test) ;
1304
1304
// update_fulfill_htlc and mac
1305
- ext_from_hex ( "0082 2900000000000000000000000000000000000000000000000000000000000000 0000000000000000 ff00888888888888888888888888888888888888888888888888888888888888 01000000000000000000000000000000" , & mut test) ;
1305
+ ext_from_hex ( "0082 3a00000000000000000000000000000000000000000000000000000000000000 0000000000000000 ff00888888888888888888888888888888888888888888888888888888888888 01000000000000000000000000000000" , & mut test) ;
1306
1306
// client should immediately claim the pending HTLC from peer 0 (CHECK 8: SendFulfillHTLCs for node 03000000 with preimage ff00888888 for channel 3d000000)
1307
1307
1308
1308
// inbound read from peer id 1 of len 18
@@ -1312,7 +1312,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1312
1312
// inbound read from peer id 1 of len 116
1313
1313
ext_from_hex ( "030174" , & mut test) ;
1314
1314
// commitment_signed and mac
1315
- ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000330001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1315
+ ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000100001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1316
1316
1317
1317
// inbound read from peer id 1 of len 18
1318
1318
ext_from_hex ( "030112" , & mut test) ;
@@ -1321,7 +1321,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1321
1321
// inbound read from peer id 1 of len 115
1322
1322
ext_from_hex ( "030173" , & mut test) ;
1323
1323
// revoke_and_ack and mac
1324
- ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6700000000000000000000000000000000000000000000000000000000000000 026500000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1324
+ ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6700000000000000000000000000000000000000000000000000000000000000 026500000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1325
1325
1326
1326
// before responding to the commitment_signed generated above, send a new HTLC
1327
1327
// inbound read from peer id 0 of len 18
@@ -1397,7 +1397,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1397
1397
// inbound read from peer id 1 of len 116
1398
1398
ext_from_hex ( "030174" , & mut test) ;
1399
1399
// commitment_signed and mac
1400
- ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000009c0001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1400
+ ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000390001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1401
1401
1402
1402
// inbound read from peer id 1 of len 18
1403
1403
ext_from_hex ( "030112" , & mut test) ;
@@ -1406,7 +1406,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1406
1406
// inbound read from peer id 1 of len 115
1407
1407
ext_from_hex ( "030173" , & mut test) ;
1408
1408
// revoke_and_ack and mac
1409
- ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6400000000000000000000000000000000000000000000000000000000000000 027000000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1409
+ ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6400000000000000000000000000000000000000000000000000000000000000 027000000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1410
1410
1411
1411
// inbound read from peer id 1 of len 18
1412
1412
ext_from_hex ( "030112" , & mut test) ;
@@ -1415,7 +1415,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1415
1415
// inbound read from peer id 1 of len 60
1416
1416
ext_from_hex ( "03013c" , & mut test) ;
1417
1417
// update_fail_htlc and mac
1418
- ext_from_hex ( "0083 2900000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000 01000000000000000000000000000000" , & mut test) ;
1418
+ ext_from_hex ( "0083 3a00000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000 01000000000000000000000000000000" , & mut test) ;
1419
1419
1420
1420
// inbound read from peer id 1 of len 18
1421
1421
ext_from_hex ( "030112" , & mut test) ;
@@ -1424,7 +1424,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1424
1424
// inbound read from peer id 1 of len 116
1425
1425
ext_from_hex ( "030174" , & mut test) ;
1426
1426
// commitment_signed and mac
1427
- ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000e20001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1427
+ ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000390001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1428
1428
1429
1429
// inbound read from peer id 1 of len 18
1430
1430
ext_from_hex ( "030112" , & mut test) ;
@@ -1433,7 +1433,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1433
1433
// inbound read from peer id 1 of len 115
1434
1434
ext_from_hex ( "030173" , & mut test) ;
1435
1435
// revoke_and_ack and mac
1436
- ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6500000000000000000000000000000000000000000000000000000000000000 027100000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1436
+ ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6500000000000000000000000000000000000000000000000000000000000000 027100000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1437
1437
1438
1438
// process the now-pending HTLC forward
1439
1439
ext_from_hex ( "07" , & mut test) ;
@@ -1466,7 +1466,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1466
1466
// inbound read from peer id 0 of len 255
1467
1467
ext_from_hex ( "0300ff" , & mut test) ;
1468
1468
// beginning of update_add_htlc from 0 to 1 via client
1469
- ext_from_hex ( "0080 3d00000000000000000000000000000000000000000000000000000000000000 0000000000000002 00000000000b0838 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 12 02030927c1 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" , & mut test) ;
1469
+ ext_from_hex ( "0080 3d00000000000000000000000000000000000000000000000000000000000000 0000000000000002 00000000000b0838 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 12 02030927c0 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" , & mut test) ;
1470
1470
// inbound read from peer id 0 of len 255
1471
1471
ext_from_hex ( "0300ff" , & mut test) ;
1472
1472
ext_from_hex ( "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" , & mut test) ;
@@ -1482,7 +1482,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1482
1482
// inbound read from peer id 0 of len 193
1483
1483
ext_from_hex ( "0300c1" , & mut test) ;
1484
1484
// end of update_add_htlc from 0 to 1 via client and mac
1485
- ext_from_hex ( "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 5200000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000" , & mut test) ;
1485
+ ext_from_hex ( "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 5300000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000" , & mut test) ;
1486
1486
1487
1487
// One feerate request to check dust exposure
1488
1488
ext_from_hex ( "00fd" , & mut test) ;
@@ -1514,15 +1514,16 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1514
1514
1515
1515
// connect a block with one transaction of len 125
1516
1516
ext_from_hex ( "0c007d" , & mut test) ;
1517
- // the commitment transaction for channel 2900000000000000000000000000000000000000000000000000000000000000
1518
- ext_from_hex ( "020000000129000000000000000000000000000000000000000000000000000000000000000000000000000000800258020000000000002200201f0000000000000000000000000000000000000000000000000000000000000013c00000000000001600143b0000000000000000000000000000000000000005000020 " , & mut test) ;
1517
+ // the commitment transaction for channel 3f00000000000000000000000000000000000000000000000000000000000000
1518
+ ext_from_hex ( "02000000013a000000000000000000000000000000000000000000000000000000000000000000000000000000800258020000000000002200204b0000000000000000000000000000000000000000000000000000000000000014c0000000000000160014280000000000000000000000000000000000000005000020 " , & mut test) ;
1519
1519
// Two feerate requests during block connection
1520
1520
ext_from_hex ( "00fd00fd" , & mut test) ;
1521
1521
//
1522
1522
// connect a block with one transaction of len 94
1523
1523
ext_from_hex ( "0c005e" , & mut test) ;
1524
1524
// the HTLC timeout transaction
1525
- ext_from_hex ( "0200000001200000000000000000000000000000000000000000000000000000000000000000000000000000000001a701000000000000220020e60000000000000000000000000000000000000000000000000000000000000000000000" , & mut test) ;
1525
+ ext_from_hex ( "0200000001730000000000000000000000000000000000000000000000000000000000000000000000000000000001a701000000000000220020b20000000000000000000000000000000000000000000000000000000000000000000000" , & mut test) ;
1526
+
1526
1527
// Two feerate requests during block connection
1527
1528
ext_from_hex ( "00fd00fd" , & mut test) ;
1528
1529
// connect a block with no transactions
@@ -1704,19 +1705,19 @@ mod tests {
1704
1705
// 3
1705
1706
assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling SendChannelReady event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 for channel 3d00000000000000000000000000000000000000000000000000000000000000" . to_string( ) ) ) , Some ( & 1 ) ) ;
1706
1707
// 4
1707
- assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling SendChannelReady event in peer_handler for node 030200000000000000000000000000000000000000000000000000000000000000 for channel 2900000000000000000000000000000000000000000000000000000000000000 " . to_string( ) ) ) , Some ( & 1 ) ) ;
1708
+ assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling SendChannelReady event in peer_handler for node 030200000000000000000000000000000000000000000000000000000000000000 for channel 3a00000000000000000000000000000000000000000000000000000000000000 " . to_string( ) ) ) , Some ( & 1 ) ) ;
1708
1709
// 5
1709
1710
assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling SendRevokeAndACK event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 for channel 3d00000000000000000000000000000000000000000000000000000000000000" . to_string( ) ) ) , Some ( & 4 ) ) ;
1710
1711
// 6
1711
1712
assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling UpdateHTLCs event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 with 0 adds, 0 fulfills, 0 fails, 1 commits for channel 3d00000000000000000000000000000000000000000000000000000000000000" . to_string( ) ) ) , Some ( & 3 ) ) ;
1712
1713
// 7
1713
- assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling UpdateHTLCs event in peer_handler for node 030200000000000000000000000000000000000000000000000000000000000000 with 1 adds, 0 fulfills, 0 fails, 1 commits for channel 2900000000000000000000000000000000000000000000000000000000000000 " . to_string( ) ) ) , Some ( & 3 ) ) ;
1714
+ assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling UpdateHTLCs event in peer_handler for node 030200000000000000000000000000000000000000000000000000000000000000 with 1 adds, 0 fulfills, 0 fails, 1 commits for channel 3a00000000000000000000000000000000000000000000000000000000000000 " . to_string( ) ) ) , Some ( & 3 ) ) ;
1714
1715
// 8
1715
1716
assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling UpdateHTLCs event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 with 0 adds, 1 fulfills, 0 fails, 1 commits for channel 3d00000000000000000000000000000000000000000000000000000000000000" . to_string( ) ) ) , Some ( & 1 ) ) ;
1716
1717
// 9
1717
1718
assert_eq ! ( log_entries. get( & ( "lightning::ln::peer_handler" . to_string( ) , "Handling UpdateHTLCs event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 with 0 adds, 0 fulfills, 1 fails, 1 commits for channel 3d00000000000000000000000000000000000000000000000000000000000000" . to_string( ) ) ) , Some ( & 2 ) ) ;
1718
1719
// 10
1719
- assert_eq ! ( log_entries. get( & ( "lightning::chain::channelmonitor" . to_string( ) , "Input spending counterparty commitment tx (0000000000000000000000000000000000000000000000000000000000000020 :0) in 0000000000000000000000000000000000000000000000000000000000000060 resolves outbound HTLC with payment hash ff00000000000000000000000000000000000000000000000000000000000000 with timeout" . to_string( ) ) ) , Some ( & 1 ) ) ;
1720
+ assert_eq ! ( log_entries. get( & ( "lightning::chain::channelmonitor" . to_string( ) , "Input spending counterparty commitment tx (0000000000000000000000000000000000000000000000000000000000000073 :0) in 0000000000000000000000000000000000000000000000000000000000000067 resolves outbound HTLC with payment hash ff00000000000000000000000000000000000000000000000000000000000000 with timeout" . to_string( ) ) ) , Some ( & 1 ) ) ;
1720
1721
}
1721
1722
1722
1723
#[ test]
0 commit comments