-
Notifications
You must be signed in to change notification settings - Fork 264
[feat] Enforcing forward travel #4069
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
Conversation
ab1e7bf to
4d52c32
Compare
|
|
||
| // \/ ADDED | ||
| // enforce forward travel, et al. | ||
| ..Default::default() // /\ ADDED |
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.
hmm ... can we get away with this? is all that conversion code in my PR not needed?
| // However, in that case we wouldn't be able to return an error message to the client | ||
| if !self.inner.allowed_egress.is_allowed(next_hop.ip()) { | ||
| // TODO: perhaps this should get lowered in severity? | ||
| warn!("received an packet that was meant to get forwarded to {next_hop}, but this address does not belong to any node on the next layer - dropping the packet"); |
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.
yeah I'm leaning towards info
4d52c32 to
a772314
Compare
a772314 to
0b9a897
Compare
0b9a897 to
c21b015
Compare
| StorageError(#[from] StorageError), | ||
|
|
||
| #[error("Provided bandwidth IV is malformed - {0}")] | ||
| #[error("Provided bandwidth IV is malformed: {0}")] |
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.
Since you're touching all strings, change to lowercase for first letter :)
| Ok((socket, remote_addr)) => { | ||
| if !self.allowed_ingress.is_allowed(remote_addr.ip()) { | ||
| // TODO: perhaps this should get lowered in severity? | ||
| warn!("received an incoming connection from {remote_addr}, but this address does not belong to any node on the previous layer - dropping the connection"); |
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.
yeah I think let's use INFO, since nothing is going wrong from the operators perspective. I'd imagine most operators run their nodes with RUST_LOG=warn and are only interested in stuff they need to be aware of
|
Replaced by #4360 |
Description
NC-112
This pull request introduces a currently optional feature for mixnodes and gateways for enforcing forward travel of mix packets. What it means is that, when enabled, nodes will refuse to accept connections from nodes that are not on the previous layer. Similarly, they will not forward any packets to nodes that are not on the next layer.
One question is whether we should perhaps enable it already by default or leave it optional and keep it in our back pocket for later.
Note that this is a naive implementation with bunch of limitations, but it's imo a good starting point.