Skip to content

chore(deps): bump vendored minio/sha256-simd to v1.0.1 + klauspost/cpuid/v2 to v2.2.3#42

Open
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:chore/deps/sha256-simd-v1.0.1
Open

chore(deps): bump vendored minio/sha256-simd to v1.0.1 + klauspost/cpuid/v2 to v2.2.3#42
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:chore/deps/sha256-simd-v1.0.1

Conversation

@moralpriest

Copy link
Copy Markdown

Summary

Coupled bump of github.com/minio/sha256-simd (old → v1.0.1) and github.com/klauspost/cpuid/v2 (v2.0.6 → v2.2.3). sha256-simd v1.0.1 requires cpuid/v2 v2.2.3 (CPU feature detection for SIMD code-path selection). Both target go <=1.17 (1.17 + 1.15), so this is a clean standalone prep PR — part of the dependency-prep track ahead of a future Go toolchain bump (see #40, #41).

Why it matters (consensus-critical)

minio/sha256-simd backs the SHA-256 calls in astrobwt/astrobwtv3/pow.go:

  • sha256.Sum256(input) at pow.go:52 — the first step of AstroBWTv3 PoW (seeds Salsa20 key).
  • sha256.Sum256(buf) at pow.go:45 — panic-recovery fallback hash.
  • sa_fast.go — miner fast path (suffix array construction).

klauspost/cpuid/v2 selects the fastest SHA-256 implementation at runtime (AVX2/AVX512/SHA-NI). SHA-256 is a fixed standard (FIPS 180-4), so byte output is unchanged regardless of which SIMD path cpuid selects — only performance differs.

Verification (all 4 layers pass)

  • Build: go build ./... green
  • L1 hash vectors: new TestSha256SimdNistVectors (NIST FIPS 180-4 vectors: "abc", empty, 56-byte, 112-byte two-block) — PASS
  • L2 AstroBWTv3: TestAstroBWTv3 + TestAstroBWTv3repeattest (full PoW vectors) — PASS
  • L4 miner: standalone dero-miner built from this branch connected to derod --testnet getwork server, received work, and began AstroBWTv3 hashing with the bumped libs — PASS

Notes

  • Vendored sha256blockSha_amd64.{go,s,_test.go} renamed to sha256block_amd64.* upstream; sha256-simd/.github/workflows/go.yml and .gitignore, plus cpuid/v2/testdata/ and .github/ noise, removed (not needed in vendor).
  • Pre-existing unrelated go vet warnings in astrobwt/astrobwt.go:48,86 ("unreachable code", same idiom as cmd/derod/main.go:1064) left untouched to keep the PR focused.

🤖 Generated with opencode

…uid/v2 to v2.2.3

Coupled bump: sha256-simd v1.0.1 requires cpuid/v2 v2.2.3 (CPU feature
detection for SIMD code-path selection). Both target go <=1.17 (1.17 + 1.15).

Consensus-critical: minio/sha256-simd backs the SHA-256 calls in
astrobwt/astrobwtv3/pow.go (AstroBWTv3 PoW key derivation + fallback hash)
and sa_fast.go (miner fast path). klauspost/cpuid/v2 selects the fastest
SHA-256 implementation at runtime. SHA-256 is a fixed standard (FIPS 180-4),
so byte output is unchanged regardless of SIMD path chosen.

Verification:
- Build green: `go build ./...`
- L1 hash vectors: new TestSha256SimdNistVectors (NIST FIPS 180-4 vectors) PASS
- L2 AstroBWTv3: TestAstroBWTv3 + TestAstroBWTv3repeattest PASS (full PoW vectors)
- L4 miner: standalone dero-miner (built from this branch) connected to derod
  --testnet getwork server and received work (AstroBWTv3 hashing with bumped libs)

Pre-existing unrelated `go vet` warnings in astrobwt/astrobwt.go:48,86
(unreachable code, same idiom as cmd/derod/main.go:1064) left untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant