Skip to content

Commit

Permalink
Remove .cargo/config and +aes feature on x86-64
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Aug 9, 2024
1 parent 38d6b5b commit 7f91314
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .cargo/config.toml

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*
!/.cargo
!/crates
!/domains
!/orml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snapshot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
- os: ${{ fromJson(github.repository_owner == 'autonomys' && '["self-hosted", "ubuntu-20.04-x86-64"]' || '"ubuntu-20.04"') }}
target: x86_64-unknown-linux-gnu
suffix: ubuntu-x86_64-v2-${{ github.ref_name }}
rustflags: "-C target-cpu=x86-64-v2 -C target-feature=+aes"
rustflags: "-C target-cpu=x86-64-v2"
- os: ${{ fromJson(github.repository_owner == 'autonomys' && '["self-hosted", "ubuntu-20.04-x86-64"]' || '"ubuntu-20.04"') }}
target: aarch64-unknown-linux-gnu
suffix: ubuntu-aarch64-${{ github.ref_name }}
Expand All @@ -114,7 +114,7 @@ jobs:
- os: ${{ fromJson(github.repository_owner == 'autonomys' && '["self-hosted", "windows-server-2022-x86-64"]' || '"windows-2022"') }}
target: x86_64-pc-windows-msvc
suffix: windows-x86_64-v2-${{ github.ref_name }}
rustflags: "-C target-cpu=x86-64-v2 -C target-feature=+aes"
rustflags: "-C target-cpu=x86-64-v2"
fail-fast: false
runs-on: ${{ matrix.build.os }}
env:
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-bootstrap-node
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN \

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY .cargo /code/.cargo
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY rust-toolchain.toml /code/rust-toolchain.toml
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-bootstrap-node.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN \

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY .cargo /code/.cargo
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY rust-toolchain.toml /code/rust-toolchain.toml
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-farmer
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN \

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY .cargo /code/.cargo
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY rust-toolchain.toml /code/rust-toolchain.toml
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-farmer.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN \

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY .cargo /code/.cargo
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY rust-toolchain.toml /code/rust-toolchain.toml
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-node
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN \

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY .cargo /code/.cargo
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY rust-toolchain.toml /code/rust-toolchain.toml
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-node.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN \

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY .cargo /code/.cargo
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY rust-toolchain.toml /code/rust-toolchain.toml
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-runtime
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN \

RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown

COPY .cargo /code/.cargo
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY rust-toolchain.toml /code/rust-toolchain.toml
Expand Down
8 changes: 4 additions & 4 deletions crates/subspace-proof-of-time/src/aes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! AES related functionality.
// TODO: Similarly optimized version for aarch64
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_feature = "aes"))]
mod x86_64;

#[cfg(not(feature = "std"))]
Expand All @@ -15,15 +15,15 @@ use subspace_core_primitives::{PotCheckpoints, PotKey, PotOutput, PotSeed};
/// Creates the AES based proof.
#[inline(always)]
pub(crate) fn create(seed: PotSeed, key: PotKey, checkpoint_iterations: u32) -> PotCheckpoints {
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_feature = "aes"))]
{
unsafe { x86_64::create(seed.as_ref(), key.as_ref(), checkpoint_iterations) }
}
#[cfg(not(target_arch = "x86_64"))]
#[cfg(not(all(target_arch = "x86_64", target_feature = "aes")))]
create_generic(seed, key, checkpoint_iterations)
}

#[cfg(any(not(target_arch = "x86_64"), test))]
#[cfg(any(not(all(target_arch = "x86_64", target_feature = "aes")), test))]
#[inline(always)]
fn create_generic(seed: PotSeed, key: PotKey, checkpoint_iterations: u32) -> PotCheckpoints {
let key = Array::from(*key);
Expand Down

0 comments on commit 7f91314

Please sign in to comment.