diff --git a/.github/workflows/build_binaries.json b/.github/workflows/build_binaries.json index 890347a700..dd7466999b 100644 --- a/.github/workflows/build_binaries.json +++ b/.github/workflows/build_binaries.json @@ -2,7 +2,7 @@ { "name": "linux-x86_64", "runs-on": "ubuntu-20.04", - "rust": "nightly-2024-03-01", + "rust": "nightly-2024-07-07", "target": "x86_64-unknown-linux-gnu", "cross": false, "build_metric": true diff --git a/.github/workflows/build_binaries.yml b/.github/workflows/build_binaries.yml index 6bd01edbea..94f479296a 100644 --- a/.github/workflows/build_binaries.yml +++ b/.github/workflows/build_binaries.yml @@ -26,7 +26,7 @@ env: TS_FEATURES: "default, safe" TS_LIBRARIES: "minotari_mining_helper_ffi" TARI_NETWORK_DIR: testnet - toolchain: nightly-2024-03-01 + toolchain: nightly-2024-07-07 matrix-json-file: ".github/workflows/build_binaries.json" CARGO_HTTP_MULTIPLEXING: false CARGO_UNSTABLE_SPARSE_REGISTRY: true diff --git a/.github/workflows/build_dockers.yml b/.github/workflows/build_dockers.yml index 469fbd03cf..73c8dc26f0 100644 --- a/.github/workflows/build_dockers.yml +++ b/.github/workflows/build_dockers.yml @@ -48,7 +48,7 @@ name: Build docker images - xmrig env: - toolchain_default: nightly-2024-03-01 + toolchain_default: nightly-2024-07-07 concurrency: # https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix diff --git a/.github/workflows/build_dockers_workflow.yml b/.github/workflows/build_dockers_workflow.yml index e8bce95bc1..621aa77345 100644 --- a/.github/workflows/build_dockers_workflow.yml +++ b/.github/workflows/build_dockers_workflow.yml @@ -14,7 +14,7 @@ name: Build docker images - workflow_call/on-demand toolchain: type: string description: 'Rust toolchain' - default: nightly-2024-03-01 + default: nightly-2024-07-07 arch: type: string default: x86-64 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 78e4b2fa3a..f6761ed720 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -11,7 +11,7 @@ name: Source Coverage - ci-coverage-* env: - toolchain: nightly-2024-03-01 + toolchain: nightly-2024-07-07 concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 921ab950be..25257ff3e5 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -27,7 +27,7 @@ name: Integration tests type: string env: - toolchain: nightly-2024-03-01 + toolchain: nightly-2024-07-07 concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/base_layer/core/Cargo.toml b/base_layer/core/Cargo.toml index 941678c9a1..26cff88baf 100644 --- a/base_layer/core/Cargo.toml +++ b/base_layer/core/Cargo.toml @@ -115,4 +115,4 @@ name = "mempool" harness = false [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tari_target_network_mainnet)', 'cfg(tari_target_network_nextnet)', 'cfg(tari_target_network_testnet)'] } \ No newline at end of file +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tari_target_network_mainnet)', 'cfg(tari_target_network_nextnet)', 'cfg(tari_target_network_testnet)'] } diff --git a/base_layer/core/src/common/limited_reader.rs b/base_layer/core/src/common/limited_reader.rs deleted file mode 100644 index be80895a69..0000000000 --- a/base_layer/core/src/common/limited_reader.rs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022, The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -use std::{io, io::Read}; - -pub struct LimitedBytesReader { - byte_limit: usize, - num_read: usize, - inner: R, -} - -impl Read for LimitedBytesReader { - fn read(&mut self, buf: &mut [u8]) -> std::io::Result { - let read = self.inner.read(buf)?; - self.num_read += read; - if self.num_read > self.byte_limit { - return Err(io::Error::new( - io::ErrorKind::InvalidInput, - format!("Read more bytes than the maximum ({})", self.byte_limit), - )); - } - Ok(read) - } -} - -#[cfg(test)] -mod test { - use super::*; - - impl LimitedBytesReader { - pub fn new(byte_limit: usize, reader: R) -> Self { - Self { - byte_limit, - num_read: 0, - inner: reader, - } - } - } - - #[test] - fn read_test() { - // read should work fine in the case of a buffer whose length is within byte_limit - let inner: &[u8] = &[0u8, 1u8, 2u8, 3u8, 4u8]; - let mut reader = LimitedBytesReader::new(3, inner); - let mut buf = [0u8; 3]; - let output = reader.read(&mut buf).unwrap(); - assert_eq!(output, buf.len()); - - // in case of buffer with length strictly bigger than reader byte_limit, the code should throw an error - let mut new_buf = [0u8; 4]; - let output = reader.read(&mut new_buf); - assert!(output.is_err()); - } -} diff --git a/base_layer/core/src/common/mod.rs b/base_layer/core/src/common/mod.rs index 17292b5cc9..52dd52d263 100644 --- a/base_layer/core/src/common/mod.rs +++ b/base_layer/core/src/common/mod.rs @@ -28,7 +28,6 @@ use crate::consensus::DomainSeparatedConsensusHasher; pub mod borsh; pub mod byte_counter; -// pub mod limited_reader; pub mod one_sided; #[cfg(feature = "base_node")] diff --git a/base_layer/tari_mining_helper_ffi/Cargo.toml b/base_layer/tari_mining_helper_ffi/Cargo.toml index dc74569961..dbdf64694c 100644 --- a/base_layer/tari_mining_helper_ffi/Cargo.toml +++ b/base_layer/tari_mining_helper_ffi/Cargo.toml @@ -32,4 +32,4 @@ tari_common = { path = "../../common", features = ["build", "static-application- crate-type = ["cdylib"] [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tari_target_network_mainnet)', 'cfg(tari_target_network_nextnet)', 'cfg(tari_target_network_testnet)'] } \ No newline at end of file +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tari_target_network_mainnet)', 'cfg(tari_target_network_nextnet)', 'cfg(tari_target_network_testnet)'] } diff --git a/base_layer/wallet_ffi/README.md b/base_layer/wallet_ffi/README.md index b00fecb5ee..a58ca97ab4 100644 --- a/base_layer/wallet_ffi/README.md +++ b/base_layer/wallet_ffi/README.md @@ -132,8 +132,8 @@ Install [Rust](https://www.rust-lang.org/tools/install) Install the following tools and system images ```Shell Script -rustup toolchain add nightly-2024-03-01 -rustup default nightly-2024-03-01 +rustup toolchain add nightly-2024-07-07 +rustup default nightly-2024-07-07 rustup component add rustfmt --toolchain nightly rustup component add clippy rustup target add x86_64-apple-ios aarch64-apple-ios # iPhone and emulator cross compiling diff --git a/base_layer/wallet_ffi/wallet.h b/base_layer/wallet_ffi/wallet.h index 0061902e67..ce9aa84e20 100644 --- a/base_layer/wallet_ffi/wallet.h +++ b/base_layer/wallet_ffi/wallet.h @@ -2965,9 +2965,9 @@ TariBalance *wallet_get_balance(struct TariWallet *wallet, * * `page_size` - A number of items per page, * * `sorting` - An enum representing desired sorting, * * `dust_threshold` - A value filtering threshold. Outputs whose values are <= `dust_threshold` are not listed in the - * result. + * result. * * `error_out` - Pointer to an int which will be modified to an error code should one occur, may not be null. - * Functions as an out parameter. + * Functions as an out parameter. * * ## Returns * `*mut TariVector` - Returns a struct with an array pointer, length and capacity (needed for proper destruction diff --git a/buildtools/docker/base_node.Dockerfile b/buildtools/docker/base_node.Dockerfile index 4af0b7e43b..79635730cf 100644 --- a/buildtools/docker/base_node.Dockerfile +++ b/buildtools/docker/base_node.Dockerfile @@ -1,13 +1,13 @@ # syntax=docker/dockerfile:1 #FROM rust:1.42.0 as builder -FROM quay.io/tarilabs/rust_tari-build-with-deps:nightly-2024-03-01 as builder +FROM quay.io/tarilabs/rust_tari-build-with-deps:nightly-2024-07-07 as builder # Copy the dependency lists #ADD Cargo.toml ./ ADD . /minotari_node WORKDIR /minotari_node -# RUN rustup component add rustfmt --toolchain nightly-2024-03-01-x86_64-unknown-linux-gnu +# RUN rustup component add rustfmt --toolchain nightly-2024-07-07-x86_64-unknown-linux-gnu #ARG TBN_ARCH=native ARG TBN_ARCH=x86-64 #ARG TBN_FEATURES=avx2 diff --git a/scripts/test_in_docker.sh b/scripts/test_in_docker.sh index 6876c17b10..bf49bb4498 100755 --- a/scripts/test_in_docker.sh +++ b/scripts/test_in_docker.sh @@ -2,8 +2,8 @@ # Run the Tari test suite locally inside a suitable docker container -IMAGE=quay.io/tarilabs/rust_tari-build-with-deps:nightly-2024-03-01 -TOOLCHAIN_VERSION=nightly-2024-03-01 +IMAGE=quay.io/tarilabs/rust_tari-build-with-deps:nightly-2024-07-07 +TOOLCHAIN_VERSION=nightly-2024-07-07 CONTAINER=tari_test echo "Deleting old container"