@@ -1185,7 +1185,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1185
1185
// inbound read from peer id 1 of len 255
1186
1186
ext_from_hex ( "0301ff" , & mut test) ;
1187
1187
// beginning of accept_channel
1188
- ext_from_hex ( "0021 0000000000000000000000000000000000000000000000000000000000000e05 0000000000000162 00000000004c4b40 00000000000003e8 00000000000003e8 00000002 03f0 0005 030000000000000000000000000000000000000000000000000000000000000100 030000000000000000000000000000000000000000000000000000000000000200 030000000000000000000000000000000000000000000000000000000000000300 030000000000000000000000000000000000000000000000000000000000000400 030000000000000000000000000000000000000000000000000000000000000500 02660000000000000000000000000000" , & mut test) ;
1188
+ ext_from_hex ( "0021 0000000000000000000000000000000000000000000000000000000000000e12 0000000000000162 00000000004c4b40 00000000000003e8 00000000000003e8 00000002 03f0 0005 030000000000000000000000000000000000000000000000000000000000000100 030000000000000000000000000000000000000000000000000000000000000200 030000000000000000000000000000000000000000000000000000000000000300 030000000000000000000000000000000000000000000000000000000000000400 030000000000000000000000000000000000000000000000000000000000000500 02660000000000000000000000000000" , & mut test) ;
1189
1189
// inbound read from peer id 1 of len 35
1190
1190
ext_from_hex ( "030123" , & mut test) ;
1191
1191
// rest of accept_channel and mac
@@ -1206,11 +1206,11 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1206
1206
// inbound read from peer id 1 of len 114
1207
1207
ext_from_hex ( "030172" , & mut test) ;
1208
1208
// funding_signed message and mac
1209
- ext_from_hex ( "0023 3a00000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000007c0001000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1209
+ ext_from_hex ( "0023 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000b90001000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1210
1210
1211
1211
// broadcast funding transaction
1212
1212
ext_from_hex ( "0b" , & mut test) ;
1213
- // by now client should have sent a channel_ready (CHECK 4: SendChannelReady to 03020000 for chan 3f000000 )
1213
+ // by now client should have sent a channel_ready (CHECK 4: SendChannelReady to 03020000 for chan 2f000000 )
1214
1214
1215
1215
// inbound read from peer id 1 of len 18
1216
1216
ext_from_hex ( "030112" , & mut test) ;
@@ -1219,7 +1219,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1219
1219
// inbound read from peer id 1 of len 83
1220
1220
ext_from_hex ( "030153" , & mut test) ;
1221
1221
// channel_ready and mac
1222
- ext_from_hex ( "0024 3a00000000000000000000000000000000000000000000000000000000000000 026700000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1222
+ ext_from_hex ( "0024 2900000000000000000000000000000000000000000000000000000000000000 026700000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1223
1223
1224
1224
// inbound read from peer id 0 of len 18
1225
1225
ext_from_hex ( "030012" , & mut test) ;
@@ -1272,7 +1272,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1272
1272
ext_from_hex ( "07" , & mut test) ;
1273
1273
// Four feerate requests to check dust exposure while forwarding the HTLC
1274
1274
ext_from_hex ( "00fd00fd00fd00fd" , & mut test) ;
1275
- // client now sends id 1 update_add_htlc and commitment_signed (CHECK 7: UpdateHTLCs event for node 03020000 with 1 HTLCs for channel 3f000000 )
1275
+ // client now sends id 1 update_add_htlc and commitment_signed (CHECK 7: UpdateHTLCs event for node 03020000 with 1 HTLCs for channel 2f000000 )
1276
1276
1277
1277
// we respond with commitment_signed then revoke_and_ack (a weird, but valid, order)
1278
1278
// inbound read from peer id 1 of len 18
@@ -1282,7 +1282,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1282
1282
// inbound read from peer id 1 of len 116
1283
1283
ext_from_hex ( "030174" , & mut test) ;
1284
1284
// commitment_signed and mac
1285
- ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000006a0001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1285
+ ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000e40001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1286
1286
//
1287
1287
// inbound read from peer id 1 of len 18
1288
1288
ext_from_hex ( "030112" , & mut test) ;
@@ -1291,7 +1291,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1291
1291
// inbound read from peer id 1 of len 115
1292
1292
ext_from_hex ( "030173" , & mut test) ;
1293
1293
// revoke_and_ack and mac
1294
- ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6600000000000000000000000000000000000000000000000000000000000000 026400000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1294
+ ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6600000000000000000000000000000000000000000000000000000000000000 026400000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1295
1295
//
1296
1296
// inbound read from peer id 1 of len 18
1297
1297
ext_from_hex ( "030112" , & mut test) ;
@@ -1300,7 +1300,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1300
1300
// inbound read from peer id 1 of len 90
1301
1301
ext_from_hex ( "03015a" , & mut test) ;
1302
1302
// update_fulfill_htlc and mac
1303
- ext_from_hex ( "0082 3a00000000000000000000000000000000000000000000000000000000000000 0000000000000000 ff00888888888888888888888888888888888888888888888888888888888888 01000000000000000000000000000000" , & mut test) ;
1303
+ ext_from_hex ( "0082 2900000000000000000000000000000000000000000000000000000000000000 0000000000000000 ff00888888888888888888888888888888888888888888888888888888888888 01000000000000000000000000000000" , & mut test) ;
1304
1304
// client should immediately claim the pending HTLC from peer 0 (CHECK 8: SendFulfillHTLCs for node 03000000 with preimage ff00888888 for channel 3d000000)
1305
1305
1306
1306
// inbound read from peer id 1 of len 18
@@ -1310,7 +1310,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1310
1310
// inbound read from peer id 1 of len 116
1311
1311
ext_from_hex ( "030174" , & mut test) ;
1312
1312
// commitment_signed and mac
1313
- ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000100001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1313
+ ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000330001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1314
1314
1315
1315
// inbound read from peer id 1 of len 18
1316
1316
ext_from_hex ( "030112" , & mut test) ;
@@ -1319,7 +1319,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1319
1319
// inbound read from peer id 1 of len 115
1320
1320
ext_from_hex ( "030173" , & mut test) ;
1321
1321
// revoke_and_ack and mac
1322
- ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6700000000000000000000000000000000000000000000000000000000000000 026500000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1322
+ ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6700000000000000000000000000000000000000000000000000000000000000 026500000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1323
1323
1324
1324
// before responding to the commitment_signed generated above, send a new HTLC
1325
1325
// inbound read from peer id 0 of len 18
@@ -1395,7 +1395,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1395
1395
// inbound read from peer id 1 of len 116
1396
1396
ext_from_hex ( "030174" , & mut test) ;
1397
1397
// commitment_signed and mac
1398
- ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000390001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1398
+ ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000009c0001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1399
1399
1400
1400
// inbound read from peer id 1 of len 18
1401
1401
ext_from_hex ( "030112" , & mut test) ;
@@ -1404,7 +1404,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1404
1404
// inbound read from peer id 1 of len 115
1405
1405
ext_from_hex ( "030173" , & mut test) ;
1406
1406
// revoke_and_ack and mac
1407
- ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6400000000000000000000000000000000000000000000000000000000000000 027000000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1407
+ ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6400000000000000000000000000000000000000000000000000000000000000 027000000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1408
1408
1409
1409
// inbound read from peer id 1 of len 18
1410
1410
ext_from_hex ( "030112" , & mut test) ;
@@ -1413,7 +1413,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1413
1413
// inbound read from peer id 1 of len 60
1414
1414
ext_from_hex ( "03013c" , & mut test) ;
1415
1415
// update_fail_htlc and mac
1416
- ext_from_hex ( "0083 3a00000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000 01000000000000000000000000000000" , & mut test) ;
1416
+ ext_from_hex ( "0083 2900000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000 01000000000000000000000000000000" , & mut test) ;
1417
1417
1418
1418
// inbound read from peer id 1 of len 18
1419
1419
ext_from_hex ( "030112" , & mut test) ;
@@ -1422,7 +1422,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1422
1422
// inbound read from peer id 1 of len 116
1423
1423
ext_from_hex ( "030174" , & mut test) ;
1424
1424
// commitment_signed and mac
1425
- ext_from_hex ( "0084 3a00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000390001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1425
+ ext_from_hex ( "0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000e20001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000" , & mut test) ;
1426
1426
1427
1427
// inbound read from peer id 1 of len 18
1428
1428
ext_from_hex ( "030112" , & mut test) ;
@@ -1431,7 +1431,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1431
1431
// inbound read from peer id 1 of len 115
1432
1432
ext_from_hex ( "030173" , & mut test) ;
1433
1433
// revoke_and_ack and mac
1434
- ext_from_hex ( "0085 3a00000000000000000000000000000000000000000000000000000000000000 6500000000000000000000000000000000000000000000000000000000000000 027100000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1434
+ ext_from_hex ( "0085 2900000000000000000000000000000000000000000000000000000000000000 6500000000000000000000000000000000000000000000000000000000000000 027100000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000" , & mut test) ;
1435
1435
1436
1436
// process the now-pending HTLC forward
1437
1437
ext_from_hex ( "07" , & mut test) ;
@@ -1464,7 +1464,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1464
1464
// inbound read from peer id 0 of len 255
1465
1465
ext_from_hex ( "0300ff" , & mut test) ;
1466
1466
// beginning of update_add_htlc from 0 to 1 via client
1467
- ext_from_hex ( "0080 3d00000000000000000000000000000000000000000000000000000000000000 0000000000000002 00000000000b0838 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 12 02030927c0 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" , & mut test) ;
1467
+ ext_from_hex ( "0080 3d00000000000000000000000000000000000000000000000000000000000000 0000000000000002 00000000000b0838 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 12 02030927c1 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" , & mut test) ;
1468
1468
// inbound read from peer id 0 of len 255
1469
1469
ext_from_hex ( "0300ff" , & mut test) ;
1470
1470
ext_from_hex ( "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" , & mut test) ;
@@ -1480,7 +1480,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1480
1480
// inbound read from peer id 0 of len 193
1481
1481
ext_from_hex ( "0300c1" , & mut test) ;
1482
1482
// end of update_add_htlc from 0 to 1 via client and mac
1483
- ext_from_hex ( "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 5300000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000" , & mut test) ;
1483
+ ext_from_hex ( "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 5200000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000" , & mut test) ;
1484
1484
1485
1485
// One feerate request to check dust exposure
1486
1486
ext_from_hex ( "00fd" , & mut test) ;
@@ -1512,15 +1512,15 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
1512
1512
1513
1513
// connect a block with one transaction of len 125
1514
1514
ext_from_hex ( "0c007d" , & mut test) ;
1515
- // the commitment transaction for channel 3f00000000000000000000000000000000000000000000000000000000000000
1516
- ext_from_hex ( "02000000013a000000000000000000000000000000000000000000000000000000000000000000000000000000800258020000000000002200204b0000000000000000000000000000000000000000000000000000000000000014c0000000000000160014280000000000000000000000000000000000000005000020 " , & mut test) ;
1515
+ // the commitment transaction for channel 2900000000000000000000000000000000000000000000000000000000000000
1516
+ ext_from_hex ( "020000000129000000000000000000000000000000000000000000000000000000000000000000000000000000800258020000000000002200201f0000000000000000000000000000000000000000000000000000000000000013c00000000000001600143b0000000000000000000000000000000000000005000020 " , & mut test) ;
1517
1517
// Two feerate requests during block connection
1518
1518
ext_from_hex ( "00fd00fd" , & mut test) ;
1519
1519
//
1520
1520
// connect a block with one transaction of len 94
1521
1521
ext_from_hex ( "0c005e" , & mut test) ;
1522
1522
// the HTLC timeout transaction
1523
- ext_from_hex ( "0200000001730000000000000000000000000000000000000000000000000000000000000000000000000000000001a701000000000000220020b20000000000000000000000000000000000000000000000000000000000000000000000 " , & mut test) ;
1523
+ ext_from_hex ( "0200000001200000000000000000000000000000000000000000000000000000000000000000000000000000000001a701000000000000220020e60000000000000000000000000000000000000000000000000000000000000000000000 " , & mut test) ;
1524
1524
// Two feerate requests during block connection
1525
1525
ext_from_hex ( "00fd00fd" , & mut test) ;
1526
1526
// connect a block with no transactions
@@ -1702,19 +1702,19 @@ mod tests {
1702
1702
// 3
1703
1703
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 ) ) ;
1704
1704
// 4
1705
- 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 ) ) ;
1705
+ 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 ) ) ;
1706
1706
// 5
1707
1707
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 ) ) ;
1708
1708
// 6
1709
1709
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 ) ) ;
1710
1710
// 7
1711
- 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 ) ) ;
1711
+ 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 ) ) ;
1712
1712
// 8
1713
1713
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 ) ) ;
1714
1714
// 9
1715
1715
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 ) ) ;
1716
1716
// 10
1717
- 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 ) ) ;
1717
+ 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 ) ) ;
1718
1718
}
1719
1719
1720
1720
#[ test]
0 commit comments