Commit Graph
1568 Commits
Author SHA1 Message Date
Divma 71b5903e28 chore: increase version numbers and update (#2821)
## Description

increases version numbers for `iroh-base` and `iroh-metrics`, which have
been published, and updates references to them

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-21 17:49:33 +00:00
Asmir Avdicevic 844b1469ba fix(cfg)!: make sure we use correct relays (#2778)
## Description

This takes us back to only relying on the env var for forcing staging
relays. However for tests it should still remain active with the
test/feature combo by default.

## Breaking Changes

- `TEST_DNS_NODE_ORIGIN` is removed
- iroh now defaults to using prod relays unless
`IROH_FORCE_STAGING_RELAYS` is set to a non empty value

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-21 11:06:30 +00:00
Floris Bruynooghe a03a08ef71 docs(iroh-net): Document cfg(test) items as well (#2819)
## Description

It seems the newer rust release enforces missing docs on this as well.


## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-10-21 08:09:49 +00:00
85bd8b7ef0 fix(iroh-net)!: DiscoveredDirectAddrs need to update the timestamp (#2808)
## Description

DiscoverdDirectAddrs has a timestamp of when it was last changed, which
is used to decide if the direct addr information is recent enough to use
in call-me-maybe messages. However when it was updated this timestamp
was not included in the comparison to see if there were changes, so that
watchers would not get updates when the direct addresses did not change.
Unfortunately this meant the timestamp also never updated and the
DiscoveredDirectAddrs was always considered out of date (unless there
were changes in the discovered addresses).

This fixes this by putting only the DirectAddrs in the watcher.

It does a few other improvements:

- Moves all logic about DiscoveredDirectAddrs into one place. This could
be split out to a module now if desired.

- Tidies up the code which creates the DirectAddrs from the portmapper,
netcheck and the local addresses. Again this is just a first pass in
cleaning up this code, there is so much more that could be done.

## Breaking Changes

* `iroh_net::Endpoint::direct_addresses` now returns a stream yielding
Items of `BTreeSet<DirectAddr>` instead of `Vec<DirectAddr>`.
* `iroh_base::node_addr::NodeAddr::from_parts` now takes a `impl
IntoIterator<Item = DirectAddr>` instead of `Vec<DirectAddr>`. But since
`Vec` implements `IntoIterator` that is not really a breaking change.

## Notes & open questions

The crux of this fix is moving from
`Watchable<DiscoveredDirectAddresses>` to
`DiscoveredDirectAddresses::addrs` being `Watchable<Vec<DirectAddr>>`
instead of the whole struct being watchable.

I could split the refactoring of store_direct_addr_update and the
renaming of it's related functions into a separate PR in front of this
bugfix if desired. I had to change that code because of the format
change from `Vec<DirectAddrs>` to `BTreeSet<DirectAddr>` and it was just
way clearer doing it with the refactoring.

As indicated in the (already existing) comments that whole direct
address updating logic can still be more refactored and improved. But
many small steps is how we improve.

I went very opinionated on the imports... apologies.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Asmir Avdicevic <asmir.avdicevic64@gmail.com>
Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
Co-authored-by: Diva M <divma@protonmail.com>
2024-10-18 17:08:57 +00:00
Floris Bruynooghe c82ada5781 refactor(iroh-net): Debug logging should not be per packet set (#2818)
## Description

These are logged for each packet on the relay path.  That's not what
we do on debug logging.  One case is already covered by other trace
logging, so just move the "why", the other case can be a trace log.

## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-10-18 16:18:05 +00:00
Floris Bruynooghe f32f3f9e47 refactor(iroh-net): No portmapper is not a warning (#2816)
## Description

It is normal for there to be no portmapper, there's no point in
logging this as a warning.

## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-10-18 15:28:41 +00:00
Floris Bruynooghe a0ce00e166 refactor(iroh-net): Attach Relay URL to a connecting client span (#2817)
## Description

The client already has a connecting span tying together everything
that is happening for connect.  But it doesn't yet say which relay
this is for.  Add the RelayURL as a span field.

## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-10-18 15:28:23 +00:00
Floris Bruynooghe f08011a559 refactor(iroh-net): Failing to bind is not a Warning log (#2815)
## Description

If the bind is required the call stack already makes sure that this is
surfaced correctly.  It is in fact entirely normal if IPv6 to fail to
bind and this is already logged on INFO level.  We do not need an
additional WARN log for this.

This also doesn't need to debug-log the error, anyhow's alternate
logging mechanism is perfect for this.

## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-10-18 15:27:53 +00:00
Floris Bruynooghe a36970a921 docs(iroh-base): clarify AddrInfoOptions a little (#2813)
## Description

A user did get confused about this, so fair enough.

## Breaking Changes

None

## Notes & open questions

Closes #2802 

Please review my comman use.  I feel entirely incompetent in using
commas.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-10-18 12:43:13 +00:00
Rüdiger KlaehnandFloris Bruynooghe ed903ae0b5 feat(iroh-net): Add helper fn to enable n0 discovery publishing and resolving (#2775)
## Description

Add a helper fn to configure n0 default discovery without having to
resort to having to combine a custom discovery service.

```rust
let secret_key = SecretKey::generate();
let discovery = ConcurrentDiscovery::from_services(vec![
    Box::new(PkarrPublisher::n0_dns(secret_key.clone())),
    Box::new(DnsDiscovery::n0_dns()),
    Box::new(LocalSwarmDiscovery::new(secret_key.public())?),
]);
let ep = iroh_net::Endpoint::builder()
    .secret_key(secret_key)
    .discovery(Box::new(discovery))
    .alpns(vec![EXAMPLE_ALPN.to_vec()])
    .bind()
     .await
```

becomes


```rust
let ep = iroh_net::Endpoint::builder()
    .discovery_n0() // still have to do this to enable discovery!
    .alpns(vec![EXAMPLE_ALPN.to_vec()])
    .bind()
     .await
```

## Breaking Changes

None

## Notes & open questions

Should this be on or off by default?
Does anybody hate the name?
Should we also add fns for "just publish" or "just resolve" that I
frequently need?

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2024-10-18 07:50:28 +00:00
8808a360c9 chore: Format imports using rustfmt (#2812)
## Description

This enables a strict style in rustfmt to format imports statements. It
needs rust nightly for rustfmt to be able to do this.

To not make the `cargo fmt` from stable rust really noisy it does not
add a rustfmt.toml file, instead it adds a `cargo-make` task to automate
running this locally. This same task is used in CI to run the formatter.

The `Crate`m formatting will be preserved by the default configuration
of rust-analyzer, which makes external contributions easier as well,
most folks shouldn't be running into this formatter.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

I guess we need buy-in from everyone on the team for this.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Diva M <divma@protonmail.com>
Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
2024-10-18 01:12:38 +00:00
Floris BruynoogheandPhilipp Krüger af8c474819 docs(iroh-net): Some more example tweaking (#2811)
## Description

This leads the docs with an example, for those poor folks who don't
like text.


## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2024-10-17 14:37:01 +00:00
Rüdiger Klaehn 62e4bd4d83 fix(deps): update postcard to get rid of yanked critical-section (#2810)
## Description

Update postcard to get rid of yanked critical-section dep

## Breaking Changes

None

## Notes & open questions

None

## Change checklist

- [x] Self-review.
- [x] ~~Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- [x] ~~Tests if relevant.~~
- [x] ~~All breaking changes documented.~~
2024-10-17 09:12:06 +00:00
Floris BruynoogheandPhilipp Krüger 39d4bd9c75 docs(iroh-net): Add examples to the module docs (#2785)
## Description

This gives at least some quick indication of how to make things work.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2024-10-16 13:03:43 +00:00
Asmir Avdicevic 1436389177 fix(ci): make sure logs get uploaded on netsim failure (#2807)
## Description

When our netsim jobs fail, we have little visibility into the why of it.
Logs can be inspected manually on the machine but that's really not
convenient. This should make sure logs always get uploaded and attached
to the job.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-16 11:55:49 +00:00
Asmir Avdicevic 9902b2d9f1 fix(ci): netsim does not interact with PR comments on forks (#2777)
## Description

Seems like permissions are still messy and the netsim job fails on forks
whenever it interacts with a PR from a fork, even though it's on our own
repo and we allow it to run.

This simply drops any type of commenting on the PR from a fork.

Need to add back the required check for this job once it's merged.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-15 21:06:14 +00:00
Floris Bruynooghe 234a856eb5 docs(iroh): Enable iroh_docsrs feature (#2780)
## Description

This uses the same iroh_docsrs cfg as the other crates and updates the
preview CI job to also use this.

## Breaking Changes

None

## Notes & open questions

However, the world is a sad place.

As far as I can figure out this all correctly annotates the features in
our docs in the individual crates. That is, `https://docs.rs/iroh-net`
and `https://docs.rs/iroh-gossip` etc. This is also true for the `iroh`
crate. BUT, the iroh crate uses `doc(inline)` on the other crates, and
when using this we can not get the feature annotation in the sub-crates.
Sad times.

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-15 09:29:44 +00:00
Floris Bruynooghe 5e40fe138f deps(iroh-net): Upgrade igd-next, remove hyper 0.14 (#2804)
## Description

This finally removes the last use of a pre-1.0 hyper version,
eliminating our duplicate hyper dependencies.

## Breaking Changes

None

## Notes & open questions

Closes #1863.


## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-15 09:28:54 +00:00
KaseyandDiva M 2d04306a51 fix(iroh-net): use try_send rather than send so we dont block the local swarm discovery service (#2794)
## Description

Using `subscriber.send().await` could block the entire discovery service
if one of the subscribers polls too slow. Change to `try_send` that will
drop the discovery item from that stream if it is closed.

## Notes & open questions

Added a line in the documentation to mention that if you do not poll
enough, you may miss messages.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.

---------

Co-authored-by: Diva M <divma@protonmail.com>
2024-10-07 15:12:01 +00:00
Kasey c349c435f8 refactor: display the socket addr and relay for a ConnectionType::Mixed (#2793)
## Description

Each time a `ConnectionType::Mixed` has a different SocketAddr or
RelayUrl, we correctly resend a `ConnectionType::Mixed` event to
`Endpoint::conn_type_stream`. However, when we print those changes in
something like `iroh doctor`, we only print the name of the connection
type, we don't print the socket address or relay url, so it looke like
we are sending extra `Mixed` events erroneously.

Adding more details to the `Display` of `ConnectionType`, so that it
prints the socket addrs and or relay urls.

## Change checklist

- [x] Self-review.
2024-10-07 14:57:08 +00:00
Floris Bruynooghe 43f5fed7e1 fix(iroh-net): Emit the call-me-maybe.sent event in all cases (#2792)
## Description

When the call-me-maybe is queued this event was not being emitted.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-07 14:48:42 +00:00
Divma 75d801933c deps(*): update futures-util (#2790)
## Description

updates the dep to a non yanked version

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-07 12:13:13 +00:00
Floris Bruynooghe ab3afef703 docs(iroh-net): Add examples to discovery (#2786)
## Description

This at least documents how to do the normal setup for discovery.


## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-04 14:42:24 +00:00
Floris BruynoogheandAsmir Avdicevic 730f71736e tests(iroh): Mark test_blob_delete_mem as flaky (#2784)
## Description

Only observed on windows, probably because this machine is always
slower and triggers some race condition easier.  We can change this to
be flaky everywhere if we notice it happening on other platforms too.

See #2783.


## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- [x] Tests if relevant.
- ~~[ ] All breaking changes documented.~~

Co-authored-by: Asmir Avdicevic <asmir.avdicevic64@gmail.com>
2024-10-04 09:06:33 +00:00
Floris Bruynooghe 12f74e2a9a feat(iroh-net): Log the crate version number (#2746)
## Description

This adds a DEBUG-level log logging the crate version number.

## Breaking Changes

None

## Notes & open questions

This is not the first log message appearing, the MagicSock and a few
other pieces already have been logging by this time.  Also I'm not
particularly bound to this wording.  Maybe there are other things that
should be added to this line?

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-04 08:31:39 +00:00
Floris Bruynooghe 383f1f9cb3 fix(iroh-net): Keep the relay connection alive on read errors (#2782)
## Description

When the connection to the relay server fails the read channel will
return a read error. At this point the ActiveRelay actor will passively
wait until it has been asked to send something again before it will
re-establish a connection.

However if the local node has no reason to send anything to the relay
server, the connection is never re-established. This is problematic when
the relay has remote nodes trying to send to this node. This doubly
problematic when the connection is to the home relay: the node just sits
there thinking everything is healty and quiet, but no traffic is
reaching it.

In a node with active traffic this doesn't really show up, since a send
will be triggered quickly for an active connection and the connection
with the relay server would be re-established.

The start of the ActiveRelay run loop is the right place for this. A
read error triggers the loop to go round, logs a read error already and
then re-estagblishes the connection.

This does not keep the relay connection open forever. The mechanism that
is cleans up
unused connections to relay servers will still function correctly since
this only takes
the time something was last sent to a relay server into account. As long
as a connection
with a remote node exists there will be a DISCO ping between the two
nodes over the relay
path, so the connection is correctly kept alive. The home relay is
exempted from the
relay connection cleanup so is also kept connected, leaving this node
available to be
contacted via the relay server. Which is the entire point of this
bugfix.

The relay_client.is_connected() call sends a message to the relay Client
actor, and relay_client.connect() does that again. Taking the shortcut
to only call .connect() however is not better because the logging
becomes messier. In the common case there is one roundrip-message to the
relay Client actor and this would not improve anyway. The two messages
for the case where a reconnect is needed does not occur commonly.

## Breaking Changes

None

## Notes & open questions

Fixes https://github.com/fishfolk/bones/issues/428

It is rather difficult to test though.

This targets #2781 as base.

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-04 07:29:11 +00:00
Floris BruynoogheandDivma c7ac982bd6 refactor(iroh-net): Optimise present nodes in ActiveRelay (#2781)
## Description

The ActiveRelay actor keeps track of which remote nodes are present on
the relay connection so that we can optimise relay connections to remote
nodes. This does two main optimisations:

- There were two sets of these nodes kept, they could easily be unified.

- The set is best stored in a BTreeSet since they are simple NodeIds
stored in them.

- Bonus: rename peer to node to match our naming convention.

- Bonus: identify nodes by NodeId since this is a routing key here.

## Breaking Changes

Still none if all is well.

## Notes & open questions

This targets #2779 as base.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~

---------

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
2024-10-03 17:58:47 +00:00
Floris BruynoogheandDivma 6b1186fe16 refactor(iroh-net): Keep connection name, remove connection count (#2779)
## Description

These are two cleanups in the relay client:

- The `relay::Client` hands out a connection object when asked to
  connect.  This `Conn` was imported with rename to `RelayClient`
  which was a bit confusing as this was already the relay client.  It
  is now left at it's original name which makes a lot more sense.  The
  related builder struct etc are renamed to match.

- The `relay::Client` had a counter for the number of connections made
  to the relay.  That seems fun, but was entirely unused.  If this is
  a useful thing to have it should probably be a counter metric
  instead but let's not add anything that no one is using.  Removing
  this makes a lot of APIs a bit simpler and removes some state
  tracking.

## Breaking Changes

None hopefully, please let this all  be internal APIs.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- ~~[ ] All breaking changes documented.~~

---------

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
2024-10-03 17:30:46 +00:00
Rüdiger Klaehn bd5e4fa1aa feat(iroh-net)!: Allow using a NodeId directly in connect. (#2774)
## Description

Allow using anything can be converted to a NodeAddr when connecting.
This means that we can directly connect with NodeIds, and
connect_by_node_id is no longer needed.

Also deprecate connect_by_node_id since it is no longer needed.

## Breaking Changes

- iroh-net: Endpoint::connect now takes an `impl Into<NodeAddr>` instead
of a `NodeAddr`
- iroh-net: Endpoint::connect_by_node_id is deprecated (to be removed
next release)

## Notes & open questions

Note: Doing this means that the instrumentation of connect no longer
contains the remote, which is bad I guess. Not sure how to work around
this. One way would be to have connect and connect_impl - connect_impl
is like the current connect and can be instrumented as before. Any other
way to do this?

Note: since there is a From<NodeTicket> for NodeAddr, you can also
directly dial using a ticket, which is kinda neat.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [x] All breaking changes documented.
2024-10-02 15:18:30 +00:00
Dezhi Wu 73ca58ad60 docs(relay): fix typos in map.rs (#2773)
## Description

Just some typos fix.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-02 09:44:04 +00:00
Floris Bruynooghe f536789385 refactor(iroh-base)!: No Result for creating new NodeTicket (#2771)
## Description

There is no need for this to have a Result.  Also there's a From impl
anyway.  So clean this up.

## Breaking Changes

`NodeTicket::new` no longer returns `Result` but always succeeds (as
it already did).  This matches it's `From<NodeAddr>` impl which also
never fails.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-01 21:03:04 +00:00
Floris Bruynooghe 4d41a69511 docs(*): Document cargo features in docs (#2761)
## Description

This adds the features needed for an API to the generated docs for the
remaining workspace crates.  Only the iroh crate itself does not yet
document this.

## Breaking Changes

none

## Notes & open questions

I can for the life of me not get this to work for the iroh crate
itself...  No idea why.  Feel free to give it a try.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-01 16:50:44 +00:00
Floris Bruynooghe 66549bf5ac refactor(iroh-net): Add tracing span context to spawned tasks (#2769)
## Description

This spawned task was missing tracing span context.  We should always
call .instrument().

## Breaking Changes

None

## Notes & open questions

I wish this wouldn't be such a manual thing.  I guess we could create
a spawn API that always does this, but even then we have to remember
to use that API and not this one.  You could probably do something
with linting for not allowing some APIs.  Anyway, not now.

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-01 16:49:27 +00:00
Floris Bruynooghe d514859ff2 refactor(iroh-net): log the pkarr relay when publishing (#2770)
## Description

That makes the log message so much more useful

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-01 16:47:30 +00:00
Floris Bruynooghe e9f98a65ff feat(iroh-net): Export the Ticket trait (#2765)
## Description

This exports the Ticket trait, which is kind of needed to work with
the NodeTicket.  Since NodeTicket is already provided directly in
iroh-net it is very strange to force users to pull in iroh-base to get
the ticket trait.

Also updates the docs of tickets a little.

## Breaking Changes

None

## Notes & open questions

None

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-10-01 14:43:57 +00:00
Asmir Avdicevic 97be9e3977 fix(ci): netsim commenting fixes (#2766)
## Description

Adjusts permissions, uses proper input vars & the search & replace for
comments is now aligned.
Also adds examples to the list of possible executables for the job.

Note: Docs still seem to fail in this PR with the set permissions.
However write-all in a public repo is very constrained so it should be
perfectly fine. The GITHUB_TOKEN has it by default, however I think
since we're running sub jobs etc it's not propagating correctly.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-01 12:02:23 +00:00
Asmir Avdicevic 8420674b32 fix(ci): add cleanup workflow to retain generated-docs-preview for only the last 25 PRs (#2758)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-10-01 09:20:29 +00:00
dependabot[bot] 70367b7841 chore(deps): bump mozilla-actions/sccache-action from 0.0.5 to 0.0.6 in the github-actions group (#2763)
Bumps the github-actions group with 1 update:
[mozilla-actions/sccache-action](https://github.com/mozilla-actions/sccache-action).

Updates `mozilla-actions/sccache-action` from 0.0.5 to 0.0.6
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/mozilla-actions/sccache-action/releases">mozilla-actions/sccache-action's
releases</a>.</em></p>
<blockquote>
<h2>v0.0.6</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: string interpolation by <a
href="https://github.com/i10416"><code>@​i10416</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/122">Mozilla-Actions/sccache-action#122</a></li>
<li>Keep GitHub Actions up to date with GitHub's Dependabot by <a
href="https://github.com/cclauss"><code>@​cclauss</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/131">Mozilla-Actions/sccache-action#131</a></li>
<li>fix: avoid downloading package when local cache exists by <a
href="https://github.com/i10416"><code>@​i10416</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/123">Mozilla-Actions/sccache-action#123</a></li>
<li>Set baseUrl for Octokit to make it work on GitHub Enterprise Server
by <a href="https://github.com/palloberg"><code>@​palloberg</code></a>
in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/144">Mozilla-Actions/sccache-action#144</a></li>
</ul>
<h2>dependencies</h2>
<ul>
<li>Bump eslint-plugin-jest from 28.5.0 to 28.6.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/130">Mozilla-Actions/sccache-action#130</a></li>
<li>Bump ts-jest from 29.1.4 to 29.2.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/134">Mozilla-Actions/sccache-action#134</a></li>
<li>Bump <code>@​types/node</code> from 20.13.0 to 20.14.11 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/133">Mozilla-Actions/sccache-action#133</a></li>
<li>Bump <code>@​typescript-eslint/eslint-plugin</code> from 7.8.0 to
7.16.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/132">Mozilla-Actions/sccache-action#132</a></li>
<li>Bump typescript from 5.4.5 to 5.5.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/128">Mozilla-Actions/sccache-action#128</a></li>
<li>Bump ts-jest from 29.2.2 to 29.2.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/141">Mozilla-Actions/sccache-action#141</a></li>
<li>Bump eslint-plugin-prettier from 5.1.3 to 5.2.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/140">Mozilla-Actions/sccache-action#140</a></li>
<li>Bump prettier from 3.3.2 to 3.3.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/136">Mozilla-Actions/sccache-action#136</a></li>
<li>Bump typescript from 5.5.3 to 5.6.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/145">Mozilla-Actions/sccache-action#145</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/i10416"><code>@​i10416</code></a> made
their first contribution in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/122">Mozilla-Actions/sccache-action#122</a></li>
<li><a href="https://github.com/cclauss"><code>@​cclauss</code></a> made
their first contribution in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/131">Mozilla-Actions/sccache-action#131</a></li>
<li><a href="https://github.com/palloberg"><code>@​palloberg</code></a>
made their first contribution in <a
href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/144">Mozilla-Actions/sccache-action#144</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Mozilla-Actions/sccache-action/compare/v0.0.5...v0.0.6">https://github.com/Mozilla-Actions/sccache-action/compare/v0.0.5...v0.0.6</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/9e326ebed976843c9932b3aa0e021c6f50310eb4"><code>9e326eb</code></a>
prepare version 0.0.6</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/922a306e477207a637defe7f052d22883f0521d0"><code>922a306</code></a>
Merge pull request <a
href="https://redirect.github.com/mozilla-actions/sccache-action/issues/145">#145</a>
from Mozilla-Actions/dependabot/npm_and_yarn/typescri...</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/2be75915275437bf5de79b87f98872a4f2f8c827"><code>2be7591</code></a>
Merge pull request <a
href="https://redirect.github.com/mozilla-actions/sccache-action/issues/136">#136</a>
from Mozilla-Actions/dependabot/npm_and_yarn/prettier...</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/d707076e63cf36f9ad5b2c698f70fa41064cd1c5"><code>d707076</code></a>
Bump prettier from 3.3.2 to 3.3.3</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/afb5895f805bd94d7c9879fdf5e616b6d5b7001d"><code>afb5895</code></a>
Bump typescript from 5.5.3 to 5.6.2</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/f42f2ce8fa7c63696e83e23aae0f1d29af697dcb"><code>f42f2ce</code></a>
Merge pull request <a
href="https://redirect.github.com/mozilla-actions/sccache-action/issues/140">#140</a>
from Mozilla-Actions/dependabot/npm_and_yarn/eslint-p...</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/ff4a61d6e6d18f1dbc1ada2764f6a53469f12ac3"><code>ff4a61d</code></a>
Merge pull request <a
href="https://redirect.github.com/mozilla-actions/sccache-action/issues/144">#144</a>
from palloberg/set-baseurl</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/e073bd0f5c2a1b383ffaee047ebfe0d6369abca2"><code>e073bd0</code></a>
Update README with instructions on GHES usage.</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/4a60710ed8ed21c21c93b7aa3509f4d0a145aaa7"><code>4a60710</code></a>
Set baseUrl for Octokit to make it work on GitHub Enterprise Server</li>
<li><a
href="https://github.com/Mozilla-Actions/sccache-action/commit/1ff3075b6095ae29758d1a19a53d0580fd89ad3a"><code>1ff3075</code></a>
Bump ts-jest from 29.2.2 to 29.2.5 (<a
href="https://redirect.github.com/mozilla-actions/sccache-action/issues/141">#141</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/mozilla-actions/sccache-action/compare/v0.0.5...v0.0.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mozilla-actions/sccache-action&package-manager=github_actions&previous-version=0.0.5&new-version=0.0.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-01 09:41:17 +02:00
Kasey 01c2bac57c chore: Release v0.26.0 2024-09-30 13:31:38 -04:00
Floris Bruynooghe 5d92f49891 docs(iroh-net): Document cargo features needed for APIs (#2759)
## Description

This uses the feature of docs.rs to enable showing which cargo
features need to be enabled for APIs.  This is much friendlier for
users.

## Breaking Changes

None

## Notes & open questions

I'm trying to do this for the entire workspace but for some reason am
not getting this to work on other crates yet.  This is all such a
mystery and mess.  Just get this in stable rust already and do this by
default without needing extra annotations.

I'll try and do the rest of the workspace still in a followup PR, but
at least this might make the release so we get to see if it works on
actual docs.rs as well.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~
2024-09-30 14:47:16 +00:00
Divma 253f4f1099 feat(iroh): Allow setting a custom quinn::TransportConfig (#2760)
## Description

Allows setting a custom configuration in the Iroh Node

## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] ~Tests if relevant.~
- [ ] ~All breaking changes documented.~
2024-09-30 14:21:34 +00:00
Floris BruynoogheandFranz Heinzmann a0a8d56963 docs(iroh-net): Improve pkarr discovery docs (#2722)
## Description

This tries to improve the pkarr discovery docs by trying to describe
enough about how it works that users do not need to go looking
elsewhere.

## Breaking Changes

none

## Notes & open questions

There are so many code overlaps and naming inconsistencies here. But
this was
part of docs friday so I'm just documenting things for now.

- Discovery mechanisms are not named particularly consistent:
- `PkarrPublisher` is probably a `PkarrRelayPublisher`
- `PkarrResolver` is also a `PkarrRelayResolver`
- `DnsDiscovery` only does resolving -> `DnsResolver`
- `DhtDiscovery` can also use relay server, but at least it does both
publish and resolve
- The `DhtDiscovery` is pretty generic, it can probably be made to do
both replace `PkarrResolver` and `PkarrPublisher`, maybe with custom
constructors.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- ~~[ ] All breaking changes documented.~~

---------

Co-authored-by: Franz Heinzmann <frando@unbiskant.org>
2024-09-30 13:12:52 +00:00
Friedel ZiegelmayerandAsmir Avdicevic 33dc559a52 feat(iroh)!: make blobs::read_at more flexible (#2756)
Introduces `ReadAtLen` which allows to specify the behaviour of
`read_at` more closely

- `All` - reads until the end (formerly `None`)
- `Exact(size)` - Reads exactly this many bytes (formerly `Some(size)`
- `AtMost(size)` - Reads at most this many bytes, but allows for a
shorter response if not enough data is available

Closes #2738

## Breaking Changes

- `iroh::client::Blobs::read_at` and `read_at_to_bytes` now take
`ReadAtLen` instead of `Option<usize>`

---------

Co-authored-by: Asmir Avdicevic <asmir.avdicevic64@gmail.com>
2024-09-30 13:07:12 +00:00
Asmir Avdicevic 09532632b3 fix(ci): make netsim work on forks (#2757)
## Description

Simply skips the troublesome step if it's not configured properly (due
to missing org secrets).

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-09-30 12:19:42 +00:00
Philipp KrügerandFriedel Ziegelmayer 90fd6f04ec feat(iroh-cli): improve ergonomics of iroh gossip subscribe CLI cmd (#2751)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

Previously the gossip command could be confusing:
```sh
$ iroh gossip subscribe test --start
error: invalid value 'test' for '[BOOTSTRAP]...': decoding: base32: non-zero trailing bits at 3
```

Now, the output is more helpful:
```sh
$ iroh gossip subscribe test --start
error: the following required arguments were not provided:
  <--topic <TOPIC>|--raw-topic <RAW_TOPIC>>

Usage: iroh gossip subscribe --start <--topic <TOPIC>|--raw-topic <RAW_TOPIC>> <BOOTSTRAP>...

For more information, try '--help'.
```

And the help text also contains examples & explanation on how the
command works.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
None. The command still works the same way.

## Notes & open questions

Closes #2698

Should we rename the command? When I read `gossip subscribe` initially,
I thought a `gossip publish` command may be missing. But actually
`gossip subscribe` does both.
Perhaps `gossip join` may be better?
But also: We want to keep the CLI names in sync with the names in the
code API. Perhaps we should rename the API call to be `join` instead of
`subscribe`? Or perhaps something like `open_topic`?
Anyhow - perhaps that's food for thought & another PR.


## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2024-09-30 08:51:29 +00:00
Friedel Ziegelmayer eb4c4a6beb feat(iroh): disable docs by default (#2748)
## Breaking Changes

- removed: `iroh::node::Builder::disable_docs`
- added: `iroh::node::Builder::enable_docs`
- by default `iroh::node::Node::memory` & `persistent` have docs
disabled
2024-09-30 08:46:51 +00:00
Asmir Avdicevic 443139d4b6 refactor(ci): redo netsim CI (#2737)
## Description

Refactors the CI jobs for netsim. Groups it to a single parametrized
runner job which is also now a callable workflow.
Makes use of the new parallel runners and also has a quick job for just
testing perf.

## Breaking Changes

Removing the `/netsim` comment commands in favor of running it from the
actions menu.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
2024-09-29 12:26:10 +00:00
06c0844592 feat(iroh-net)!: add subscribe method to Discovery trait (#2656)
## Description

Adds a `subscribe` method to the `Discovery` trait that returns an
`Option<BoxStream>`. The `subscribe` method will send `DiscoveryItems`
each time the discovery service discovers a remote node.

The magicsock is now subscribed to the discovery service and updates the
internal address book each time it receives a `DiscoveryItem`. The
source is marked as `Source::Discovery{ service: String }` and the
`Instant` that the magicsock received the information.

Users can now filter their list of `RemoteInfo`s for sources.

## Breaking Changes

- struct `RemoteInfo` now has field `sources`, which is a `Vec` of
`(iroh::net::endpoint::Source, Duration)`. The `Source` is how we heard
about the remote, and the `Duration` is how long ago we heard about it.
The `sources` field is ordered from the first time we heard about the
remote node to the most recent time we learned about the remote node, in
this session.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Kasey Huizinga <ramfox@Kaseys-MBP.lan>
Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2024-09-27 17:28:46 +00:00
Philipp KrügerandDiva M 25c830574d fix(examples): Make collection-provide, hello-world-provide and rpc work again (#2749)
## Description

They were broken, because
- we changed `.share` to default to a node-id-only ticket and
- `node.shutdown().await` doesn't wait for Ctrl+C anymore, instead it
immediately shuts down the node.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
None

## Notes & open questions

I basically restored the examples original behavior.
It's an open question whether we want to simplify the examples by making
the tickets node-id-only.

Also: Testing. Not sure if we can/should. Ideas welcome! (To prevent
this from happening again.)

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.

---------

Co-authored-by: Diva M <divma@protonmail.com>
2024-09-26 20:07:58 +00:00
Philipp Krüger 857e513134 fix(iroh-blobs): Remove debugging logs & more cleanup (#2690)
## Description

More stuff to clean up I came across while trying to debug an issue.
Also, this makes it so that errors from `iroh_blobs::get::db::get_blob`
that happen *before* the `get_conn` step get printed.
<!-- A summary of what this pull request achieves and a rough list of
changes. -->

## Breaking Changes

None.
<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->
I decided to just remove the tracing logs in `downloader/progress.rs`.
They never really helped us surface the bug, they mostly polluted the
logs, to be honest.
The only thing they surfaced was that we didn't properly clean up
`TransferState::progress_id_to_blob` when there's an error in
`iroh_blobs::get::db::get_blob` that causes us to not send the
`DownloadProgress::Done` event.

## Change checklist

- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.
2024-09-26 15:25:31 +00:00