-
Notifications
You must be signed in to change notification settings - Fork 120
multi: replace occurrences of "LSAT" to "L402" #730
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
Conversation
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.
Thank you very much for the PR, tACK from my side. I tested your changes on my static address branch which fetches an L402 from a local instance. Don't see any issues. The only remaining lsat
references in code are in release notes, so LGTM
On another note, we should check if that these changes don't break the server. |
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.
Code looks good to me. See inline discussion about potential backward compatibility fixes.
Going to approve once dependent PR is merged to avoid merging prematurely.
looprpc/Dockerfile
Outdated
@@ -1,4 +1,4 @@ | |||
FROM golang:1.16.3-buster | |||
FROM golang:1.19.10-buster |
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.
Here's an example for the changes required to the protobuf-compiler
and clang-format
versions if you wanted to go to a -bookworm
(Go 1.2x) version: https://github.com/lightninglabs/taproot-assets/blob/main/taprpc/Dockerfile#L1
It's not too involved, so I would suggest doing it.
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.
Fixed
go.mod
Outdated
@@ -204,4 +204,7 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d | |||
|
|||
replace github.com/lightninglabs/loop/swapserverrpc => ./swapserverrpc | |||
|
|||
// Temporary added until https://github.com/lightninglabs/aperture/pull/135 is merged. | |||
replace github.com/lightninglabs/aperture => github.com/starius/aperture v0.3.2-rc1-beta |
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.
Reminder to not merge this PR until the dependent PR was merged.
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.
Fixed
This is needed to update protobuf. Version 1.33 breaks in Go 1.16 with the following error: "//go:build comment without // +build comment". Distribution was updated from buster (10) to bookworm (12). protoc was updated from v3.6.1 to v3.21.12.
Fix the build: go mod tidy sed 's@\<lsat\>@l402@g' -i `git grep -l -w aperture/lsat` make rpc
git mv ./cmd/loop/lsat.go ./cmd/loop/l402.go sed 's@lsat@l402@g' -i `git grep -l lsat` sed 's@Lsat@L402@g' -i `git grep -l Lsat` sed 's@LSAT@L402@g' -i `git grep -l LSAT` make rpc Updated release_notes.md.
The flags were re-added in hidden mode so that users who specified them could start the daemon after upgrading. If a flag is used, a deprecation warning is printed. Updated release_notes.md.
Provide backward compatibility for clients using this API endpoint.
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.
Code looks great now, thanks for the updates!
A remaining question around backward compatibility of the RPC interface. Normally we don't break backward compatibility for at least two major releases (at least that's the idea in lnd
but in practice we end up rarely removing/breaking anything at all)...
@@ -1,21 +1,25 @@ | |||
FROM golang:1.16.3-buster | |||
FROM golang:1.21.9-bookworm |
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.
Reminder to push a new tag for the swapserverrpc
module after merging this PR.
@@ -1,6 +1,6 @@ | |||
// Code generated by protoc-gen-go. DO NOT EDIT. | |||
// versions: | |||
// protoc-gen-go v1.31.0 | |||
// protoc-gen-go v1.33.0 |
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.
micro-nit (non-blocking): This should probably go into the previous commit.
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.
This is actually updated in this commit.
This is needed not to break existing client binaries, e.g. `loop listauth`, Terminal Web, RTL. The API should be removed in a couple of releases. For now, GetLsatTokens just prints a warning message about the API being deprecated and that the client binary should be updated, and calls GetL402Tokens API, as a wrapper. Type LsatToken used by GetLsatTokens in the past was renamed to L402Token, but this does not affect binary encoding, so type L402Token can be used (as part of TokensResponse) without breaking backward compatibility. Updated release_notes.md. See lightninglabs#730 (comment)
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.
Nice, LGTM 🎉
This is needed not to break existing client binaries, e.g. `loop listauth`, Terminal Web, RTL. The API should be removed in a couple of releases. For now, GetLsatTokens just prints a warning message about the API being deprecated and that the client binary should be updated, and calls GetL402Tokens API, as a wrapper. Type LsatToken used by GetLsatTokens in the past was renamed to L402Token, but this does not affect binary encoding, so type L402Token can be used (as part of TokensResponse) without breaking backward compatibility. Updated release_notes.md. See lightninglabs#730 (comment)
This is needed not to break existing client binaries, e.g. `loop listauth`, Terminal Web, RTL. The API should be removed in a couple of releases. For now, GetLsatTokens just prints a warning message about the API being deprecated and that the client binary should be updated, and calls GetL402Tokens API, as a wrapper. Type LsatToken used by GetLsatTokens in the past was renamed to L402Token, but this does not affect binary encoding, so type L402Token can be used (as part of TokensResponse) without breaking backward compatibility. Updated release_notes.md. See lightninglabs#730 (comment)
This is needed not to break existing client binaries, e.g. `loop listauth`, Terminal Web, RTL. The API should be removed in a couple of releases. For now, GetLsatTokens just prints a warning message about the API being deprecated and that the client binary should be updated, and calls GetL402Tokens API, as a wrapper. Type LsatToken used by GetLsatTokens in the past was renamed to L402Token, but this does not affect binary encoding, so type L402Token can be used (as part of TokensResponse) without breaking backward compatibility. Updated release_notes.md. See lightninglabs#730 (comment)
Description
Aperture was updated to include lightninglabs/aperture#135 . Occurrences of "LSAT" in the loop's code were replaced with "L402".
This PR depends on lightninglabs/aperture#135 . Commit "update aperture to include lsat to l402 renaming" should be updated after lightninglabs/aperture#135 is merged.
Some unrelated changes:
Pull Request Checklist
release_notes.md
if your PR contains major features, breaking changes or bugfixesThis is a breaking change!
In loopd.conf file
maxlsatcost
andmaxlsatfee
were renamed tomaxl402cost
andmaxl402fee
accordingly. If they have been changed locally, the file has to be updated for loopd to recognize the options.The path in looprpc "/v1/lsat/tokens" was renamed to "/v1/l402/tokens" and the corresponding method was renamed from
GetLsatTokens
toGetL402Tokens
. Updateloop
andloopd
simultaneously otherwise this RPC won't work.