Skip to content

Commit 9470d44

Browse files
committed
remove lsps2 support
1 parent 0d76220 commit 9470d44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+37
-4790
lines changed

.github/workflows/integration_tests.yaml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -136,48 +136,6 @@ jobs:
136136
CLN_VERSION: ${{ env.CLN_VERSION }}
137137
timeout: 6m
138138

139-
run-lsps2-test:
140-
runs-on: ubuntu-latest
141-
needs:
142-
- setup-itest
143-
- setup-bitcoin-core
144-
- setup-cln
145-
- build-lspd
146-
name: ${{ matrix.lsp }}-lsp ${{ matrix.client }}-client ${{ matrix.test }}
147-
strategy:
148-
max-parallel: 4
149-
matrix:
150-
test: [
151-
testLsps0GetProtocolVersions,
152-
testLsps2GetVersions,
153-
testLsps2GetInfo,
154-
testLsps2Buy,
155-
testLsps2HappyFlow,
156-
testLsps2NoBalance,
157-
testLsps2ZeroConfUtxo
158-
]
159-
lsp: [
160-
CLN
161-
]
162-
client: [
163-
CLN
164-
]
165-
steps:
166-
- name: Checkout
167-
uses: actions/checkout@v4
168-
169-
- name: Run and Process Test State
170-
uses: ./.github/actions/test-lspd
171-
with:
172-
TESTRE: "TestLspd/${{ matrix.lsp }}-lsp-${{ matrix.client}}-client:_${{ matrix.test }}"
173-
artifact-name: TestLspd-${{ matrix.lsp }}-lsp-${{ matrix.client}}-client_${{ matrix.test }}
174-
bitcoin-version: ${{ env.BITCOIN_VERSION }}
175-
LSP_REF: ${{ env.LSP_REF }}
176-
CLIENT_REF: ${{ env.CLIENT_REF }}
177-
GO_VERSION: ${{ env.GO_VERSION }}
178-
CLN_VERSION: ${{ env.CLN_VERSION }}
179-
timeout: 6m
180-
181139
run-unit-tests:
182140
runs-on: ubuntu-latest
183141
name: Run unit tests

cln/custom_msg_client.go

Lines changed: 0 additions & 187 deletions
This file was deleted.

cln_plugin/cln_messages.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,3 @@ type LogNotification struct {
115115
Level string `json:"level"`
116116
Message string `json:"message"`
117117
}
118-
119-
type CustomMessageRequest struct {
120-
PeerId string `json:"peer_id"`
121-
Payload string `json:"payload"`
122-
}

cln_plugin/cln_plugin.go

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const (
2828
var (
2929
DefaultSubscriberTimeout = "1m"
3030
DefaultChannelAcceptorScript = ""
31-
LspsFeatureBit = "0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
3231
)
3332

3433
const (
@@ -152,30 +151,6 @@ func (c *ClnPlugin) htlcListenServer() {
152151
}
153152
}
154153

155-
// Listens to responses to custommsg requests from the grpc server.
156-
func (c *ClnPlugin) custommsgListenServer() {
157-
for {
158-
select {
159-
case <-c.ctx.Done():
160-
return
161-
default:
162-
id, result := c.server.ReceiveCustomMessageResponse()
163-
164-
// The server may return nil if it is stopped.
165-
if result == nil {
166-
continue
167-
}
168-
169-
serid, _ := json.Marshal(&id)
170-
c.sendToCln(&Response{
171-
Id: serid,
172-
JsonRpc: SpecVersion,
173-
Result: result,
174-
})
175-
}
176-
}
177-
}
178-
179154
func (c *ClnPlugin) processRequest(request *Request) {
180155
// Make sure the spec version is expected.
181156
if request.JsonRpc != SpecVersion {
@@ -211,8 +186,6 @@ func (c *ClnPlugin) processRequest(request *Request) {
211186
})
212187
case "setchannelacceptscript":
213188
c.handleSetChannelAcceptScript(request)
214-
case "custommsg":
215-
c.handleCustomMsg(request)
216189
default:
217190
c.sendError(
218191
request.Id,
@@ -261,7 +234,6 @@ func (c *ClnPlugin) handleGetManifest(request *Request) {
261234
},
262235
Dynamic: false,
263236
Hooks: []Hook{
264-
{Name: "custommsg"},
265237
{Name: "htlc_accepted"},
266238
{Name: "openchannel"},
267239
{Name: "openchannel2"},
@@ -270,9 +242,6 @@ func (c *ClnPlugin) handleGetManifest(request *Request) {
270242
Subscriptions: []string{
271243
"shutdown",
272244
},
273-
FeatureBits: &FeatureBits{
274-
Node: &LspsFeatureBit,
275-
},
276245
},
277246
})
278247
}
@@ -405,9 +374,8 @@ func (c *ClnPlugin) handleInit(request *Request) {
405374
return
406375
}
407376

408-
// Listen for htlc and custommsg responses from the grpc server.
377+
// Listen for htlc responses from the grpc server.
409378
go c.htlcListenServer()
410-
go c.custommsgListenServer()
411379

412380
// Let cln know the plugin is initialized.
413381
c.sendToCln(&Response{
@@ -466,25 +434,6 @@ func (c *ClnPlugin) handleSetChannelAcceptScript(request *Request) {
466434
})
467435
}
468436

469-
func (c *ClnPlugin) handleCustomMsg(request *Request) {
470-
var custommsg CustomMessageRequest
471-
err := json.Unmarshal(request.Params, &custommsg)
472-
if err != nil {
473-
c.sendError(
474-
request.Id,
475-
ParseError,
476-
fmt.Sprintf(
477-
"Failed to unmarshal custommsg params:%s [%s]",
478-
err.Error(),
479-
request.Params,
480-
),
481-
)
482-
return
483-
}
484-
485-
c.server.SendCustomMessage(idToString(request.Id), &custommsg)
486-
}
487-
488437
func unmarshalOpenChannel(request *Request) (r json.RawMessage, err error) {
489438
switch request.Method {
490439
case "openchannel":

cln_plugin/proto/cln_plugin.proto

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ option go_package="github.com/breez/lspd/cln_plugin/proto";
33

44
service ClnPlugin {
55
rpc HtlcStream(stream HtlcResolution) returns (stream HtlcAccepted);
6-
rpc CustomMsgStream(CustomMessageRequest) returns (stream CustomMessage);
76
}
87

98
message HtlcAccepted {
@@ -55,9 +54,3 @@ message HtlcFail {
5554
message HtlcResolve {
5655
string payment_key = 1;
5756
}
58-
59-
message CustomMessageRequest {}
60-
message CustomMessage {
61-
string peer_id = 1;
62-
string payload = 2;
63-
}

0 commit comments

Comments
 (0)