From 22d44b6573f5036857cf7f9184a8533ccee7f2d9 Mon Sep 17 00:00:00 2001 From: Marcin Date: Fri, 29 Nov 2024 09:56:19 +0000 Subject: [PATCH 1/2] Bump Rust to 1.79 (from 1.77) (#499) * Bump Rust to 1.79 (from 1.77) * Bump version --- Cargo.lock | 2 +- consensus/Cargo.toml | 2 +- consensus/src/extension/election.rs | 2 +- consensus/src/testing/mod.rs | 1 - examples/ordering/src/main.rs | 3 +-- rust-toolchain.toml | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0cc922ef..645ebdb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,7 +28,7 @@ dependencies = [ [[package]] name = "aleph-bft" -version = "0.38.0" +version = "0.38.1" dependencies = [ "aleph-bft-mock", "aleph-bft-rmc", diff --git a/consensus/Cargo.toml b/consensus/Cargo.toml index 8be4e7e5..75bd3dbf 100644 --- a/consensus/Cargo.toml +++ b/consensus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-bft" -version = "0.38.0" +version = "0.38.1" edition = "2021" authors = ["Cardinal Cryptography"] categories = ["algorithms", "data-structures", "cryptography", "database"] diff --git a/consensus/src/extension/election.rs b/consensus/src/extension/election.rs index fca1e225..f409676d 100644 --- a/consensus/src/extension/election.rs +++ b/consensus/src/extension/election.rs @@ -94,7 +94,7 @@ impl CandidateElection { fn vote(&mut self, voter: &U) -> Result<(), CandidateOutcome> { // If the vote is already computed we are done. - if self.votes.get(&voter.hash()).is_some() { + if self.votes.contains_key(&voter.hash()) { return Ok(()); } // Votes for old units are never used, so we just return. diff --git a/consensus/src/testing/mod.rs b/consensus/src/testing/mod.rs index ce132155..64cd8c04 100644 --- a/consensus/src/testing/mod.rs +++ b/consensus/src/testing/mod.rs @@ -1,4 +1,3 @@ -#![cfg(test)] mod alerts; mod byzantine; mod crash; diff --git a/examples/ordering/src/main.rs b/examples/ordering/src/main.rs index 5b4e3ac4..f3ff1c1d 100644 --- a/examples/ordering/src/main.rs +++ b/examples/ordering/src/main.rs @@ -9,8 +9,7 @@ use dataio::{Data, DataProvider, FinalizationHandler}; use futures::{channel::oneshot, io, StreamExt}; use log::{debug, error, info}; use network::Network; -use std::sync::Arc; -use std::{path::Path, time::Duration}; +use std::{path::Path, sync::Arc, time::Duration}; use time::{macros::format_description, OffsetDateTime}; use tokio::fs::{self, File}; use tokio_util::compat::{Compat, TokioAsyncWriteCompatExt}; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 83025f97..628740b1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.77.0" +channel = "1.79.0" From 6ef434f46509e88d9303c5af396d15002960d5d8 Mon Sep 17 00:00:00 2001 From: Marcin Date: Fri, 29 Nov 2024 11:00:04 +0000 Subject: [PATCH 2/2] Make publish crate worklow a dry run on PR. (#498) --- .github/workflows/publish-packages.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index f8fffd88..b3e68b06 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: jobs: publish: @@ -11,10 +12,22 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'Cardinal-Cryptography/AlephBFT'}} steps: + - name: Publish + if: ${{ github.event_name == 'push' }} + run: + echo "Publishing crates." + + - name: Dry-ryn + if: ${{ github.event_name != 'push' }} + run: + echo "Dry-run - not publishing crates." + - uses: actions/checkout@v4 + - uses: ./.github/actions/install-rust-toolchain + - uses: katyo/publish-crates@v2 with: registry-token: ${{ secrets.CRATES_IO_TOKEN }} - ignore-unpublished-changes: true publish-delay: 30000 + dry-run: ${{ github.event_name != 'push' }}