Skip to content

Conversation

@sputn1ck
Copy link
Member

@sputn1ck sputn1ck commented Apr 8, 2025

This PR changes the way we quote for instantout by also providing the reservation ids.

Ai generated summary

This pull request includes changes to the InstantOutQuote functionality to replace the use of numReservations with reservationIds. The main goal is to improve the precision and flexibility of the reservation system.

Key changes include:

Updates to request and response handling:

  • looprpc/client.proto: Deprecated the num_reservations field and added a new reservation_ids field in the InstantOutQuoteRequest message.
  • swapserverrpc/instantout.pb.go: Updated the GetInstantOutQuoteRequest struct to include the new reservation_ids field and added a corresponding getter method. [1] [2]

Modifications in the quote retrieval logic:

  • instantout/manager.go: Changed the GetInstantOutQuote method to accept reservationIDs instead of numReservations and updated the logic to use the length of reservationIDs for fee calculations. [1] [2] [3]

Adjustments in the client-server communication:

These changes ensure that the system now uses specific reservation IDs, providing more accurate and detailed control over the reservations used in the swap process.

@sputn1ck sputn1ck requested a review from Copilot April 8, 2025 07:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

instantout/manager.go:223

  • [nitpick] The condition "len(reservationIDs) <= 0" can be replaced with "len(reservationIDs) == 0" for clarity, since a slice length will never be negative.
if len(reservationIDs) <= 0 {

@lightninglabs-deploy
Copy link

@bhandras: review reminder
@starius: review reminder
@sputn1ck, remember to re-request review from reviewers when ready

Copy link
Member

@bhandras bhandras left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@sputn1ck sputn1ck requested a review from hieblmi April 29, 2025 11:52
Copy link
Collaborator

@hieblmi hieblmi left a comment

Choose a reason for hiding this comment

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

needs rebase, otherwise LGTM✅

@sputn1ck sputn1ck force-pushed the reservations_quote branch 2 times, most recently from 82258bd to 8762f4a Compare April 30, 2025 07:49
@sputn1ck sputn1ck force-pushed the reservations_quote branch from 8762f4a to 1ce9bdd Compare April 30, 2025 13:36
@sputn1ck sputn1ck merged commit 2bc5df2 into lightninglabs:master Apr 30, 2025
4 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