Commit Graph
1177 Commits
Author SHA1 Message Date
Lee Smet e5ce09545b Manually implement absorb_second in RouterInner
This allows us to avoid a clone on the routelist Arc.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-17 09:58:18 +02:00
Lee Smet e6c5990b89 Update RoutingTableIterMut to use regular reference
Rather than using Rc<Refcell<..>>, use a &mut directly internally

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-16 18:07:46 +02:00
Lee Smet 817907630f Don't use Iterator for RoutingTableIterMut
Instead use a manual `next` method and iterate using `while let Some(...)`.
We can then return items with lifetimes, which allows us to reduce the
internal complexity of the structs.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-16 15:14:22 +02:00
Lee Smet 7d2a1cbdbe Improve source table contention
Rewrite the loops which send updates to peers, to create the update
first, apply it to the source table, then loop over the peers. This is
an improvement on the old behavior where updaing the source table was
part of sending to a peer, which lead to a lot of redundant updates to
the source table, and missing entries in case there were only 1 or 2
peers.

Closes #232
Fixes #322

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-16 14:39:04 +02:00
Lee Smet 1a01bf8247 Continue processing expired route keys
Instead of returning, we need to continue the loop

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-15 17:28:27 +02:00
Maxime Van Hees cb2e1b88e6 Fix indentation 2024-07-15 16:10:37 +02:00
Maxime Van Hees d5d879f878 disabling quic protocol rework 2024-07-15 16:10:37 +02:00
Maxime Van Hees 3e76455e35 first step towards option to disable quic protocol to find peers 2024-07-15 16:10:37 +02:00
Lee Smet 30dcc7f3d3 Add metric for updates denied by filters
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-12 15:22:22 +02:00
Maxime Van Hees ca4792f247 added nu-ansi-term feature 2024-07-12 14:59:30 +02:00
Maxime Van Hees d4c8e73611 moved LICENSE.rtf file + changed installer script to reflect new location 2024-07-12 14:59:30 +02:00
Maxime Van Hees f0f901b93c moved config example file to root dir + changed wix file to reflect that change 2024-07-12 14:59:30 +02:00
Maxime Van Hees 647522aa4c Windows installer now creates a default configuration file in C:\Users\Gebruiker\AppData\Roaming 2024-07-12 14:59:30 +02:00
Maxime Van Hees f9bc18b386 Updated CHANGELOG.md about Windows installer 2024-07-12 14:59:30 +02:00
Maxime Van Hees b0fd7c629b Added github action for MSI build + updated README + added WiX installer files 2024-07-12 14:59:30 +02:00
Maxime Van Hees d50e3cea86 Removed toml crate 2024-07-12 13:10:44 +02:00
Maxime Van Hees bf062ed264 Added all public nodes to example config file 2024-07-12 13:10:44 +02:00
Maxime Van Hees 74a9fb2e81 Config file support for myceliumd-private + slight optimization to merge_configs function 2024-07-12 13:10:44 +02:00
Maxime Van Hees 3d9ad65704 Fixed requested changes 2024-07-12 13:10:44 +02:00
Maxime Van Hees f9e0560990 Moved information from CHANGELOG to README 2024-07-12 13:10:44 +02:00
Maxime Van Hees 1667e71e0b updated mac os config path + updated changelog to reflect changes 2024-07-12 13:10:44 +02:00
Maxime Van Hees 3298c78719 Removed debug println 2024-07-12 13:10:44 +02:00
Maxime Van Hees 65c3c34e0f Platform specific config file location support 2024-07-12 13:10:44 +02:00
Maxime Van Hees 0ab40a7593 no_tun and disable_peer_disovery support in config file 2024-07-12 13:10:44 +02:00
Maxime Van Hees 5a103b7fca start mycelium with configuration file 2024-07-12 13:10:44 +02:00
Lee Smet f96cce9c70 Immediately remove expired unselected routes
There is no point in keeping an expired route, which is not selected, as
part of the fallback routes with infinite metric. Either there was no
selected route, so it can be removed, or the selected route got
retracted in which case that already caused a retraction to be sent.

Closes #330

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-11 15:47:28 +02:00
Lee Smet 81b44f9ddc Don't refresh route timer on unfeasible update
If an update is unfeasible, apply it as per the spec but don't update
the route timer. The main reason unfeasible routes are kept, is because
"it migh become feasible in the future". In our case, since we use
reliable transports (for protocol messages), and we send a seqno request
when a route is lost, we know that if a feasible route exists in one of
our peers, we will get it shortly after a route is lost. Even if we keep
the unfeasible route as fallback route, it won't be selected, and a
seqno request is needed to refresh it. In short, there is functionally
no difference for the route if we keep the unfeasible entry around or
not: a seqno request _must_ be send to a peer in the hopes of getting a
valid route again. All things considered, this changes allows unfeasible
routes to gracefully go out of scope, after which the unfeasible update
will be blocked.

