Skip to content
New issue

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

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

Already on GitHub? # to your account

Offers without extra plugin #2976

Merged
merged 8 commits into from
Mar 10, 2025
Merged

Offers without extra plugin #2976

merged 8 commits into from
Mar 10, 2025

Conversation

thomash-acinq
Copy link
Member

@thomash-acinq thomash-acinq commented Jan 7, 2025

Enable basic offer management without the need for a plugin.

Offers allow a wide range of use-cases and it would be impossible to cover everything in eclair which is why we have relied on plugins to manage offers. However most users will not need advanced features, with this PR we aim to provide the basic features that will be enough for 95% of users. Advanced users can still use a plugin to manage more complex offers.

Supported use-cases:

  • accepting donations
  • selling items without inventory management
  • compact offers using our public node id
  • private offers where our identity is protected by a blinded path

@thomash-acinq thomash-acinq changed the title Offers no plugin Offers without extra plugin Jan 7, 2025
@thomash-acinq thomash-acinq marked this pull request as draft January 7, 2025 12:48
@thomash-acinq thomash-acinq force-pushed the offers-no-plugin branch 2 times, most recently from b8611f6 to 5e9bc0e Compare January 14, 2025 10:14
@thomash-acinq thomash-acinq force-pushed the offers-no-plugin branch 5 times, most recently from 467a5a4 to 665ad0a Compare February 10, 2025 17:21
@thomash-acinq thomash-acinq force-pushed the offers-no-plugin branch 5 times, most recently from 7e0cff1 to 4b60ea1 Compare March 5, 2025 11:27
@thomash-acinq thomash-acinq marked this pull request as ready for review March 5, 2025 11:28
@thomash-acinq thomash-acinq requested a review from t-bast March 5, 2025 11:28
@thomash-acinq thomash-acinq force-pushed the offers-no-plugin branch 2 times, most recently from 89ba629 to 2220ab7 Compare March 5, 2025 12:23
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Mostly small architectural comments and nits at that point, the overall flow looks good!

This commit doesn't contain any implementation change, it only focuses
on refactoring, adding comments, logs, applying formatter suggestions
and improving tests.
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, apart from the tests. I've done some refactoring and clean-up in #3030, but it should be quite straightforward (the biggest refactoring is DefaultOfferHandler, but it's purely refactoring).

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Some improvements to the tests, and we should be good to go!

@t-bast t-bast merged commit 722c9ff into master Mar 10, 2025
1 check passed
@t-bast t-bast deleted the offers-no-plugin branch March 10, 2025 15:22
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 85.24590% with 27 lines in your changes missing coverage. Please review.

Project coverage is 85.84%. Comparing base (10edb42) to head (867487f).
Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
...r-core/src/main/scala/fr/acinq/eclair/Eclair.scala 0.00% 10 Missing ⚠️
.../main/scala/fr/acinq/eclair/db/DualDatabases.scala 25.00% 6 Missing ⚠️
...inq/eclair/payment/offer/DefaultOfferHandler.scala 84.84% 5 Missing ⚠️
...a/fr/acinq/eclair/payment/offer/OfferCreator.scala 86.66% 4 Missing ⚠️
.../main/scala/fr/acinq/eclair/db/pg/PgOffersDb.scala 97.29% 1 Missing ⚠️
...ala/fr/acinq/eclair/db/sqlite/SqliteOffersDb.scala 96.87% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2976      +/-   ##
==========================================
- Coverage   86.02%   85.84%   -0.19%     
==========================================
  Files         228      234       +6     
  Lines       20452    21100     +648     
  Branches      846      846              
==========================================
+ Hits        17594    18113     +519     
- Misses       2858     2987     +129     
Files with missing lines Coverage Δ
...air-core/src/main/scala/fr/acinq/eclair/Logs.scala 87.50% <100.00%> (+0.19%) ⬆️
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 92.14% <100.00%> (+0.14%) ⬆️
...ir-core/src/main/scala/fr/acinq/eclair/Setup.scala 74.11% <100.00%> (-0.89%) ⬇️
.../src/main/scala/fr/acinq/eclair/db/Databases.scala 84.40% <100.00%> (+0.29%) ⬆️
...e/src/main/scala/fr/acinq/eclair/db/OffersDb.scala 100.00% <100.00%> (ø)
...ain/scala/fr/acinq/eclair/db/pg/PgPaymentsDb.scala 98.61% <100.00%> (ø)
.../scala/fr/acinq/eclair/payment/Bolt12Invoice.scala 97.40% <100.00%> (-0.04%) ⬇️
...a/fr/acinq/eclair/payment/offer/OfferManager.scala 96.96% <100.00%> (+3.98%) ⬆️
...cinq/eclair/payment/receive/MultiPartHandler.scala 93.90% <100.00%> (+0.64%) ⬆️
.../scala/fr/acinq/eclair/payment/relay/Relayer.scala 90.00% <ø> (-0.20%) ⬇️
... and 8 more

... and 14 files with indirect coverage changes

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants