Open m1sterc001guy opened 4 months ago
What kind of migration would be required for this? If a client is in Refundable
, can we just stick them in another state?
What kind of migration would be required for this? If a client is in Refundable, can we just stick them in another state?
It should be possible to transition the old client back from Refundable
to Funded
, since Funded
has a superset of transitions that Refundable
did (i.e the transitions that Refundable
used to have are now moved to Funded
).
Once client side migrations have been implemented of course :)
I think the PR is a bit premature since client side migrations are not implemented yet, but wanted to give an example of what I was thinking to fix this problem https://github.com/fedimint/fedimint/issues/4014. I think this should help with some of the problems the Mutiny guys are hitting.
Attention: Patch coverage is 81.72043%
with 17 lines
in your changes are missing coverage. Please review.
:exclamation: No coverage uploaded for pull request base (
master@e08dd65
). Click here to learn what that means. Report is 10 commits behind head on master.:exclamation: Current head 86cd86f differs from pull request most recent head b78baee. Consider uploading reports for the commit b78baee to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Maybe we can add a "likely to be refunded" flag to the Funded state and set it when the GW is doing things it shouldn't do? It wouldn't influence the SM, but could be used to give users more clarity.
Yep, good point. Perhaps the refund height can go here too. Like you said, I think ultimately the cancelled
flag on the contract should be the source of truth, but we can perhaps give the end user some additional info on what is happening.
I'm going to put this aside for the moment and try to finish state machine db migrations so that this can be a backwards-compatible change.
Note: @joschisan's NG lightning implementation does the same thing as this PR https://github.com/fedimint/fedimint/pull/3468
This should be ready for review. I think this makes our lightning payments simpler.
I tried to do this in the most backwards compatible way possible, so I left some states in enums that can be cleaned up later. I wrote a db migration to add an error_reason
to the Refund
state, but if we won't want that, the db migration isn't required.
Writing a test for the db migration is currently kind of difficult since we need to keep old structs around. https://github.com/fedimint/fedimint/issues/4536
This will require cleanup after the fact to get rid of no longer used states after #4536 lands.
Also, I vote against backporting this. It fixes a minor bug but is a rather complex change that could massively delay 0.3.
If we're not going to backport, we will need to wait to merge until after we fix https://github.com/fedimint/fedimint/issues/4700. Otherwise it will make fixing that issue painful
@m1sterc001guy want to merge it now? The #4700 fix doesn't seem to have resulted in any conflicts.
I think I'm close to have a solution for https://github.com/fedimint/fedimint/issues/4536, in which case I would prefer to get rid of the new enums introduced here. If we're not going to backport this, let's wait a little longer so I can clean it up :)
dev call: don't put it into 0.3.0. Try to backport to 0.3.1. @m1sterc001guy going to remove need to duplicate enums before merging.
Converting to draft until https://github.com/fedimint/fedimint/pull/4719 is merged
Going to work on https://github.com/fedimint/fedimint/issues/4823 first, since this will make the migrations easier to write.
This is finally ready for another round of review.
See https://github.com/fedimint/fedimint/issues/4014 for motivation.
I believe the
Refundable
state is unnecessary in the lightning client state machine and can be removed. This eliminates a state transition, but also eliminates the arbitrary 30 second timeout on payments.