Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sr25519 support #3

Draft
wants to merge 395 commits into
base: master
Choose a base branch
from

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented May 3, 2024

This can be kept open - just putting this branch in a PR for visibility

Description

Uses tari_crypto to quickly add Schnorr-Ristretto support to libp2p

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

dependabot bot and others added 30 commits March 25, 2024 15:34
This patch applies changes from libp2p/specs#451. In particular, the new defaults are:

- Record Expiration: 48h
- Record Republish Interval: 22h

Closes libp2p#3229.

Pull-Request: libp2p#3230.
To allow merging libp2p#5232
CC @SuperFluffy since you commented on libp2p#4692

Pull-Request: libp2p#5266.
There seems to be a situation when the `Behaviour` and therefore it's `Gateway` is dropped leaving the `tokio` loop to panic.  It has been reported on  sigp/lighthouse#5498, this attempts to fix it.
Cc @dariusc93 can you review this please Darius? Thanks!

Pull-Request: libp2p#5273.
Eligioo and others added 15 commits September 13, 2024 22:33
…ted (libp2p#5597)

## Description
As discovered and described in the issue below, there are situations
where an incoming AutoNAT dial can come from a non-connected peer.
However `resolve_inbound_request` expects that this situation cannot
occur. This PR adds a check upfront and refuses the incoming dial when
no connected peer is found.

Fixes libp2p#5570.
## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

Co-authored-by: João Oliveira <hello@jxs.pt>
## Description

This is done as temporary measure to unblock PR merging as the CI is
currently broken

Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
## Description
by updating:
- `bytes` to 1.7.1, `1.6.0` was
[yanked](https://crates.io/crates/bytes/1.6.0)
- `quinn-proto` to 0.11.8 to address
[RUSTSEC-2024-0373](https://rustsec.org/advisories/RUSTSEC-2024-0373.html)
- thirtyfour-macros to 0.1.11 to remove `proc-macro-error` dependency
and address
[RUSTSEC-2024-0370](https://rustsec.org/advisories/RUSTSEC-2024-0370.html)
Co-authored-by: Darius Clark <dariusc93@users.noreply.github.com>
…med (libp2p#5582)

## Description

Currently, `NewExternalAddrCandidate` events are emitted for every
connections. However, we continue to get this event even when `autonat`
has already confirmed that this address is external. So we should not
continue to advertise the "candidate" event.

## Notes & open questions

We have made the changes in the `swarm` instead of `identify` because it
does not make it necessary to duplicate the `ConfirmedExternalAddr`
vector in the `identify` Behaviour. Moreover, if any future Behaviour
emit `NewExternalAddrCandidate`, the same rule will also be applied.

I had to edit the `autonat_v2` tests which were always expecting a
`NewExternalAddrCandidate` but the address was already confirmed.

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: Darius Clark <dariusc93@users.noreply.github.com>
Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
## Description
By avoiding dialing an external address

Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
## Description

Follow up to libp2p#5604. Interop
tests only work on the main `rust-libp2p` repo, and not on forks,
because of the S3 cache (introduced in
libp2p#5586).

The interop tests currently don't run in the PRs, but they run after the
PRs are merged to `master`. This PR is trying to run interop tests in PR
that are branches of the main repo (not forks).
…ibp2p#5600)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->
Following on issue libp2p#4449 
refactor: use tokio instead of async-std in the relay-servert example
and remove unnecessary dependencies
## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->
Fails on testing with the [whole punch
tutorial](https://docs.rs/libp2p/0.54.1/libp2p/tutorials/hole_punching/index.html)
possibly because of my networking topology. connection established event
registered.

I will publish the logs and testing information as a comment 

## Change checklist
* Removed unnecessary dependencies on examples/relay-server/Cargo.toml
* Updated tokio version  to "1.37.0"
<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: David E. Perez Negron R. <david@nethunters.xyz>
Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
Co-authored-by: João Oliveira <hello@jxs.pt>
## Description

Remove dependency on
[`libp2p-lookup`](https://github.com/mxinden/libp2p-lookup) which is no
longer maintained, and [makes checks
fail](https://github.com/libp2p/rust-libp2p/actions/runs/11016492372/job/30628121728).

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: João Oliveira <hello@jxs.pt>
* tag 'v0.54.1': (135 commits)
  chore(libp2p): release 0.54.1
  chore(metrics): release 0.15.0
  feat(kad): New provider record update strategy
  chore: Fix identity changelog link
  Create funding.json (libp2p#5553)
  chore: fix some comments
  fix(quic): release libp2p-quic 0.11.1
  chore(swarm): add PR number to 0.45.1 release
  fix(swarm): release libp2p-swarm-derive 0.35.0
  chore: prepare libp2p 0.54 release
  feat(websocket,websocket-websys): Add support for `/tls/ws`
  chore(metrics): Add `/tls/ws` in protocol stack tests
  feat(autonat): Implement AutoNATv2
  chore: add Gui as a maintainer
  feat(kad): configurable bucket size
  feat(websocket): Allow wss connections on IP addresses
  docs: As implied by libp2p#5517 make sure everything still builds on docs.rs
  chore: remove RUSTFLAG from docs workflow
  deps: bump EmbarkStudios/cargo-deny-action from 1 to 2
  refactor(*): Transport redesign
  ...
## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

Resolves libp2p#5506.

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates
@sdbondi sdbondi force-pushed the add-sr25519-support branch from 4ed2650 to 2d5af69 Compare October 10, 2024 13:32
sdbondi and others added 14 commits October 14, 2024 09:32
Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from
2.7.3 to 2.7.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/swatinem/rust-cache/releases">Swatinem/rust-cache's
releases</a>.</em></p>
<blockquote>
<h2>v2.7.5</h2>
<h2>What's Changed</h2>
<ul>
<li>Upgrade checkout action from version 3 to 4 by <a
href="https://github.com/carsten-wenderdel"><code>@​carsten-wenderdel</code></a>
in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/190">Swatinem/rust-cache#190</a></li>
<li>fix: usage of <code>deprecated</code> version of <code>node</code>
by <a href="https://github.com/hamirmahal"><code>@​hamirmahal</code></a>
in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/197">Swatinem/rust-cache#197</a></li>
<li>Only run macOsWorkaround() on macOS by <a
href="https://github.com/heksesang"><code>@​heksesang</code></a> in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/206">Swatinem/rust-cache#206</a></li>
<li>Support Cargo.lock format cargo-lock v4 by <a
href="https://github.com/NobodyXu"><code>@​NobodyXu</code></a> in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/211">Swatinem/rust-cache#211</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/carsten-wenderdel"><code>@​carsten-wenderdel</code></a>
made their first contribution in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/190">Swatinem/rust-cache#190</a></li>
<li><a
href="https://github.com/hamirmahal"><code>@​hamirmahal</code></a> made
their first contribution in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/197">Swatinem/rust-cache#197</a></li>
<li><a href="https://github.com/heksesang"><code>@​heksesang</code></a>
made their first contribution in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/206">Swatinem/rust-cache#206</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Swatinem/rust-cache/compare/v2.7.3...v2.7.5">https://github.com/Swatinem/rust-cache/compare/v2.7.3...v2.7.5</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/82a92a6e8fbeee089604da2575dc567ae9ddeaab"><code>82a92a6</code></a>
2.7.5</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/598fe25fa107b2fd526fc6471f6e48de7cd12083"><code>598fe25</code></a>
update dependencies, rebuild</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/8f842c2d455cfe3d0d5a4b28f53f5389b51b71bf"><code>8f842c2</code></a>
Support Cargo.lock format cargo-lock v4 (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/211">#211</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/96a8d65dbafbc7d145a9b2b6c3b12ee335738cd2"><code>96a8d65</code></a>
Only run macOsWorkaround() on macOS (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/206">#206</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/9bdad043e88c75890e36ad3bbc8d27f0090dd609"><code>9bdad04</code></a>
fix: usage of <code>deprecated</code> version of <code>node</code> (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/197">#197</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/f7a52f691454d93c6ce0dff6666a5cb399b8d06e"><code>f7a52f6</code></a>
&quot;add jsonpath test&quot;</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/2bceda39122b2cc71e6e26ad729b92b44d101f4b"><code>2bceda3</code></a>
&quot;update dependencies&quot;</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/640a22190e7a783d4c409684cea558f081f92012"><code>640a221</code></a>
Upgrade checkout action from version 3 to 4 (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/190">#190</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/158274163087d4d4d49dfcc6a39806493e413240"><code>1582741</code></a>
update dependencies</li>
<li>See full diff in <a
href="https://github.com/swatinem/rust-cache/compare/23bce251a8cd2ffc3c1075eaa2367cf899916d84...82a92a6e8fbeee089604da2575dc567ae9ddeaab">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Swatinem/rust-cache&package-manager=github_actions&previous-version=2.7.3&new-version=2.7.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR 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 this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

Sometimes a test uses custom swarm building logic and doesn't need `fn
new_ephemeral`, and sometimes a test uses `tokio` runtime other than
`async-std`.
This PR adds the `tokio` runtime support and makes both `async-std` and
`tokio` runtimes optional behind features to make it more flexible.

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: João Oliveira <hello@jxs.pt>
## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] A changelog entry has been made in the appropriate crates
## Description
To unblock  CI

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## Description

Fixes libp2p#5626

## Notes & open questions

This is the nicest way I came up with, I decided to leave
`get_closest_local_peers` as is since it does return all peers, not just
`replication_factor` peers.

Looking at libp2p#2436 it is not
clear if @folex really needed all peers returned or it just happened
that way. I'm also happy to change proposed API to return all peers if
that is preferred by others.

It is very unfortunate that `&mut self` is needed for this, I created
libp2p#5644 that if resolved will
allow to have `&self` instead.

## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

Co-authored-by: João Oliveira <hello@jxs.pt>
…ibp2p#5642)

## Description

When trying to publish a message using gossipsub's `publish` method,
it should be possible to predict whether it will fit in the limit
defined by
the `max_transmit_size` config option.
If this limit applies to the final protobuf payload, it's not possible
to know
that in advance because the size of the added fields is not fixed.

This change makes the limit apply to the passed message size instead of
the final wire size.

## Notes & open questions

This is a minor version change because it changes the meaning of the
existing config option.
However, for the existing clients the limit will only become more
permissive, so it shouldn't break anything.

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: Darius Clark <dariusc93@users.noreply.github.com>
Co-authored-by: João Oliveira <hello@jxs.pt>
Co-authored-by: Darius Clark <dariusc93@users.noreply.github.com>
## Description

ref libp2p#4449 

Refactored distributed-key-value-store example to use `tokio` instead of
`async-std`

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates
## Description

ref libp2p#4449 

Refactored ping tests to use `tokio` instead of `async-std`.

## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates
* master: (36 commits)
  chore: refactor ping tests (libp2p#5655)
  feat: refactor distributed-key-value-store example (libp2p#5652)
  chore(ci): address clippy beta lints (libp2p#5649)
  feat(gossipsub): apply `max_transmit_size` to the published message (libp2p#5642)
  feat(kad): add `Behavior::find_closest_local_peers()` (libp2p#5645)
  fix(swarm-test): set proper version (libp2p#5648)
  deps(ci): update cargo-semver-checks (libp2p#5647)
  chore: fix typo in comment (libp2p#5643)
  feat: make runtime features optional in swarm-test (libp2p#5551)
  deps: bump Swatinem/rust-cache from 2.7.3 to 2.7.5 (libp2p#5633)
  chore: update igd-next to 0.15.1 (libp2p#5625)
  fix(server): removing dependency on libp2p-lookup (libp2p#5610)
  refactor(examples): use tokio instead of async-std in relay-server (libp2p#5600)
  deps: update metrics example dependencies (libp2p#5617)
  chore: update interop test run condition (libp2p#5611)
  chore(autonat-v2): fix dial_back_to_non_libp2p test (libp2p#5621)
  fix(swarm): don't report `NewExternalAddrCandidate` if already confirmed (libp2p#5582)
  chore(ci): address beta clippy lints (libp2p#5606)
  fix(ci): address cargo-deny advisories (libp2p#5596)
  chore(ci): only run interop tests on commits to master (libp2p#5604)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.