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

Bump libp2p to version 0.53.2 #631

Merged
merged 8 commits into from
Jun 24, 2024
Merged

Bump libp2p to version 0.53.2 #631

merged 8 commits into from
Jun 24, 2024

Conversation

sandreae
Copy link
Member

@sandreae sandreae commented Jun 21, 2024

📋 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@@ -271,21 +263,6 @@ pub async fn connect_to_relay(
info!("Registered on rendezvous in namespace \"{namespace}\"");
rendezvous_registered = true;
}
SwarmEvent::ConnectionClosed { .. } => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swarm.listen_on(circuit_address) no longer sometimes fails so we don't need this retry loop anymore.

let behaviour = P2pandaBehaviour::new(network_config, key_pair, None)?;

build_swarm(network_config, transport, behaviour, peer_id)
let swarm = SwarmBuilder::with_existing_identity(key_pair)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just... how much better is this? No manually constructing transports, just a nice SwarmBuilder api.

I can't help tagging @mycognosist here to see this.

}

// Build the transport stack to be used by nodes _not_ behaving as relays.
pub async fn build_client_transport(
Copy link
Member Author

@sandreae sandreae Jun 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bye bye!! 👋 👋

Copy link

codecov bot commented Jun 22, 2024

Codecov Report

Attention: Patch coverage is 79.06977% with 9 lines in your changes missing coverage. Please review.

Project coverage is 92.10%. Comparing base (086d424) to head (962f453).
Report is 13 commits behind head on main.

Current head 962f453 differs from pull request most recent head c0aab4b

Please upload reports for the commit c0aab4b to get more accurate results.

Files Patch % Lines
aquadoggo/src/network/swarm.rs 60.00% 6 Missing ⚠️
aquadoggo/src/network/behaviour.rs 50.00% 1 Missing ⚠️
aquadoggo/src/network/peers/handler.rs 66.66% 1 Missing ⚠️
aquadoggo/src/network/service.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #631      +/-   ##
==========================================
- Coverage   92.75%   92.10%   -0.65%     
==========================================
  Files         104      103       -1     
  Lines       20191    20529     +338     
==========================================
+ Hits        18728    18909     +181     
- Misses       1463     1620     +157     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -237,33 +227,11 @@ impl ConnectionHandler for Handler {
}
}

