From 8abcca7b351dcc3f83cf8f931f75946a1d110e47 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Wed, 14 Feb 2024 16:49:26 +0100 Subject: [PATCH 1/6] Fix clippy warnings --- examples/random-generation-protocol/src/lib.rs | 6 +++--- round-based/src/rounds_router/mod.rs | 9 +++++++++ round-based/src/rounds_router/simple_store.rs | 11 ++++------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/examples/random-generation-protocol/src/lib.rs b/examples/random-generation-protocol/src/lib.rs index 1fe5f51..6a777d1 100644 --- a/examples/random-generation-protocol/src/lib.rs +++ b/examples/random-generation-protocol/src/lib.rs @@ -52,7 +52,7 @@ where rng.fill_bytes(&mut local_randomness); // 2. Commit local randomness (broadcast m=sha256(randomness)) - let commitment = Sha256::digest(&local_randomness); + let commitment = Sha256::digest(local_randomness); outgoing .send(Outgoing::broadcast(Msg::CommitMsg(CommitMsg { commitment, @@ -86,7 +86,7 @@ where .into_iter_indexed() .zip(randomness.into_iter_indexed()) { - let commitment_expected = Sha256::digest(&decommit.randomness); + let commitment_expected = Sha256::digest(decommit.randomness); if commit.commitment != commitment_expected { guilty_parties.push(Blame { guilty_party: party_i, @@ -161,6 +161,6 @@ mod tests { assert_eq!(output[0], output[usize::from(i)]); } - println!("Output randomness: {}", hex::encode(&output[0])); + println!("Output randomness: {}", hex::encode(output[0])); } } diff --git a/round-based/src/rounds_router/mod.rs b/round-based/src/rounds_router/mod.rs index 8535fe4..2d8d4fd 100644 --- a/round-based/src/rounds_router/mod.rs +++ b/round-based/src/rounds_router/mod.rs @@ -234,6 +234,15 @@ pub struct RoundsRouterBuilder { rounds: HashMap + Send>>>, } +impl Default for RoundsRouterBuilder +where + M: ProtocolMessage + 'static, + { + fn default() -> Self { + Self::new() + } +} + impl RoundsRouterBuilder where M: ProtocolMessage + 'static, diff --git a/round-based/src/rounds_router/simple_store.rs b/round-based/src/rounds_router/simple_store.rs index 49d0b28..76898d0 100644 --- a/round-based/src/rounds_router/simple_store.rs +++ b/round-based/src/rounds_router/simple_store.rs @@ -117,8 +117,7 @@ where msg_id: msg.id, expected: self.expected_msg_type, actual: msg.msg_type, - } - .into()); + }); } if msg.sender == self.i { // Ignore own messages @@ -141,14 +140,12 @@ where Some(Some(_)) => Err(RoundInputError::AttemptToOverwriteReceivedMsg { msgs_ids: [self.messages_ids[index], msg.id], sender: msg.sender, - } - .into()), + }), None => Err(RoundInputError::SenderIndexOutOfRange { msg_id: msg.id, sender: msg.sender, n: self.n, - } - .into()), + }), } } @@ -210,7 +207,7 @@ impl RoundMsgs { pub fn into_iter_indexed(self) -> impl Iterator { let parties_indexes = (0..self.i).chain(self.i + 1..); parties_indexes - .zip(self.ids.into_iter()) + .zip(self.ids) .zip(self.messages) .map(|((party_ind, msg_id), msg)| (party_ind, msg_id, msg)) } From 386e90f18eea8929b06b6471f5304c60e2b83a7c Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Wed, 14 Feb 2024 16:50:58 +0100 Subject: [PATCH 2/6] Change link to the repo --- round-based-derive/Cargo.toml | 2 +- round-based/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/round-based-derive/Cargo.toml b/round-based-derive/Cargo.toml index 0f7ca07..5c758fe 100644 --- a/round-based-derive/Cargo.toml +++ b/round-based-derive/Cargo.toml @@ -4,7 +4,7 @@ version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" description = "Proc-macro for deriving `round-based` traits" -repository = "https://github.com/ZenGo-X/round-based-protocol" +repository = "https://github.com/dfns/round-based" [lib] proc-macro = true diff --git a/round-based/Cargo.toml b/round-based/Cargo.toml index 71271cd..4558d52 100644 --- a/round-based/Cargo.toml +++ b/round-based/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "round-based" -version = "0.2.0" +version = "0.2.1" edition = "2021" license = "MIT OR Apache-2.0" description = "Driver for MPC protocols" -repository = "https://github.com/ZenGo-X/round-based-protocol" +repository = "https://github.com/dfns/round-based" categories = ["asynchronous", "cryptography", "network-programming"] keywords = ["round-based", "mpc", "protocol"] readme = "../README.md" From e1232d2b41dc6014100a288a85a189a1f09b7391 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Wed, 14 Feb 2024 16:54:41 +0100 Subject: [PATCH 3/6] Update codeowners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fb4f292..57f3974 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @survived +* @dfns/research From c3300ef53a5026bd6ea3c0daf72aa999f70b7797 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Wed, 14 Feb 2024 16:57:49 +0100 Subject: [PATCH 4/6] `cargo fmt` --- round-based/src/rounds_router/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/round-based/src/rounds_router/mod.rs b/round-based/src/rounds_router/mod.rs index 2d8d4fd..7d03e1c 100644 --- a/round-based/src/rounds_router/mod.rs +++ b/round-based/src/rounds_router/mod.rs @@ -237,7 +237,7 @@ pub struct RoundsRouterBuilder { impl Default for RoundsRouterBuilder where M: ProtocolMessage + 'static, - { +{ fn default() -> Self { Self::new() } From 1a206a52664dbec981163e2d98f10815a9978129 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Wed, 14 Feb 2024 16:59:53 +0100 Subject: [PATCH 5/6] Update license --- LICENSE-MIT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE-MIT b/LICENSE-MIT index f889381..e1fd273 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Zengo X +Copyright (c) 2023 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 3f7bab9184af9376651d242c5a5f75767a378e30 Mon Sep 17 00:00:00 2001 From: Denis Varlakov Date: Wed, 14 Feb 2024 17:09:43 +0100 Subject: [PATCH 6/6] Update license to list all contributors --- LICENSE-APACHE | 3 ++- LICENSE-MIT | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/LICENSE-APACHE b/LICENSE-APACHE index 7b8a5b2..1359712 100644 --- a/LICENSE-APACHE +++ b/LICENSE-APACHE @@ -186,7 +186,8 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 + Copyright 2023 Zengo X + Copyright 2024 Dfns Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/LICENSE-MIT b/LICENSE-MIT index e1fd273..e9bb563 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2023 +Copyright (c) 2023 Zengo X +Copyright (c) 2024 Dfns Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal