-
Notifications
You must be signed in to change notification settings - Fork 58
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
multi: create challenger, secret, and interceptor packages #91
base: master
Are you sure you want to change the base?
multi: create challenger, secret, and interceptor packages #91
Conversation
6a102ab
to
ec1205c
Compare
Thanks for the PR @orbitalturtle 🔥 @guggero - I dont have the perms to request myself as reviewer here it seems. Can you request review from me pls? |
Just wanted to chime in a plus one on the motivation for this. Being able to use this more as a library when applicable will be huge for lsat adoption imo. |
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.
Looking good!
@@ -18,9 +18,12 @@ import ( | |||
gateway "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" | |||
flags "github.com/jessevdk/go-flags" | |||
"github.com/lightninglabs/aperture/auth" | |||
"github.com/lightninglabs/aperture/challenger" |
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.
commit message comment:
NewLndChallenger
isnt altered to take in an lndclient (which is the thing that would cause an import cycle), but rather is altered to take achallenger.InvoiceClient
(which lnd client just happens to implement)- nitty nit: check out LND contribution guidelines for ideal commit title & message structure 🙏
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.
also - for easier review, I think perhaps do 1 commit where you do the refactoring and then a separate commit for the NewLndChallenger
change
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.
I moved the NewLndChallenger changes into a new commit. The change was a bit awkward because NewLndChallenger initially needs AuthConfig, which is defined in the main package. But then in the next commit we remove AuthConfig entirely because it's not needed once we update NewLndChallenger to take in the client as a parameter. This was the cleanest way I could think to make the change - maybe it's still worth it for review readability. Lmk your thoughts!
@orbitalturtle , planning to continue with this? I think it is pretty much good to go once the nits have been addressed :) |
@ellemouton Yikes, yes, sorry for being so slow 🦥 to get to this. I don't know how time moves so fast. I'll review and address your feedback this weekend. 🙏 |
7b649fb
to
f8dc8ba
Compare
@ellemouton Finally got around to this. Sorry for the long wait. Promise if you have any more feedback I'll respond much faster! One comment/question above but otherwise was able to address the rest of the comments. |
Approved the CI run. |
f8dc8ba
to
d15f001
Compare
Thanks @Roasbeef - fixed that linter issue. |
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.
Looking good!
The one thing im not sure of is the mocks. seems strange that the auth
package would supply the mock for the Mint
or that the challenger
would supply the mock for the InvoiceClient
. Also, im not sure how useful these mocks would be elsewhere - from my experience if I am using a mock, i mostly need to tweak it so that it works a certain way and that will be hard to do if importing the mock from another repo. Might be a case of "a little bit of copying is better than a little bit of dependency". Interested to hear other people's thoughts on this too though!
d15f001
to
da41dd9
Compare
@ellemouton Yeah definitely a fair point about the mocks. Here's what I'm envisioning. I'll definitely be making some changes to the mocks to test the aforementioned lnd watchtower payments changes. But I figured it would be a bit odd to copy the mocks and make updates to it in the lnd repo, since someone who might also be interested in these mock updates is unlikely to be looking in lnd/watchtower for them. If someone might want to use or copy these mocks, they're much more likely to look here in the aperture package for inspiration. As you said, it's awkward that the |
Moves challenger and secrets files to new packages so they can be imported elsewhere.
- Alters NewLndChallenger so that it takes challenger.InvoiceClient in as a parameter. (This is useful in the case of using NewLndChallenger in the lnd watchtower project, to avoid having to import lndclient, which leads to an import cycle.) - Also deletes the AuthConfig parameter. Since we now pass the LND client directly into the function, the AuthConfig parameter is no longer needed.
da41dd9
to
8152075
Compare
@orbitalturtle, remember to re-request review from reviewers when ready |
Closing due to inactivity |
3 similar comments
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
8 similar comments
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
Closing due to inactivity |
!lightninglabs-deploy mute |
This PR is just moving things around and exporting things. It attempts to make a few organizational changes:
Stepping back, the higher level goal here is to be able to use some of the minter and challenger code in the lnd watchtower for minting and verifying lsats. I had talked with @Roasbeef a while back about adding a method of paying a watchtower for storing state updates for other users, and we discussed using lsats for this purpose. This lays the groundwork for that. (Initial PR for the watchtower code incoming soon(tm))
If there are reasons to organize these changes in a different way, I'm more than happy to make adjustments, thanks!