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

Temp #102

Closed
wants to merge 15 commits into from
Closed

Temp #102

wants to merge 15 commits into from

Conversation

ellemouton
Copy link
Owner

Change Description

Description of change / link to associated issue.

Steps to Test

Steps for reviewers to follow to test the change.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

In this commit, a new key, cChanMaxCommitmentHeight, is added to the
channel details bucket. This key will hold the highest commitment number
that the tower has been handed for this channel. In this commit, we
start writing to it in the two places where a backup is first persisted
in the tower client db: 1) CommitUpdate and 2) in the Queue's `addItem`
method. The logic for both 1 & 2 is tested in the next commit which adds
a DB helper that allows us to read the new field.

A follow up commit will do a migration to back-fill the new field.
This commit also adds tests for the DB changes made in the previous
commit since we can now read the new field with the FetchChanInfos
method.

The commit following this one does the backfill migration.
Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

This commit adds a test to demonstrate an edge case that can result in
the "tower has un-acked updates" error being thrown when a user is
attempting to remove a tower. This will be fixed in an upcoming commit.
In this commit, we adjust the PostEvaluateFilterFn to also take in a
count representing the number of committed updates (ie, persisted
un-acked updates) that the session has. We also add a new
CountCommittedUpdates option so that the number of committed updates is
not counted unnecessarily. These new options are not yet used.
In this commit, we use the newly added session listing options to ensure
that we only see a session as exhausted if it does not have any un-acked
updates on disk. This fixes the bug previously demonstrated.
This is added as a TLV record meaning that all the towers currently on
disk that don't have this new field will be seen as Active.
And then only load active towers on client start up.
This new method sets the tower's status to inactive. It also iterates
over all the tower's sessions and set's their status to inactive too.
With this commit we also ensure that a tower's status is set to active
if the CreateTower is called when the tower already exists.
Instead of loading towers by active sessions.
In this commit, the client session Inactive status is renamed to
Terminal since its meaning will now change to mean that this session
should never be used again.
Follow up commits will ensure that we no longer move sessions to this
state unless they can absolutely not be recovered.
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.

1 participant