Skip to content

Update probes_for_diversity to test datapoint time updating #3713

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

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

It turns out probes_for_diversity wasn't actually testing that the datapoint update time logic worked as it was indicating a payment failed while trying to fully saturate a channel (which teaches us nothing).

Instead, we need to "send" less over the channel and update twice to get the channel last-update-time logic tested.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Apr 7, 2025

👋 Thanks for assigning @tnull 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.

scorer.payment_path_failed(&payment_path_for_amount(500), 42, Duration::ZERO);

// Apply an update to set the last-update time to 1 second
scorer.payment_path_failed(&payment_path_for_amount(490), 42, Duration::from_secs(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't update the bounds, didn't we still learn that the bounds are still valid? And maybe the data point time needs to be updated in that case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there's still something about the probe amount. Probing with 1 sat gives less information than 20% chan capacity. But I am assuming for this that constant amount probing is used.

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@tnull tnull self-requested a review April 8, 2025 08:23
tnull
tnull previously approved these changes Apr 8, 2025
Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, mod pending comments.

It turns out `probes_for_diversity` wasn't actually testing that
the datapoint update time logic worked as it was indicating a
payment failed while trying to fully saturate a channel (which
teaches us nothing).

Instead, we need to "send" less over the channel and update twice
to get the channel last-update-time logic tested.
When we see a failure or success and it doesn't result in a bounds
update, we previously were'nt updating the `last_datapoint_time`
field as we were updating it in the bounds-update logic.

This is wrong for the purpose of the `probing_diversity_penalty`
because the whole point is to avoid repeatedly probing the same
channel, but because of this we'll probe the same channel again and
again as long as we don't learn any new information from the probes
which causes a bounds update.
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.23%. Comparing base (a245ca7) to head (c22a032).
Report is 355 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3713      +/-   ##
==========================================
+ Coverage   90.00%   91.23%   +1.23%     
==========================================
  Files         151      157       +6     
  Lines      130296   145803   +15507     
  Branches   130296   145803   +15507     
==========================================
+ Hits       117273   133029   +15756     
+ Misses      10463    10375      -88     
+ Partials     2560     2399     -161     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnull tnull merged commit 46cb5ff into lightningdevkit:main Apr 9, 2025
25 of 27 checks passed
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.

4 participants