Skip to content
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

channeldb: refactor UpdateInvoice to make it simpler to create SQL specific implementation #8100

Merged
merged 15 commits into from
Feb 28, 2024

Commits on Feb 19, 2024

  1. channeldb: extract store update methods when updaing an invoice

    This commit is a small refactor to move all actual DB updates after
    an invoice state is update to separate methods. This is a small
    preliminary change before we completely decouple DB updates from
    in-memory invocie update.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    eb4198b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4bf6b52 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7298b2d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ef5a317 View commit details
    Browse the repository at this point in the history
  5. invoices: refactor updateHtlc to return new state

    With this refactor updateHtlc is renamed to getUpdatedHtlcState and
    changed such that it won't change the HTLC's state and resolve time but
    instead returns whether the change is needed. This change is part of a
    multi-commit refactor to ensure that all changes to the invoice will be
    tracked individually.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    342eb4e View commit details
    Browse the repository at this point in the history
  6. invoices: rename updateInvoiceState to getUpdatedInvoiceState

    This commit turns updateInvoiceState "const" by moving preimage update
    out of the function while also removing it to getUpdatedInvoiceState.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    87044b8 View commit details
    Browse the repository at this point in the history
  7. invoices: change cancelSingleHtlc to be purely used for validation

    This change moves the HTLC state change out of the cancelSingleHtlc
    function. This is part of the larger refactor of collecting all changes
    to be later applied by the invoice updater.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    08df7f4 View commit details
    Browse the repository at this point in the history
  8. invoices: refactor updateInvoiceAmpState to return new state

    With this commit updateInvoiceAmpState becomes getUpdatedInvoiceAmpState
    which will only return the new AMP state but that needs to be applied at
    the call site. This is a part of a larger refactor to gather all
    mutations of an invoice update to be later applied by the invoice
    updater.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    9981569 View commit details
    Browse the repository at this point in the history
  9. invoices+channeldb: add InvoiceUpdater interface and the KV impl

    This commit introduces the InvoiceUpdater interface which is meant
    to abstract and assist the in-memory invoice update procedure with
    the accompanying database updates. These abstract updater steps will
    enable further refactoring later while also ensuring that a full
    SQL implementation of the InvoiceDB interface will be possible.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    ecbfc46 View commit details
    Browse the repository at this point in the history
  10. invoices: move UpdateInvoice implementation to the invoices package

    With the introducation of the `InvoiceUpdater` interface we are now
    able to move the non-kv parts of `UpdateInvoice` completely under
    the invoices package. This is a preprequisite for being able to use
    the same code-base for the sql InvoiceDB implementation of
    UpdateInvoice.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    6b0931a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5e746b4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0e2b39e View commit details
    Browse the repository at this point in the history
  13. invoices: parametrize invoice(registry) tests with InvoiceDB constructor

    This commit extracts the InvoiceDB construction from all invoice and
    registry tests such that we can later on run subtests with multiple
    backends without needing to use tags.
    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    7d56d53 View commit details
    Browse the repository at this point in the history
  14. mod: bump kvdb to v1.4.5

    bhandras committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    f5abc94 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    bcc6a3f View commit details
    Browse the repository at this point in the history