aperture icon indicating copy to clipboard operation
aperture copied to clipboard

multi: create challenger, secret, and interceptor packages

Open orbitalturtle opened this issue 2 years ago • 23 comments

This PR is just moving things around and exporting things. It attempts to make a few organizational changes:

  • Moves the challenger, secret, and client_interceptor code to new packages so that 1) they can be imported elsewhere. 2) to get rid of importing cycles when importing this code (particularly for the watchtower case described below)
  • Exports some of the testing mock tools, since they are potentially useful in the watchtower tests, and seems to make sense to keep things as DRY as possible!

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!

orbitalturtle avatar Mar 06 '23 05:03 orbitalturtle

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?

ellemouton avatar Mar 06 '23 06:03 ellemouton

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.

bucko13 avatar Mar 08 '23 02:03 bucko13

@orbitalturtle , planning to continue with this? I think it is pretty much good to go once the nits have been addressed :)

ellemouton avatar May 09 '23 09:05 ellemouton

@ellemouton Yikes, yes, sorry for being so slow :sloth: to get to this. I don't know how time moves so fast. I'll review and address your feedback this weekend. :pray:

orbitalturtle avatar May 09 '23 18:05 orbitalturtle

@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.

orbitalturtle avatar May 25 '23 00:05 orbitalturtle

Approved the CI run.

Roasbeef avatar May 25 '23 01:05 Roasbeef

Thanks @Roasbeef - fixed that linter issue.

orbitalturtle avatar May 25 '23 03:05 orbitalturtle

@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 auth package supplies the Mint mock and the or that the challenger supplies the mock for the InvoiceClient. I'd personally lean towards keeping these mocks exported, but moving them to a more appropriate package -- either a separate "mock" package or just to more appropriate existing packages. Then users can choose to either import or just copy the mocks for whatever projects their working on -- depending on what makes sense for their particular project.

orbitalturtle avatar May 31 '23 17:05 orbitalturtle

@orbitalturtle, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Nov 27 '23 11:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 27 '23 17:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 27 '23 18:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 27 '23 19:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 27 '23 20:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 27 '23 21:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 27 '23 22:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 28 '23 00:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 28 '23 01:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 28 '23 02:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 28 '23 03:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 28 '23 04:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 28 '23 05:11 lightninglabs-deploy

Closing due to inactivity

lightninglabs-deploy avatar Nov 28 '23 06:11 lightninglabs-deploy

!lightninglabs-deploy mute

ellemouton avatar Nov 28 '23 06:11 ellemouton