## 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.
## 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.
## 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.
## 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>
## 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.
## 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.
## 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.
## 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.
## 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.
## 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>
## 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>
## 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>
## 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>
## 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.
## 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.
## 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.~~
## 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.~~
## 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>
## 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.
## 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.~~
## 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.
## 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.~~
## 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>
## 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.~~
## 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.~~
## 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>
## 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>
## 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.
## 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.
## 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.~~
## 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.~~
## 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.~~
## 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.~~
## 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.~~
## 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.
## 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.
## 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.~~
## 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>
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>
## 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.
## 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>
## 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.
## 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>
## 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>
## 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.