-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix Binding Outlay Tracking, update API as a result #97
Conversation
@farscapian I pushed a test for
|
I think we planned for this eventuality by namespacing the version number into the db key hierarchy (prism_db_version). So, since we have an incompatible version, we should bump the db key namespace so there are no issues. (I had to do some manual db cleanups on the ROYGBIV instance due to this issue.) Once we change the db namespace, we have another question:
I think due to the newness of this plugin, we can inform users via Release Notes and Telegram channel and work on migration logic for future incompatibilities. |
Yeah this is fine with me, probably very few if any are using the plugin
This shouldn't be too hard. Just on initialization we look through the prism related db records, modify them as need, then save updated. The versioning will be key here. On that note, this seems good to merge to me. Has the CI that uses PS, sorry I missed this again, gotta figure out whats up with my GH notifications. |
Yeah I'm not sure why that thing isn't completing. We haven't changed anything related to CI afaik, and the error isn't prism related. I have a couple of minor updates to push including bumping the db version. Plus I want to update the documentation again. I've seen a couple errors I want to correct. I'm also trying to unify the example in these docs with roygbiv.guide/example (switching to a Band Prism example). Give me a couple more days. |
@@ -2,6 +2,8 @@ | |||
|
|||
set -eu | |||
|
|||
docker system prune -f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this prune the entire system? Is that acceptable to clear docker related things that aren't related to this plugin? Can we instead just rebuild the image and tear it down when tests complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, removing from latest PR fix-readme.
@@ -46,21 +46,20 @@ def validate(member): | |||
raise Exception( | |||
"Destination must be a valid lightning node pubkey or bolt12 offer.") | |||
|
|||
if not isinstance(member["split"], int): | |||
raise ValueError("Member 'split' must be an integer") | |||
if not isinstance(member["split"], float): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other option is add different logic depending on prism version, but I think we should prefer migrating prisms to latest version where posssible
On the production ROYGBIV prism instance, I was having some issues with the plugin not fully completing when an incoming payment was received. The plugin was making payments on mainnet and attempting to update the outlay to a negative number (mainnet is the only place we've tested where fees are non-zero). Negative numbers for outlay should be possible. The issue is, we originally defined the outlay to be a Millisatoshi type, which apparently doesn't support negative numbers. So the first part of this PR includes fixing that issue. I completely remove Millisatoshi from the picture and rely on python's built-in
int
type for tracking the outlays. This has the correct behavior with negative numbers. I also added RPC method for setting the outlay value (closing #95 and #50 ). I should also mention that I REMOVED the update_outlays function and moved that logic Prism.pay. This allows us to update outlays after each payment attempt rather than waiting to update outlays until all payments have completed (assuming they complete!).Unfortunately, this change impacts the API. Since this is a necessary fix, I decided to go ahead and implement other Issues which also affect the API. Per the advice from some CLN folks, I updated the
prism_id
andmember_id
mechanism (#88 #87 #86 ). Now prisms and members each get a unique ID at creation time and in format similar to offer_ids. In addition, I changed "label" values to "description". I also changed the "split" parameter to type float. This allows users to be more expressive in terms of how they provide the split. I also madepayment_threshold_msat
a positive int.There's also a bug fix: #96 and documentation updates. I updated the example to a Band Prism so we can hopefully demonstrate relatable prism infrastructure to people.