Skip to content

Conversation

@jstuczyn
Copy link
Contributor

@jstuczyn jstuczyn commented Oct 27, 2023

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.

@jstuczyn jstuczyn changed the title Feature/forward travel [feat] Enforcing forward travel Oct 27, 2023
@jstuczyn jstuczyn force-pushed the feature/forward-travel branch from ab1e7bf to 4d52c32 Compare October 27, 2023 14:41
@jstuczyn jstuczyn added this to the Galaxy milestone Oct 27, 2023
@jstuczyn jstuczyn self-assigned this Oct 27, 2023
@jstuczyn jstuczyn marked this pull request as ready for review October 30, 2023 09:32
@jstuczyn jstuczyn requested a review from octol as a code owner October 30, 2023 09:32

// \/ ADDED
// enforce forward travel, et al.
..Default::default() // /\ ADDED
Copy link
Contributor

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");
Copy link
Contributor

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

@jstuczyn jstuczyn force-pushed the feature/forward-travel branch from 4d52c32 to a772314 Compare October 31, 2023 14:10
@tommyv1987 tommyv1987 modified the milestones: Galaxy, Rolo Nov 6, 2023
@jstuczyn jstuczyn force-pushed the feature/forward-travel branch from a772314 to 0b9a897 Compare November 21, 2023 15:53
@benedettadavico benedettadavico modified the milestones: Rolo, Reeses Nov 27, 2023
@jstuczyn jstuczyn force-pushed the feature/forward-travel branch from 0b9a897 to c21b015 Compare December 7, 2023 08:59
StorageError(#[from] StorageError),

#[error("Provided bandwidth IV is malformed - {0}")]
#[error("Provided bandwidth IV is malformed: {0}")]
Copy link
Contributor

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");
Copy link
Contributor

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

@mmsinclair
Copy link
Contributor

Replaced by #4360

@mmsinclair mmsinclair closed this Feb 13, 2024
@benedettadavico benedettadavico removed this from the Reeses milestone Feb 13, 2024
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.

6 participants