diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57bd5ad3f7..1f0c03747b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: -Dwarnings RUSTDOCFLAGS: -Dwarnings - MSRV: "1.76" + MSRV: "1.81" SCCACHE_CACHE_SIZE: "10G" IROH_FORCE_STAGING_RELAYS: "1" @@ -221,7 +221,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-05-02 + toolchain: nightly-2024-11-30 - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.6 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 236724e0a5..f0d7ecf42a 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-05-02 + toolchain: nightly-2024-11-30 - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.6 @@ -68,6 +68,6 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} body: | Documentation for this PR has been generated and is available at: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.PREVIEW_PATH }}/iroh/ - + Last updated: ${{ env.TIMESTAMP }} edit-mode: replace diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04084fea46..2a90264184 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: -Dwarnings RUSTDOCFLAGS: -Dwarnings - MSRV: "1.76" + MSRV: "1.81" SCCACHE_CACHE_SIZE: "10G" BIN_NAMES: "iroh-relay,iroh-dns-server" RELEASE_VERSION: ${{ github.event.inputs.release_version }} @@ -138,19 +138,19 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - + - name: Checkout specified commit if: inputs.base_hash != '' uses: actions/checkout@v4 with: ref: ${{ inputs.base_hash }} submodules: recursive - + - name: Set build arch run: | echo "RELEASE_ARCH=${{ matrix.release-arch }}" >> $GITHUB_ENV echo "RELEASE_OS=${{ matrix.release-os }}" >> $GITHUB_ENV - + - name: Define hash if: matrix.os == 'ubuntu-latest' id: define_hash @@ -160,7 +160,7 @@ jobs: - name: Ensure musl support if: ${{ contains(matrix.cargo_targets, '-musl') }} run: sudo apt-get install musl-tools -y - + - name: Install Rust if: matrix.os != 'windows-latest' uses: dtolnay/rust-toolchain@stable @@ -173,7 +173,7 @@ jobs: run: | rustup toolchain install stable rustup target add ${{ matrix.cargo_targets }} - + - name: build release if: matrix.os != 'windows-latest' shell: bash @@ -183,11 +183,11 @@ jobs: export CC=aarch64-linux-gnu-gcc fi cargo build --profile optimized-release --all-features --target ${{ matrix.cargo_targets }} - + - name: build release if: matrix.os == 'windows-latest' run: cargo build --profile optimized-release --all-features --target ${{ matrix.cargo_targets }} - + - name: attach artifacts if: matrix.os != 'windows-latest' uses: actions/upload-artifact@v4 @@ -195,7 +195,7 @@ jobs: name: iroh-${{env.RELEASE_OS }}-${{env.RELEASE_ARCH}} path: target/${{ matrix.cargo_targets }}/optimized-release/iroh compression-level: 0 - + - name: attach artifacts if: matrix.os == 'windows-latest' uses: actions/upload-artifact@v4 @@ -203,40 +203,40 @@ jobs: name: iroh-windows-amd64.exe path: target/${{ matrix.cargo_targets }}/optimized-release/iroh.exe compression-level: 0 - + - name: Setup awscli on linux if: matrix.name == 'ubuntu-latest' run: | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install --update - + - name: Setup awscli on linux if: matrix.name == 'ubuntu-arm-latest' run: | curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install --update - + - name: Setup awscli on mac if: matrix.os == 'macos-latest' run: | curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" sudo installer -pkg AWSCLIV2.pkg -target / - + - name: Set aws credentials if: matrix.os != 'windows-latest' run: | echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV - + - name: push release if: matrix.os != 'windows-latest' run: | aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-relay s3://vorc/iroh-relay-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-dns-server s3://vorc/iroh-dns-server-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress - + - name: push release latest if: matrix.os != 'windows-latest' && (github.event.inputs.mark_latest == 'true' || github.event_name == 'push') run: | @@ -290,7 +290,7 @@ jobs: path: iroh-*.tar.gz compression-level: 0 retention-days: 1 - + - name: attach artifacts uses: actions/upload-artifact@v4 if : matrix.os == 'windows-latest' @@ -307,4 +307,4 @@ jobs: with: release_version: ${{ needs.build_release.outputs.release_version }} base_hash: ${{ needs.build_release.outputs.base_hash }} - publish: true \ No newline at end of file + publish: true diff --git a/.github/workflows/test_relay_server.yml b/.github/workflows/test_relay_server.yml index b5389bebc4..ba59479fff 100644 --- a/.github/workflows/test_relay_server.yml +++ b/.github/workflows/test_relay_server.yml @@ -8,15 +8,15 @@ on: concurrency: group: relay-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - + env: RUST_BACKTRACE: 1 RUSTFLAGS: -Dwarnings RUSTDOCFLAGS: -Dwarnings - MSRV: "1.76" + MSRV: "1.81" SCCACHE_CACHE_SIZE: "10G" IROH_FORCE_STAGING_RELAYS: "1" - + jobs: build_relay_server: runs-on: [self-hosted, linux, X64] @@ -33,11 +33,11 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.6 - + - name: build release run: | cargo build --release --all-features --bin iroh-relay - + - name: Setup awscli on linux run: | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" @@ -48,16 +48,16 @@ jobs: echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV - + - name: push release run: | aws s3 cp ./target/release/iroh-relay s3://vorc/iroh-relay-linux-amd64-${GITHUB_SHA::7} --no-progress - + - name: Set iroh-relay tag id: set_tag run: | echo ::set-output name=tag::${GITHUB_SHA::7} - + deploy_iroh-relay: runs-on: ubuntu-latest diff --git a/iroh-base/Cargo.toml b/iroh-base/Cargo.toml index 220974107f..1f26441349 100644 --- a/iroh-base/Cargo.toml +++ b/iroh-base/Cargo.toml @@ -9,7 +9,7 @@ authors = ["n0 team"] repository = "https://github.com/n0-computer/iroh" # Sadly this also needs to be updated in .github/workflows/ci.yml -rust-version = "1.76" +rust-version = "1.81" [lints] workspace = true diff --git a/iroh-net-report/Cargo.toml b/iroh-net-report/Cargo.toml index 78a20c7e9d..e69a59257b 100644 --- a/iroh-net-report/Cargo.toml +++ b/iroh-net-report/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/n0-computer/iroh" keywords = ["networking"] # Sadly this also needs to be updated in .github/workflows/ci.yml -rust-version = "1.76" +rust-version = "1.81" [lints] workspace = true diff --git a/iroh-relay/Cargo.toml b/iroh-relay/Cargo.toml index 1df2cee7eb..3d22bc66bd 100644 --- a/iroh-relay/Cargo.toml +++ b/iroh-relay/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" authors = ["n0 team"] repository = "https://github.com/n0-computer/iroh" keywords = ["networking", "holepunching", "p2p"] -rust-version = "1.76" +rust-version = "1.81" [lints] workspace = true diff --git a/iroh-relay/src/protos/disco.rs b/iroh-relay/src/protos/disco.rs index 64af8187d7..cd0fed45e9 100644 --- a/iroh-relay/src/protos/disco.rs +++ b/iroh-relay/src/protos/disco.rs @@ -6,7 +6,7 @@ /// The 6 byte header of all discovery messages. pub const MAGIC: &str = "TS💬"; // 6 bytes: 0x54 53 f0 9f 92 ac -pub(crate) const MAGIC_LEN: usize = MAGIC.as_bytes().len(); +pub(crate) const MAGIC_LEN: usize = MAGIC.len(); pub(crate) const KEY_LEN: usize = 32; const MESSAGE_HEADER_LEN: usize = MAGIC_LEN + KEY_LEN; diff --git a/iroh-relay/src/protos/relay.rs b/iroh-relay/src/protos/relay.rs index 639ce84bde..35e6282482 100644 --- a/iroh-relay/src/protos/relay.rs +++ b/iroh-relay/src/protos/relay.rs @@ -268,7 +268,7 @@ impl Frame { client_public_key: _, message, signature: _, - } => MAGIC.as_bytes().len() + PUBLIC_KEY_LENGTH + message.len() + Signature::BYTE_SIZE, + } => MAGIC.len() + PUBLIC_KEY_LENGTH + message.len() + Signature::BYTE_SIZE, Frame::SendPacket { dst_key: _, packet } => PUBLIC_KEY_LENGTH + packet.len(), Frame::RecvPacket { src_key: _, @@ -368,17 +368,16 @@ impl Frame { let res = match frame_type { FrameType::ClientInfo => { ensure!( - content.len() - >= PUBLIC_KEY_LENGTH + Signature::BYTE_SIZE + MAGIC.as_bytes().len(), + content.len() >= PUBLIC_KEY_LENGTH + Signature::BYTE_SIZE + MAGIC.len(), "invalid client info frame length: {}", content.len() ); ensure!( - &content[..MAGIC.as_bytes().len()] == MAGIC.as_bytes(), + &content[..MAGIC.len()] == MAGIC.as_bytes(), "invalid client info frame magic" ); - let start = MAGIC.as_bytes().len(); + let start = MAGIC.len(); let client_public_key = PublicKey::try_from(&content[start..start + PUBLIC_KEY_LENGTH])?; let start = start + PUBLIC_KEY_LENGTH; diff --git a/iroh-test/Cargo.toml b/iroh-test/Cargo.toml index e68cd2317c..f9f72cedc1 100644 --- a/iroh-test/Cargo.toml +++ b/iroh-test/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/n0-computer/iroh" publish = true # Sadly this also needs to be updated in .github/workflows/ci.yml -rust-version = "1.76" +rust-version = "1.81" [lints] workspace = true diff --git a/iroh/Cargo.toml b/iroh/Cargo.toml index 659d28641a..71e168b9e8 100644 --- a/iroh/Cargo.toml +++ b/iroh/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/n0-computer/iroh" keywords = ["quic", "networking", "holepunching", "p2p"] # Sadly this also needs to be updated in .github/workflows/ci.yml -rust-version = "1.76" +rust-version = "1.81" [lints] workspace = true diff --git a/iroh/src/disco.rs b/iroh/src/disco.rs index 29a1525884..0f64f94756 100644 --- a/iroh/src/disco.rs +++ b/iroh/src/disco.rs @@ -34,7 +34,7 @@ use crate::key; // TODO: custom magicn /// The 6 byte header of all discovery messages. pub const MAGIC: &str = "TS💬"; // 6 bytes: 0x54 53 f0 9f 92 ac -pub const MAGIC_LEN: usize = MAGIC.as_bytes().len(); +pub const MAGIC_LEN: usize = MAGIC.len(); /// Current Version. const V0: u8 = 0;