Include the node_id of channel peers in payment events
#3243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When scoring peers, we don't really care about individual channels but rather about the peer itself, who is identified by its
node_id. We update payment events to include thenode_idof our channel peer, to make it easier to compute statistics about each of our peers.We also rework the events in
PaymentEvents.scalato be more consistent now that we've added support for trampoline, splicing, liquidity ads and on-the-fly funding, which are all the features we had planned that can impact peer scoring.Note that we don't yet update the schema of the
AuditDb, which means that some of the data isn't stored and is currently filled with a dummy value. We will include all updates to the DB schema in a future PR and will fix this.Reviewers should start with
PaymentEvents.scala: the event should now be more consistent and cleaner. Then all changes are only there to ensure that we correctly provideremote_node_ids and correctly create the updated events with the right data.