Closes #320
Closes #159

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-10 12:49:22 +02:00
Lee Smet 895eff5616 Split line in CHANGELOG.md to adhere to line length
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-10 11:26:08 +02:00
Lee Smet 7682bc60c2 Skip route selection after unfeasible route update
If an unfeasible update is applied to an existing, unselected route, we
now skip route selection altogether. Since the route is not selected,
it can obviously not be unselected, and selecting it won't be possible
since its now not feasible.

By immediately returning we also can't notify downstream peers which
have sent a seqno request for this combination. This is fine, since if
there is an outstanding request for this seqno, considering it is
unfeasible, it won't be of interest to the downstream peer. Note that if
the seqno request triggered a bump of the route seqno, the _first_ update
is always feasible.

Also expose a metric value to track how often we just skip route
selection.

Closes #329

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-10 11:17:32 +02:00
Lee Smet 33730dbda9 Update binary lockfiles
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-09 10:45:25 +02:00
dependabot[bot] 58eab5f6dc Bump serde from 1.0.203 to 1.0.204 in /myceliumd-private
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:42:57 +02:00
dependabot[bot] 9510bd3796 Bump serde from 1.0.203 to 1.0.204 in /myceliumd
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:42:31 +02:00
dependabot[bot] f7a2e1c2ef Bump netdev from 0.29.0 to 0.30.0
Bumps [netdev](https://github.com/shellrow/netdev) from 0.29.0 to 0.30.0.
- [Release notes](https://github.com/shellrow/netdev/releases)
- [Commits](https://github.com/shellrow/netdev/compare/v0.29.0...v0.30.0)

---
updated-dependencies:
- dependency-name: netdev
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:42:01 +02:00
dependabot[bot] 06ea8add68 Bump rustls from 0.23.10 to 0.23.11
Bumps [rustls](https://github.com/rustls/rustls) from 0.23.10 to 0.23.11.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.23.10...v/0.23.11)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:41:41 +02:00
Lee Smet 9c4b7257b6 Move shared secret from RouteEntry to RouteList
This avoids duplication of the field between all RouteEntries in the
same RouteList, which should reduce memory consumption (especially on
public nodes) of the route table.

Closes #321

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-08 15:51:06 +02:00
Florian Klink c2ede66b17 peer_manager: make some variables log fields
This starts using structured logging a bit, causing log messages to
mostly more static strings, and the actual error messages, specific
endpoint addresses etc. be log fields.

This makes it easier to grep for specific log messages, as well as
filter things down for a specific peer.

Code-wise, this is mostly a matter of moving from format-strings
interpolating various variables to actually putting these in front of
the message.

Frequently, we can also avoid writing it out explicitly alltogether:

In `connect_peer` we already have `endpoint`, so we can ask it for
`proto()` and `address()`, and just record it in a span, and it'll be
present in all child log messages - as it's somewhere part of the span
hierarchy and printed by our log formatters.
2024-07-08 14:40:03 +02:00
Florian Klink 0e353cbc72 myceliumd[-private]: add --log-format option
In addition to the previous format "compact", which is the default, this
can be set to "logfmt".

This isn't colorful yet, so `ansi_logs` is not enabled, as we'd only
want that for interactive usage, not when run via a service manager.

There's some amount of duplication between the two CLI entrypoints, but
I was a bit unsure where to put the shared code for tracing setup.
Happy to move this elsewhere too.
2024-07-08 14:28:21 +02:00
Maxime Van Hees a502a79350 Update README.md
Typo

Signed-off-by: Maxime Van Hees <vanheesm@threefold.tech>
2024-07-08 11:38:00 +02:00
Lee Smet 16ab186615 Remove unused selected_mut method
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 14:29:48 +02:00
Lee Smet f7a153f327 Simplify unselecting route after update if needed
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 12:31:20 +02:00
Lee Smet 772b37fd11 Simplify static subnet check
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 12:25:20 +02:00
Lee Smet 459de51493 Use Peer instead of RouteKey in entry_mut
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 11:59:58 +02:00
Lee Smet 906d8f2d85 Add more structured traces
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 11:51:07 +02:00
Lee Smet bb5bcc1089 Change some logs to strucutred traces
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:48:00 +02:00
Lee Smet 17c8d6f468 Use Display impl to log fields in structured log
Where we already use it, use the % sigil to inform tracing we want to
use the display impl of the fields to log them.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:39:22 +02:00
Lee Smet 63e6b62fb7 Add Display impl for SeqnoRequest
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:38:23 +02:00
Lee Smet 5acb0b09d5 Use dedicated unselect method in router
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:20:02 +02:00
Lee Smet 70ddd49053 Remove unused RouteList::entry method
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:19:42 +02:00
Lee Smet c3fd23469f Remove leftover allow(dead_code) module attribute
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:18:53 +02:00
Lee Smet 4b94d05f53 Remove unused IndexMut import
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:18:24 +02:00