-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snet: PathInterface struct #3879
Conversation
e653717
to
80aec0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 26 of 26 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matzf)
go/cs/segutil/router.go, line 105 at r1 (raw file):
} type path struct {
AFAIU, there is no longer a need for this struct.
Can you maybe elaborate a bit on the plan for this and future PRs?
I assume this is some preparation PR, and then there will be a follow-up that cleans up the uneccessary structs.
Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @oncilla)
go/cs/segutil/router.go, line 105 at r1 (raw file):
I assume this is some preparation PR, and then there will be a follow-up that cleans up the uneccessary structs.
Yup.
In the current state, this is implementation of the Path
interface is still used/needed. This PR only removes the PathInterface
interface type.
The next step will be to combine the sciond
and segutil
implementations of path, i.e. the main part of #3872. This is when I will remove this type here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved
/rebase |
Use a simple struct directly instead of an interface. Contrary to what was implied by code comments, this does not appear to introduce any problematic dependencies.
80aec0e
to
b1f6e98
Compare
Make `snet.PathMetadata` a struct instead of an interface. Analogous to how this was done for `snet.PathInterface` (#3879). The indirection with an interface is simply unnecessary. Making this a struct, will allow to extend the `PathMetadata` struct quite easily: in a next PR, we'll add the latency, bandwidth, geo coordinates etc. from the "static info" beaconing extension (currently, these fields are defined in a shadow copy of `PathMetadata` in `combinator/staticinfo_accumulator.go`). Move `Interfaces` to `snet.PathMetadata`. The `Interfaces` list is available exactly if the other metadata items are available, so it makes sense to bundle these. This requires/brings some changes to `pathpol.PathSet` -- now the pathpol is fed directly with the `snet.PathMetadata` struct. This seems quite natural, as it's conceivable that the path policy would access all the various metadata items in the future. This change also requires some minor adjustments at the call sites for the path policies.
Use a simple struct for
snet.PathInterface
directly instead of an interface.Contrary to what was implied by code comments, this does not appear to
introduce any problematic dependencies.
Contributes to #3872
This change is