Stop counting for RNG output in `full_stack_target`
What changed, and why it matters
This commit changes only a fuzzing test harness, not production code. It alters how fake random numbers are generated during automated fuzz testing so that test inputs remain useful even when the underlying software changes. There is no security vulnerability or fix to a real system here.
No security action required. This is a test-infrastructure maintenance change. Reviewers may optionally verify that the fuzz harness still exercises RNG-dependent code paths via the new opcode 49.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies fuzz/src/full_stack.rs, a fuzzing target for LDK. Previously, the fuzzer’s entropy source returned a deterministic value based on a monotonically increasing counter, which made existing fuzz corpora go stale whenever LDK’s internal RNG call pattern changed. The commit replaces that counter-based scheme with a fixed default RNG output ([42; 32]) and adds a fuzzer-controlled opcode (49) that lets the fuzz input override the RNG output. All other changes are updates to hard-coded test vectors (channel IDs, transaction hashes, signatures) that changed because the RNG output is now fixed rather than counter-derived. The production entropy source used by real LDK nodes is unaffected.
Changed components
fuzz/src/full_stack.rsInspect captured patch +50 / −48
diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs
index 289f781..6462004 100644
--- a/fuzz/src/full_stack.rs
+++ b/fuzz/src/full_stack.rs
@@ -375,16 +375,12 @@ struct KeyProvider {
inbound_payment_key: ExpandedKey,
counter: AtomicU64,
signer_state: RefCell<HashMap<u8, (bool, Arc<Mutex<EnforcementState>>)>>,
+ rng_output: RefCell<[u8; 32]>,
}
impl EntropySource for KeyProvider {
fn get_secure_random_bytes(&self) -> [u8; 32] {
- let ctr = self.counter.fetch_add(1, Ordering::Relaxed);
- #[rustfmt::skip]
- let random_bytes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- (ctr >> 8*7) as u8, (ctr >> 8*6) as u8, (ctr >> 8*5) as u8, (ctr >> 8*4) as u8,
- (ctr >> 8*3) as u8, (ctr >> 8*2) as u8, (ctr >> 8*1) as u8, 14, (ctr >> 8*0) as u8];
- random_bytes
+ *self.rng_output.borrow()
}
}
@@ -583,6 +579,7 @@ pub fn do_test(mut data: &[u8], logger: &Arc<dyn Logger>) {
inbound_payment_key: ExpandedKey::new(inbound_payment_key),
counter: AtomicU64::new(0),
signer_state: RefCell::new(new_hash_map()),
+ rng_output: RefCell::new([42; 32]),
});
let monitor = Arc::new(chainmonitor::ChainMonitor::new(
@@ -986,6 +983,11 @@ pub fn do_test(mut data: &[u8], logger: &Arc<dyn Logger>) {
let fee = u32::from_le_bytes(get_slice!(4).try_into().unwrap());
input.fee_estimates.lock().unwrap().push_back(fee);
},
+ 49 => {
+ let mut rng_output = [0; 32];
+ rng_output.copy_from_slice(&get_slice!(32));
+ *keys_manager.rng_output.borrow_mut() = rng_output;
+ },
_ => return,
}
loss_detector.handler.process_events();
@@ -1093,13 +1095,13 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 148
ext_from_hex("030094", &mut test);
// funding_created and mac
- ext_from_hex("0022 ff4f00f805273c1b203bb5ebf8436bfde57b3be8c2f5e95d9491dbb181909679 3d00000000000000000000000000000000000000000000000000000000000000 0000 00000000000000000000000000000000000000000000000000000000000000210100000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0022 ff4f00f805273c1b203bb5ebf8436bfde57b3be8c2f5e95d9491dbb181909679 c000000000000000000000000000000000000000000000000000000000000000 0000 00000000000000000000000000000000000000000000000000000000000000dc0100000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
// client should now respond with funding_signed (CHECK 2: type 35 to peer 03000000)
// connect a block with one transaction of len 94
ext_from_hex("0c005e", &mut test);
// the funding transaction
- ext_from_hex("020000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0150c3000000000000220020ae0000000000000000000000000000000000000000000000000000000000000000000000", &mut test);
+ ext_from_hex("020000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0150c3000000000000220020530000000000000000000000000000000000000000000000000000000000000000000000", &mut test);
// connect a block with no transactions, one per line
ext_from_hex("0c0000", &mut test);
ext_from_hex("0c0000", &mut test);
@@ -1113,7 +1115,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
ext_from_hex("0c0000", &mut test);
ext_from_hex("0c0000", &mut test);
ext_from_hex("0c0000", &mut test);
- // by now client should have sent a channel_ready (CHECK 3: SendChannelReady to 03000000 for chan 3d000000)
+ // by now client should have sent a channel_ready (CHECK 3: SendChannelReady to 03000000 for chan c0000000)
// inbound read from peer id 0 of len 18
ext_from_hex("030012", &mut test);
@@ -1122,7 +1124,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 83
ext_from_hex("030053", &mut test);
// channel_ready and mac
- ext_from_hex("0024 3d00000000000000000000000000000000000000000000000000000000000000 020800000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0024 c000000000000000000000000000000000000000000000000000000000000000 020800000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
// new inbound connection with id 1
ext_from_hex("01", &mut test);
@@ -1157,7 +1159,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 255
ext_from_hex("0301ff", &mut test);
// beginning of accept_channel
- ext_from_hex("0021 0000000000000000000000000000000000000000000000000000000000000e12 0000000000000162 00000000004c4b40 00000000000003e8 00000000000003e8 00000002 03f0 0005 030000000000000000000000000000000000000000000000000000000000000100 030000000000000000000000000000000000000000000000000000000000000200 030000000000000000000000000000000000000000000000000000000000000300 030000000000000000000000000000000000000000000000000000000000000400 030000000000000000000000000000000000000000000000000000000000000500 02660000000000000000000000000000", &mut test);
+ ext_from_hex("0021 2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a 0000000000000162 00000000004c4b40 00000000000003e8 00000000000003e8 00000002 03f0 0005 030000000000000000000000000000000000000000000000000000000000000100 030000000000000000000000000000000000000000000000000000000000000200 030000000000000000000000000000000000000000000000000000000000000300 030000000000000000000000000000000000000000000000000000000000000400 030000000000000000000000000000000000000000000000000000000000000500 02660000000000000000000000000000", &mut test);
// inbound read from peer id 1 of len 39
ext_from_hex("030127", &mut test);
// rest of accept_channel and mac
@@ -1176,7 +1178,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 114
ext_from_hex("030172", &mut test);
// funding_signed message and mac
- ext_from_hex("0023 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000b90001000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0023 c400000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000310001000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
// broadcast funding transaction
ext_from_hex("0b", &mut test);
@@ -1189,7 +1191,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 83
ext_from_hex("030153", &mut test);
// channel_ready and mac
- ext_from_hex("0024 2900000000000000000000000000000000000000000000000000000000000000 026700000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0024 c400000000000000000000000000000000000000000000000000000000000000 026700000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
// inbound read from peer id 0 of len 18
ext_from_hex("030012", &mut test);
@@ -1198,7 +1200,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 255
ext_from_hex("0300ff", &mut test);
// beginning of update_add_htlc from 0 to 1 via client
- ext_from_hex("0080 3d00000000000000000000000000000000000000000000000000000000000000 0000000000000000 0000000000003e80 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 11 020203e8 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
+ ext_from_hex("0080 c000000000000000000000000000000000000000000000000000000000000000 0000000000000000 0000000000003e80 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 11 020203e8 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
// inbound read from peer id 0 of len 255
ext_from_hex("0300ff", &mut test);
ext_from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
@@ -1223,7 +1225,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 116
ext_from_hex("030074", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 3d00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000300100000000000000000000000000000000000000000000000000000000000000 0000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000cd0100000000000000000000000000000000000000000000000000000000000000 0000 03000000000000000000000000000000", &mut test);
// client should now respond with revoke_and_ack and commitment_signed (CHECK 5/6: types 133 and 132 to peer 03000000)
// inbound read from peer id 0 of len 18
@@ -1233,7 +1235,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 115
ext_from_hex("030073", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 3d00000000000000000000000000000000000000000000000000000000000000 0900000000000000000000000000000000000000000000000000000000000000 020b00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c000000000000000000000000000000000000000000000000000000000000000 0900000000000000000000000000000000000000000000000000000000000000 020b00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
// process the now-pending HTLC forward
ext_from_hex("07", &mut test);
@@ -1247,7 +1249,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 116
ext_from_hex("030174", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000e40001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c400000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000720001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
//
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1256,7 +1258,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 115
ext_from_hex("030173", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 2900000000000000000000000000000000000000000000000000000000000000 6600000000000000000000000000000000000000000000000000000000000000 026400000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c400000000000000000000000000000000000000000000000000000000000000 6600000000000000000000000000000000000000000000000000000000000000 026400000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
//
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1265,8 +1267,8 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 90
ext_from_hex("03015a", &mut test);
// update_fulfill_htlc and mac
- ext_from_hex("0082 2900000000000000000000000000000000000000000000000000000000000000 0000000000000000 ff00888888888888888888888888888888888888888888888888888888888888 01000000000000000000000000000000", &mut test);
- // client should immediately claim the pending HTLC from peer 0 (CHECK 8: SendFulfillHTLCs for node 03000000 with preimage ff00888888 for channel 3d000000)
+ ext_from_hex("0082 c400000000000000000000000000000000000000000000000000000000000000 0000000000000000 ff00888888888888888888888888888888888888888888888888888888888888 01000000000000000000000000000000", &mut test);
+ // client should immediately claim the pending HTLC from peer 0 (CHECK 8: SendFulfillHTLCs for node 03000000 with preimage ff00888888 for channel c0000000)
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1275,7 +1277,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 116
ext_from_hex("030174", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000330001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c400000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000700001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1284,7 +1286,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 115
ext_from_hex("030173", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 2900000000000000000000000000000000000000000000000000000000000000 6700000000000000000000000000000000000000000000000000000000000000 026500000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c400000000000000000000000000000000000000000000000000000000000000 6700000000000000000000000000000000000000000000000000000000000000 026500000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
// before responding to the commitment_signed generated above, send a new HTLC
// inbound read from peer id 0 of len 18
@@ -1294,7 +1296,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 255
ext_from_hex("0300ff", &mut test);
// beginning of update_add_htlc from 0 to 1 via client
- ext_from_hex("0080 3d00000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000000000003e80 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 11 020203e8 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
+ ext_from_hex("0080 c000000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000000000003e80 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 11 020203e8 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
// inbound read from peer id 0 of len 255
ext_from_hex("0300ff", &mut test);
ext_from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
@@ -1320,7 +1322,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 115
ext_from_hex("030073", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 3d00000000000000000000000000000000000000000000000000000000000000 0800000000000000000000000000000000000000000000000000000000000000 020a00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c000000000000000000000000000000000000000000000000000000000000000 0800000000000000000000000000000000000000000000000000000000000000 020a00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
// client should now respond with revoke_and_ack and commitment_signed (CHECK 5/6 duplicates)
// inbound read from peer id 0 of len 18
@@ -1330,7 +1332,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 116
ext_from_hex("030074", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 3d00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000c30100000000000000000000000000000000000000000000000000000000000000 0000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000003e0100000000000000000000000000000000000000000000000000000000000000 0000 03000000000000000000000000000000", &mut test);
// inbound read from peer id 0 of len 18
ext_from_hex("030012", &mut test);
@@ -1339,7 +1341,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 115
ext_from_hex("030073", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 3d00000000000000000000000000000000000000000000000000000000000000 0b00000000000000000000000000000000000000000000000000000000000000 020d00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c000000000000000000000000000000000000000000000000000000000000000 0b00000000000000000000000000000000000000000000000000000000000000 020d00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
// process the now-pending HTLC forward
ext_from_hex("07", &mut test);
@@ -1354,7 +1356,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 116
ext_from_hex("030174", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 2900000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000009c0001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c400000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000007e0001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1363,7 +1365,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 115
ext_from_hex("030173", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 2900000000000000000000000000000000000000000000000000000000000000 6400000000000000000000000000000000000000000000000000000000000000 027000000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c400000000000000000000000000000000000000000000000000000000000000 6400000000000000000000000000000000000000000000000000000000000000 027000000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1372,7 +1374,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 60
ext_from_hex("03013c", &mut test);
// update_fail_htlc and mac
- ext_from_hex("0083 2900000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0083 c400000000000000000000000000000000000000000000000000000000000000 0000000000000001 0000 01000000000000000000000000000000", &mut test);
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1381,7 +1383,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 116
ext_from_hex("030174", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 2900000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000e20001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c400000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000410001000000000000000000000000000000000000000000000000000000000000 0000 01000000000000000000000000000000", &mut test);
// inbound read from peer id 1 of len 18
ext_from_hex("030112", &mut test);
@@ -1390,7 +1392,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 1 of len 115
ext_from_hex("030173", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 2900000000000000000000000000000000000000000000000000000000000000 6500000000000000000000000000000000000000000000000000000000000000 027100000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c400000000000000000000000000000000000000000000000000000000000000 6500000000000000000000000000000000000000000000000000000000000000 027100000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000", &mut test);
// process the now-pending HTLC forward
ext_from_hex("07", &mut test);
@@ -1404,7 +1406,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 115
ext_from_hex("030073", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 3d00000000000000000000000000000000000000000000000000000000000000 0a00000000000000000000000000000000000000000000000000000000000000 020c00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c000000000000000000000000000000000000000000000000000000000000000 0a00000000000000000000000000000000000000000000000000000000000000 020c00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
// inbound read from peer id 0 of len 18
ext_from_hex("030012", &mut test);
@@ -1413,7 +1415,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 116
ext_from_hex("030074", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 3d00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000320100000000000000000000000000000000000000000000000000000000000000 0000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000cf0100000000000000000000000000000000000000000000000000000000000000 0000 03000000000000000000000000000000", &mut test);
// client should now respond with revoke_and_ack (CHECK 5 duplicate)
// inbound read from peer id 0 of len 18
@@ -1423,7 +1425,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 255
ext_from_hex("0300ff", &mut test);
// beginning of update_add_htlc from 0 to 1 via client
- ext_from_hex("0080 3d00000000000000000000000000000000000000000000000000000000000000 0000000000000002 00000000000b0838 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 12 02030927c1 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
+ ext_from_hex("0080 c000000000000000000000000000000000000000000000000000000000000000 0000000000000002 00000000000b0838 ff00000000000000000000000000000000000000000000000000000000000000 000003f0 00 030000000000000000000000000000000000000000000000000000000000000555 12 02030927c1 0401a0 060800000e0000010000 0a00000000000000000000000000000000000000000000000000000000000000 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
// inbound read from peer id 0 of len 255
ext_from_hex("0300ff", &mut test);
ext_from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", &mut test);
@@ -1448,7 +1450,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 180
ext_from_hex("0300b4", &mut test);
// commitment_signed and mac
- ext_from_hex("0084 3d00000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000750100000000000000000000000000000000000000000000000000000000000000 0001 00000000000000000000000000000000000000000000000000000000000000670500000000000000000000000000000000000000000000000000000000000006 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0084 c000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000f60100000000000000000000000000000000000000000000000000000000000000 0001 000000000000000000000000000000000000000000000000000000000000009b05000000000000000000000000000000000000000000000000000000000000fb 03000000000000000000000000000000", &mut test);
// client should now respond with revoke_and_ack and commitment_signed (CHECK 5/6 duplicates)
// inbound read from peer id 0 of len 18
@@ -1458,7 +1460,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// inbound read from peer id 0 of len 115
ext_from_hex("030073", &mut test);
// revoke_and_ack and mac
- ext_from_hex("0085 3d00000000000000000000000000000000000000000000000000000000000000 0d00000000000000000000000000000000000000000000000000000000000000 020f00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
+ ext_from_hex("0085 c000000000000000000000000000000000000000000000000000000000000000 0d00000000000000000000000000000000000000000000000000000000000000 020f00000000000000000000000000000000000000000000000000000000000000 03000000000000000000000000000000", &mut test);
// process the now-pending HTLC forward
ext_from_hex("07", &mut test);
@@ -1466,13 +1468,13 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
// connect a block with one transaction of len 125
ext_from_hex("0c007d", &mut test);
- // the commitment transaction for channel 2900000000000000000000000000000000000000000000000000000000000000
- ext_from_hex("020000000129000000000000000000000000000000000000000000000000000000000000000000000000000000800258020000000000002200201f0000000000000000000000000000000000000000000000000000000000000013c00000000000001600143b0000000000000000000000000000000000000005000020", &mut test);
+ // the commitment transaction for channel c400000000000000000000000000000000000000000000000000000000000000
+ ext_from_hex("0200000001c400000000000000000000000000000000000000000000000000000000000000000000000000000080025802000000000000220020940000000000000000000000000000000000000000000000000000000000000013c0000000000000160014d60000000000000000000000000000000000000005000020", &mut test);
//
// connect a block with one transaction of len 94
ext_from_hex("0c005e", &mut test);
// the HTLC timeout transaction
- ext_from_hex("0200000001200000000000000000000000000000000000000000000000000000000000000000000000000000000001a701000000000000220020e60000000000000000000000000000000000000000000000000000000000000000000000", &mut test);
+ ext_from_hex("0200000001ab0000000000000000000000000000000000000000000000000000000000000000000000000000000001a7010000000000002200206c0000000000000000000000000000000000000000000000000000000000000000000000", &mut test);
// connect a block with no transactions
ext_from_hex("0c0000", &mut test);
// connect a block with no transactions
@@ -1638,23 +1640,23 @@ mod tests {
// 1
assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling SendAcceptChannel event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 for channel ff4f00f805273c1b203bb5ebf8436bfde57b3be8c2f5e95d9491dbb181909679".to_string())), Some(&1));
// 2
- assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling SendFundingSigned event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 for channel 3d00000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&1));
+ assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling SendFundingSigned event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 for channel c000000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&1));
// 3
- 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));
+ assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling SendChannelReady event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 for channel c000000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&1));
// 4
- 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));
+ assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling SendChannelReady event in peer_handler for node 030200000000000000000000000000000000000000000000000000000000000000 for channel c400000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&1));
// 5
- 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));
+ assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling SendRevokeAndACK event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000002 for channel c000000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&4));
// 6
- 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));
+ 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 c000000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&3));
// 7
- 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));
+ 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 c400000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&3));
// 8
- 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));
+ 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 c000000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&1));
// 9
- 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));
+ 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 c000000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&2));
// 10
- 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));
+ assert_eq!(log_entries.get(&("lightning::chain::channelmonitor".to_string(), "Input spending counterparty commitment tx (00000000000000000000000000000000000000000000000000000000000000ab:0) in 0000000000000000000000000000000000000000000000000000000000000061 resolves outbound HTLC with payment hash ff00000000000000000000000000000000000000000000000000000000000000 with timeout".to_string())), Some(&1));
}
#[test]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.