Skip to content

Commit

Permalink
lightningd: remove expermential "sendonionmessage" function.
Browse files Browse the repository at this point in the history
It was only ever expermental, so I don't feel bad about just removing it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: JSON-RPC: `sendonionmessage` (was experimental only, use `injectonionmessage`)
  • Loading branch information
rustyrussell committed Jul 18, 2024
1 parent 91cd689 commit 3c04b6f
Show file tree
Hide file tree
Showing 14 changed files with 343 additions and 758 deletions.
15 changes: 0 additions & 15 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 0 additions & 51 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions cln-grpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2738,38 +2738,6 @@ impl Node for Server

}

async fn send_onion_message(
&self,
request: tonic::Request<pb::SendonionmessageRequest>,
) -> Result<tonic::Response<pb::SendonionmessageResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::SendonionmessageRequest = req.into();
debug!("Client asked for send_onion_message");
trace!("send_onion_message request: {:?}", req);
let mut rpc = ClnRpc::new(&self.rpc_path)
.await
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
let result = rpc.call(Request::SendOnionMessage(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method SendOnionMessage: {:?}", e)))?;
match result {
Response::SendOnionMessage(r) => {
trace!("send_onion_message response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call SendOnionMessage",
r
)
)),
}

}

async fn set_channel(
&self,
request: tonic::Request<pb::SetchannelRequest>,
Expand Down
47 changes: 0 additions & 47 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 0 additions & 77 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -26341,83 +26341,6 @@
}
]
},
"lightning-sendonionmessage.json": {
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "sendonionmessage",
"title": "low-level command to send an onion message",
"warning": "experimental-onion-messages only",
"description": [
"The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices."
],
"request": {
"required": [
"first_id",
"blinding",
"hops"
],
"properties": {
"first_id": {
"type": "pubkey",
"description": [
"The (presumably well-known) public key of the start of the path."
]
},
"blinding": {
"type": "pubkey",
"description": [
"Blinding factor for this path."
]
},
"hops": {
"type": "array",
"description": [
"",
""
],
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"node",
"tlv"
],
"properties": {
"node": {
"type": "pubkey",
"description": [
"Public key of the node."
]
},
"tlv": {
"type": "u8",
"description": [
"Contains a hexadecimal TLV to include."
]
}
}
}
}
}
},
"response": {
"required": [],
"properties": {}
},
"author": [
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
],
"see_also": [
"lightning-fetchinvoice(7)",
"lightning-offer(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>",
"",
"[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md"
]
},
"lightning-sendpay.json": {
"$schema": "../rpc-schema-draft.json",
"type": "object",
Expand Down
1 change: 0 additions & 1 deletion contrib/msggen/msggen/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
"ReserveInputs",
"SendCustomMsg",
"SendInvoice",
"SendOnionMessage",
"SetChannel",
"SetConfig",
"SetPsbtVersion",
Expand Down
692 changes: 343 additions & 349 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

33 changes: 0 additions & 33 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,6 @@ def __init__(self, channel):
request_serializer=node__pb2.SendinvoiceRequest.SerializeToString,
response_deserializer=node__pb2.SendinvoiceResponse.FromString,
)
self.SendOnionMessage = channel.unary_unary(
'/cln.Node/SendOnionMessage',
request_serializer=node__pb2.SendonionmessageRequest.SerializeToString,
response_deserializer=node__pb2.SendonionmessageResponse.FromString,
)
self.SetChannel = channel.unary_unary(
'/cln.Node/SetChannel',
request_serializer=node__pb2.SetchannelRequest.SerializeToString,
Expand Down Expand Up @@ -1102,12 +1097,6 @@ def SendInvoice(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def SendOnionMessage(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def SetChannel(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
Expand Down Expand Up @@ -1724,11 +1713,6 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.SendinvoiceRequest.FromString,
response_serializer=node__pb2.SendinvoiceResponse.SerializeToString,
),
'SendOnionMessage': grpc.unary_unary_rpc_method_handler(
servicer.SendOnionMessage,
request_deserializer=node__pb2.SendonionmessageRequest.FromString,
response_serializer=node__pb2.SendonionmessageResponse.SerializeToString,
),
'SetChannel': grpc.unary_unary_rpc_method_handler(
servicer.SetChannel,
request_deserializer=node__pb2.SetchannelRequest.FromString,
Expand Down Expand Up @@ -3315,23 +3299,6 @@ def SendInvoice(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def SendOnionMessage(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/cln.Node/SendOnionMessage',
node__pb2.SendonionmessageRequest.SerializeToString,
node__pb2.SendonionmessageResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def SetChannel(request,
target,
Expand Down
5 changes: 0 additions & 5 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -1874,11 +1874,6 @@ def sendinvoice2py(m):
})


def sendonionmessage2py(m):
return remove_default({
})


def setchannel_channels2py(m):
return remove_default({
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
Expand Down
1 change: 0 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
doc/lightning-sendcustommsg.7 \
doc/lightning-sendinvoice.7 \
doc/lightning-sendonion.7 \
doc/lightning-sendonionmessage.7 \
doc/lightning-sendpay.7 \
doc/lightning-sendpsbt.7 \
doc/lightning-setchannel.7 \
Expand Down
1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ Core Lightning Documentation
lightning-sendcustommsg <lightning-sendcustommsg.7.md>
lightning-sendinvoice <lightning-sendinvoice.7.md>
lightning-sendonion <lightning-sendonion.7.md>
lightning-sendonionmessage <lightning-sendonionmessage.7.md>
lightning-sendpay <lightning-sendpay.7.md>
lightning-sendpsbt <lightning-sendpsbt.7.md>
lightning-setchannel <lightning-setchannel.7.md>
Expand Down
Loading

0 comments on commit 3c04b6f

Please sign in to comment.