Report the sending peer in Event::OnionMessageIntercepted#4682
Conversation
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
|
The previously flagged blocking issue at I re-reviewed the full diff for new issues: the TLV serialization/compat logic (legacy field 0 No new issues found. The stale-comment minor issues at Cross-cutting note (previously raised, not re-flagged): enabling |
TheBlueMatt
left a comment
There was a problem hiding this comment.
thanks. hate changing the api at this point but backporting to 0.3 probably should happen cause its trivial
|
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
e0c7e55 to
41ef2e6
Compare
41ef2e6 to
316a0ce
Compare
Good idea! Done, but needed to rebase. |
TheBlueMatt
left a comment
There was a problem hiding this comment.
two doc nits otherwise LGTM
| /// The node id of the peer that sent the message, if known. | ||
| /// | ||
| /// This is `None` when the forward is enqueued by a message handler (e.g. the BOLT 12 | ||
| /// static-invoice-server flow), which isn't given the sending node. Otherwise it is the |
There was a problem hiding this comment.
Does it make sense to just document it as "message is sent with a MessageSendInstructions::ForwardedMessage rather than forwarded internally in the OnionMessenger"?
There was a problem hiding this comment.
Yeah, though gave an example of which method does that since it might not be apparent to users.
316a0ce to
58e11d0
Compare
Allow integrations to intercept blinded onion-message hops that identify the next node by short channel id, so LSPS-style protocols can resolve those hops out of band instead of dropping the message. Co-Authored-By: HAL 9000
When the OnionMessenger intercepts an onion message to forward, it now reports which peer sent us the message via a new `prev_hop` field, so handlers can apply source-based policy when deciding whether to forward. `prev_hop` is `None` when the forward is enqueued by a message handler (the BOLT 12 static-invoice-server flow), which isn't given the sending node; otherwise it is the node we received the message from. Co-Authored-By: Claude <noreply@anthropic.com>
58e11d0 to
1a0e530
Compare
When the
OnionMessengerintercepts a message bound for an offline peer, it now reports which peer sent us the message to forward via a newprev_node_idfield, so handlers can apply source-based policy when deciding whether to forward. The existing destination field is renamedpeer_node_id->next_node_idso the two node ids are unambiguous.prev_node_idisNonewhen the forward is enqueued by a message handler (the BOLT 12 static-invoice-server flow), which isn't given the sending node; otherwise it is the node we received the message from.