fn connection_keep_alive(&self) -> KeepAlive {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom implementation of connection_keep_alive is no longer required as connections are now kept alive unless all streams are closed, and for us that never happens unless a critical error occurs.

@@ -51,15 +51,7 @@ pub async fn network_service(
// The swarm can be initiated with or without "relay" capabilities.
let mut swarm = if network_config.relay_mode {
info!("Networking service initializing with relay capabilities...");
let mut swarm = swarm::build_relay_swarm(&network_config, key_pair).await?;

// Start listening on tcp address.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to listen on tcp address even in relay mode, this is clear now.

@adzialocha adzialocha merged commit 0fdf195 into main Jun 24, 2024
8 checks passed
sandreae added a commit that referenced this pull request Jun 25, 2024
* Bump `libp2p` to version `0.53.2` (#631)

* Bump libp2p to version 0.53.2

* We don't need to listen on tcp port when in relay mode

* Listening on relay circuit no longer sometimes fails

* Remove tcp feature requirement from libp2p

* Refactor connection_keep_alive method

* Clippy

* Remove unnecessary connection_keep_alive method from peers behaviour

* Add CHANGELOG.md entry

---------

Co-authored-by: adz <x12@adz.garden>

* Move network service relay initialization into main event loop

* Clippy

* Add DCUTR event debug logging to swarm

* Change log message

* Adjust connection limits

* Even nicer log messages

* Helper to print or info log depending on log level

* Listening on relay circuit no longer sometimes fails

---------

Co-authored-by: adz <x12@adz.garden>
@sandreae sandreae deleted the bump-libp2p branch June 25, 2024 19:06
jmanm added a commit to jmanm/aquadoggo that referenced this pull request Jul 13, 2024
* Make clippy happy

* Revert "Make clippy happy"

This reverts commit e250ccd.

* Try fmt and clippy again

* Add clippy suggestions

* Allow setting path to config file via env args (p2panda#611)

* Enable passing path to config file via env args

* Remove println

* Update comment

* Remove unwanted file

* Update CHANGELOG

* Accept domain name and ip addresses for peers (p2panda#612)

* Accept String for relay and direct peer addresses in config

* Use ToSocketAddress to handle ip and domain name addresses

* Clippy

* fmt

* Update CHANGELOG

* Update example config.toml

* Prepare CHANGELOG for release

* 0.7.2

* Fix: query for child relations fails when relation list empty (p2panda#614)

* Add test get_child_document_ids test case for document with empty relation list

* Account for null values when relation lists are empty

* Update test comment

* Update CHANGELOG

* 0.7.3

* Re-run tasks for partially materialized blobs (p2panda#618)

* Check materialized blob file is complete before aborting task

* Add test

* fmt

* Update CHANGELOG

* Clippy

* Correct cmp logic

* Remove double comment

---------

Co-authored-by: adz <x12@adz.garden>

* Fix: include all logs from target schema id during replication (p2panda#620)

* Include tombstoned documents when calculating local log heights

* Clippy

* Update CHANGELOG

* Make clippy happy

* Bump rust gh action to v1 and define toolchain version

* Introduce `PeerAddress` struct for improved address resolution patterns (p2panda#621)

* Introduce PeerAddress struct with socket and multiaddr resolution methods

* Don't pop of p2p protocol from relay address as it isn't there

* fmt

* Update CHANGELOG

* Cache socket addresses

* Remove Multiaddr from PeerAddress

* Remove serde traits from PeerAddress

* Add doc string to PeerAddress

* Rename methods

* Re-apply unhandled operations during startup of materializer service (p2panda#623)

* Store method to get all un-indexed operation ids

* Pick up un-indexed operations when starting materializer service, add a test

* Add entry to CHANGELOG.md

* Increase `max_pending_connections_*` (p2panda#628)

* Increase max pending connections

* Update CHANGELOG

* Dial all configured known relay and direct node addresses on schedule (p2panda#622)

* Poll all known peer addresses

* Update PeerAddress method name

* Update CHANGELOG

* WIP: poll known peers

* Check if a direct node was identified (and add comments)

* Don't dial direct node address on startup, rely on scheduler

* More comments

* Remove unused import

* fmt

* Doc strings for EventLoop struct

* Clippy

* 0.7.4

* Minor CHANGELOG.md formatting change

* Fix: handle connection ids greater than 9 in `Peer` impl of `Human` trait (p2panda#634)

* Handle connection ids greater than 9 in peer Human impl

* Clippy

* Update CHANGELOG

* Bump `libp2p` to version `0.53.2` (p2panda#631)

* Bump libp2p to version 0.53.2

* We don't need to listen on tcp port when in relay mode

* Listening on relay circuit no longer sometimes fails

* Remove tcp feature requirement from libp2p

* Refactor connection_keep_alive method

* Clippy

* Remove unnecessary connection_keep_alive method from peers behaviour

* Add CHANGELOG.md entry

---------

Co-authored-by: adz <x12@adz.garden>

* Move relay connection logic into main event loop (p2panda#632)

* Bump `libp2p` to version `0.53.2` (p2panda#631)

* Bump libp2p to version 0.53.2

* We don't need to listen on tcp port when in relay mode

* Listening on relay circuit no longer sometimes fails

* Remove tcp feature requirement from libp2p

* Refactor connection_keep_alive method

* Clippy

* Remove unnecessary connection_keep_alive method from peers behaviour

* Add CHANGELOG.md entry

---------

Co-authored-by: adz <x12@adz.garden>

* Move network service relay initialization into main event loop

* Clippy

* Add DCUTR event debug logging to swarm

* Change log message

* Adjust connection limits

* Even nicer log messages

* Helper to print or info log depending on log level

* Listening on relay circuit no longer sometimes fails

---------

Co-authored-by: adz <x12@adz.garden>

* Support private net with pre-shared key (p2panda#635)

* Swarm listens on both TCP and QUIC addresses

* Support both QUIC and TCP protocols

* TCP port_reuse should be false

* Establish a private net over TCP when psk provided in NetworkConfig

* Initiate swarm with private net when psk provided in config

* Update CHANGELOG

* Doc string fix

* Don't need to differentiate between transports when detecting port

* Update README

* Fix README formatting

* Update example config file

* Check if blob file exists before deleting it from fs (p2panda#636)

* Check if blob file exists before deleting it from fs

* Add entry to CHANGELOG.md

* Inconsistent blob storage warning was wrongly shown (p2panda#638)

* Inconsistent blob storage warning was wrongly shown

* Add entry to CHANGELOG.md

* Minor config.toml cleanup

* Safely handle missing document when retrieving document view from store (p2panda#637)

* Return None when document was deleted

* Add entry to CHANGELOG.md

* Introduce API to subscribe to peer connection events (p2panda#625)

* Introduce API to subscribe to peer connection events

* Add entry to CHANGELOG.md

* 0.8.0

* Also bump version in aquadoggo_cli, add note about that in RELEASE.md

* Adjust level of replication session and document materialization logs (p2panda#639)

* Remove relay and direct peer poll attempt logging

* Change document creation/update/delete logging to info level

* Lower level of replication session logs to debug

* Update CHANGELOG

* Remove incorrectly commit file

* Lower logging level for replication finished message

* Fix logging logic error in reducer

* Improve GraphQL re-build error

* Update README.md

* Expose NodeEvent to public API (p2panda#643)

* Expose NodeEvent to public API

* Add entry to CHANGELOG.md

---------

Co-authored-by: adz <x12@adz.garden>
Co-authored-by: Sam Andreae <contact@samandreae.com>
Co-authored-by: adz <adzialocha@users.noreply.github.com>
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.

2 participants