File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,13 @@ import CpuFeatures from "cpu-features";
77// without setting this first, persistent-merkle-tree will use noble instead
88const cpuFeatures = CpuFeatures ( ) ;
99if (
10- cpuFeatures . arch === "x86" &&
11- ! ( cpuFeatures . flags . avx || cpuFeatures . flags . avx2 || cpuFeatures . flags . avx512f || cpuFeatures . flags . avx512vl )
10+ ( cpuFeatures . arch === "x86" &&
11+ ! (
12+ ( cpuFeatures . flags . avx512f && cpuFeatures . flags . avx512vl ) ||
13+ ( cpuFeatures . flags . avx2 && cpuFeatures . flags . bmi2 ) ||
14+ ( cpuFeatures . flags . avx && cpuFeatures . flags . sha )
15+ ) ) ||
16+ ( cpuFeatures . arch === "aarch64" && ! cpuFeatures . flags . sha2 )
1217) {
1318 console . log (
1419 "Hashtree hasher is preferred but the CPU architecture does not support AVX, AVX2 or the correct AVX512 instruction sets. Falling back to as-sha256 hasher instead."
Original file line number Diff line number Diff line change @@ -7,8 +7,13 @@ import CpuFeatures from "cpu-features";
77// without setting this first, persistent-merkle-tree will use noble instead
88const cpuFeatures = CpuFeatures ( ) ;
99if (
10- cpuFeatures . arch === "x86" &&
11- ! ( cpuFeatures . flags . avx || cpuFeatures . flags . avx2 || cpuFeatures . flags . avx512f || cpuFeatures . flags . avx512vl )
10+ ( cpuFeatures . arch === "x86" &&
11+ ! (
12+ ( cpuFeatures . flags . avx512f && cpuFeatures . flags . avx512vl ) ||
13+ ( cpuFeatures . flags . avx2 && cpuFeatures . flags . bmi2 ) ||
14+ ( cpuFeatures . flags . avx && cpuFeatures . flags . sha )
15+ ) ) ||
16+ ( cpuFeatures . arch === "aarch64" && ! cpuFeatures . flags . sha2 )
1217) {
1318 // biome-ignore lint/suspicious/noConsole: let consumer know that the default hasher is not supported
1419 console . log (
You can’t perform that action at this time.
0 commit comments