From d356b5e0dd1a9ea6b602e49be1946d5b4ee87ebb Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 19 Jun 2023 08:42:08 +1000 Subject: [PATCH] Make licensing notes consistent --- zebra-network/Cargo.toml | 6 +++++- zebra-network/src/peer_set/initialize.rs | 7 ++++--- zebra-network/src/peer_set/set.rs | 1 + zebra-network/src/peer_set/unready_service.rs | 9 ++++++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/zebra-network/Cargo.toml b/zebra-network/Cargo.toml index ae5639881d1..cd1029e6325 100644 --- a/zebra-network/Cargo.toml +++ b/zebra-network/Cargo.toml @@ -7,7 +7,11 @@ description = "Networking code for Zebra" # # This licence is deliberately different to the rest of Zebra. # -# zebra-network/src/peer_set/set.rs was modified from a 2019 version of: +# Some code in: +# zebra-network/src/peer_set/set.rs +# zebra-network/src/peer_set/unready_service.rs +# zebra-network/src/peer_set/initialize.rs +# was modified from a 2019 version of: # https://github.com/tower-rs/tower/tree/master/tower/src/balance/p2c/service.rs license = "MIT" repository = "https://github.com/ZcashFoundation/zebra" diff --git a/zebra-network/src/peer_set/initialize.rs b/zebra-network/src/peer_set/initialize.rs index 6235b500946..f3512764a12 100644 --- a/zebra-network/src/peer_set/initialize.rs +++ b/zebra-network/src/peer_set/initialize.rs @@ -1,7 +1,8 @@ //! A peer set whose size is dynamically determined by resource constraints. - -// Portions of this submodule were adapted from tower-balance, -// which is (c) 2019 Tower Contributors (MIT licensed). +//! +//! The [`PeerSet`] implementation is adapted from the one in [tower::Balance][tower-balance]. +//! +//! [tower-balance]: https://github.com/tower-rs/tower/tree/master/tower/src/balance use std::{ collections::{BTreeMap, HashSet}, diff --git a/zebra-network/src/peer_set/set.rs b/zebra-network/src/peer_set/set.rs index 0353d377f5e..8cdf0c099ec 100644 --- a/zebra-network/src/peer_set/set.rs +++ b/zebra-network/src/peer_set/set.rs @@ -3,6 +3,7 @@ //! # Implementation //! //! The [`PeerSet`] implementation is adapted from the one in [tower::Balance][tower-balance]. +//! //! As described in Tower's documentation, it: //! //! > Distributes requests across inner services using the [Power of Two Choices][p2c]. diff --git a/zebra-network/src/peer_set/unready_service.rs b/zebra-network/src/peer_set/unready_service.rs index 108a9e8307f..d49587cde1d 100644 --- a/zebra-network/src/peer_set/unready_service.rs +++ b/zebra-network/src/peer_set/unready_service.rs @@ -1,6 +1,9 @@ -/// Services that are busy or newly created. -/// -/// Adapted from tower-balance. +//! Services that are busy or newly created. +//! +//! The [`UnreadyService`] implementation is adapted from the one in [tower::Balance][tower-balance]. +//! +//! [tower-balance]: https://github.com/tower-rs/tower/tree/master/tower/src/balance + use std::{ future::Future, marker::PhantomData,