Skip to content

Fix flaky trampoline_single_hop_receive test #3784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tnull
Copy link
Contributor

@tnull tnull commented May 19, 2025

Closes #3716.

.. we override the RNG to fix the flaky test case, thereby unblocking #3623.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented May 19, 2025

👋 Thanks for assigning @arik-so as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

arik-so
arik-so previously approved these changes May 19, 2025
@wpaulino wpaulino removed their request for review May 19, 2025 18:57
@tnull tnull force-pushed the 2025-05-fix-flaky-single-hop-receive-test branch from e1f11a0 to 58d8ed9 Compare May 19, 2025 19:12
@tnull
Copy link
Contributor Author

tnull commented May 19, 2025

Force-pushed the following fixup:

> git diff-tree -U2 e1f11a082 ddec70
diff --git a/lightning/src/ln/blinded_payment_tests.rs b/lightning/src/ln/blinded_payment_tests.rs
index f0b0a581d..d517365d9 100644
--- a/lightning/src/ln/blinded_payment_tests.rs
+++ b/lightning/src/ln/blinded_payment_tests.rs
@@ -1989,8 +1989,4 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
        let mut nodes = create_network(TOTAL_NODE_COUNT, &node_cfgs, &node_chanmgrs);

-       // We need the session priv to construct an invalid onion packet later.
-       let override_random_bytes = [3; 32];
-       *nodes[0].keys_manager.override_random_bytes.lock().unwrap() = Some(override_random_bytes);
-
        let (_, _, chan_id_alice_bob, _) = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 1_000_000, 0);
        let (_, _, chan_id_bob_carol, _) = create_announced_chan_between_nodes_with_value(&nodes, 1, 2, 1_000_000, 0);
@@ -2010,5 +2006,5 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
        let (payment_preimage, payment_hash, payment_secret) = get_payment_preimage_hash(&nodes[2], Some(amt_msat), None);

-       let carol_alice_trampoline_session_priv = SecretKey::from_slice(&override_random_bytes).unwrap();
+       let carol_alice_trampoline_session_priv = secret_from_hex("a0f4b8d7b6c2d0ffdfaf718f76e9decaef4d9fb38a8c4addb95c4007cc3eee03");
        let carol_blinding_point = PublicKey::from_secret_key(&secp_ctx, &carol_alice_trampoline_session_priv);
        let carol_blinded_hops = if success {
@@ -2098,4 +2094,8 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
        };

+       // We need the session priv to construct an invalid onion packet later.
+       let override_random_bytes = [3; 32];
+       *nodes[0].keys_manager.override_random_bytes.lock().unwrap() = Some(override_random_bytes);
+
        nodes[0].node.send_payment_with_route(route.clone(), payment_hash, RecipientOnionFields::spontaneous_empty(), PaymentId(payment_hash.0)).unwrap();

.. we override the RNG to fix the flaky test case.
@tnull tnull force-pushed the 2025-05-fix-flaky-single-hop-receive-test branch from 58d8ed9 to ddec702 Compare May 19, 2025 19:13
@tnull tnull requested review from TheBlueMatt and arik-so May 20, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix flaky test_trampoline_single_hop_receive test
5 participants