Skip to content
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: replace occurrences of "LSAT" to "L402" #730

Merged
merged 8 commits into from Apr 29, 2024

Conversation

starius
Copy link
Collaborator

@starius starius commented Apr 17, 2024

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:

  • looprpc,swapserverrpc: update Go image to 1.19.10 (needed for the following item)
  • go: bump protobuf to v1.33.0-hex-display (needed to update to the recent aperture version)
  • multi: apply make fmt

Pull Request Checklist

  • Update release_notes.md if your PR contains major features, breaking changes or bugfixes

This is a breaking change!

In loopd.conf file maxlsatcost and maxlsatfee were renamed to maxl402cost and maxl402fee 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 to GetL402Tokens. Update loop and loopd simultaneously otherwise this RPC won't work.

@hieblmi hieblmi self-requested a review April 18, 2024 08:34
Copy link
Collaborator

@hieblmi hieblmi left a 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

@hieblmi
Copy link
Collaborator

hieblmi commented Apr 18, 2024

On another note, we should check if that these changes don't break the server.

@levmi levmi removed the request for review from guggero April 18, 2024 13:39
Copy link
Member

@guggero guggero left a 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.

@@ -1,4 +1,4 @@
FROM golang:1.16.3-buster
FROM golang:1.19.10-buster
Copy link
Member

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.

Copy link
Collaborator Author

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
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

loopd/config.go Show resolved Hide resolved
looprpc/client.yaml Show resolved Hide resolved
release_notes.md Show resolved Hide resolved
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.
Copy link
Member

@guggero guggero left a 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
Copy link
Member

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
Copy link
Member

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.

Copy link
Collaborator Author

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.

loopd/perms/perms.go Show resolved Hide resolved
loopd/utils.go Show resolved Hide resolved
looprpc/client.yaml Show resolved Hide resolved
starius added a commit to starius/loop that referenced this pull request Apr 25, 2024
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)
@starius starius requested a review from guggero April 25, 2024 16:58
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM 🎉

looprpc/client.proto Outdated Show resolved Hide resolved
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)
@bhandras bhandras merged commit 13e8c29 into lightninglabs:master Apr 29, 2024
4 checks passed
@starius starius deleted the s-lsat-l402 branch April 29, 2024 13:00
hieblmi pushed a commit to hieblmi/loop that referenced this pull request Apr 29, 2024
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)
hieblmi pushed a commit to hieblmi/loop that referenced this pull request May 6, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants