Skip to content

Conversation

gavinleroy
Copy link
Contributor

@gavinleroy gavinleroy commented Jul 21, 2022

Hello 👋 , currently one of the guaranteed post-conditions of the Path interface Reverse method is that "if the error return value is nil, then the returned Path is well-formed". This is a general pattern in Go when returning an error value, but especially in the context of the VerifiedSCION project.
In the case of the Epic path's Reverse function, if the type assertion fails, the returned err value would still be nil from the assignment on line 101, seen here.

I would say that this is invalid and propose that a new error should be returned. I simply threw in an error message there, however, I am unconvinced that it is the correct message. Better suggestions are welcome.


This change is Reviewable

Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @gavinleroy)

a discussion (no related file):
Hi @gavinleroy

Thanks for the contribution.
You are absolutely right, this was an oversight.

Cool to see that verification is able to catch these kinds of bugs 👍


Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gavinleroy)

@oncilla oncilla merged commit daf3416 into scionproto:master Jul 21, 2022
benthor pushed a commit to benthor/scion that referenced this pull request Nov 24, 2022
Return an error in epic.Path.Reverse if the reversed path is of the wrong type.
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.

2 participants