Skip to content

sphinx: return error source as integer#37

Merged
Roasbeef merged 1 commit into
lightningnetwork:masterfrom
joostjager:error-source-idx
Jul 3, 2019
Merged

sphinx: return error source as integer#37
Roasbeef merged 1 commit into
lightningnetwork:masterfrom
joostjager:error-source-idx

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

Returning as an integer allows a node to occur in the payment path
multiple times.

Copy link
Copy Markdown
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

How is this better than just using the pubkey as is? If they appear multiple times in the path, then they'll be present multiple times in the payment path's circuit.

Comment thread crypto.go
@joostjager
Copy link
Copy Markdown
Contributor Author

How is this better than just using the pubkey as is? If they appear multiple times in the path, then they'll be present multiple times in the payment path's circuit.

The sender doesn't know whether the failure happened on the first or the second visit of that node.

Comment thread crypto.go
Comment thread crypto.go Outdated
@joostjager
Copy link
Copy Markdown
Contributor Author

@Roasbeef fixup pushed that adds return struct. I still don't think it is good, for the reasons pointed out above. But it is a small change and the most important thing is to expose the index one way or the other.

@joostjager
Copy link
Copy Markdown
Contributor Author

@Roasbeef ptal

Copy link
Copy Markdown
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🧬

Returning as an integer allows a node to occur in the payment path
multiple times.
Copy link
Copy Markdown
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

LGTM, nice change! ✅

Comment thread obfuscation_test.go Outdated
// We should understand the node from which error have been received.
if !bytes.Equal(pubKey.SerializeCompressed(),
errorPath[len(errorPath)-1].SerializeCompressed()) {
if source != len(errorPath) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

definitely makes these comparisons simpler 👍

@Roasbeef Roasbeef merged commit ecc936d into lightningnetwork:master Jul 3, 2019
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.

3 participants