Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AES changes backport to stable #1192

Merged
merged 3 commits into from Jul 10, 2020
Merged

Conversation

jagerman
Copy link
Member

Backport of #1126 and #1191 to master.

The current debs on focal and sid can't sync through the cn-pico section of the chain because gcc 9.x no longer implies -maes for anything earlier than -march=skylake because some CPUs in generations before Skylake don't have it turned on.

With these changes:

  1. non-AES will be able to sync the chain
  2. binary builds will not require a CPU with AES, but the support will still be activated at runtime (for better performance) when the running CPU supports it.

(Obligatory rant: this is a result of Intel's bullshit of turning off CPU features on things below i7 for marketing reasons -- expensive Intel products get new instructions turned on, but cheap Intel products have to wait an incredible SIX generations before Intel actual enables the feature, despite being supported in the silicon).

Doy-lee and others added 3 commits July 9, 2020 21:42
inconsistent results. I desk checked against the ARM64 implementation
that does NOT used the +crypto extensions, meaning it is emulated in
software- That implementation is essentially the same as the portable
implementation, some minor differences in the pre-amble but correctly
uses the light flag.

Adapting that over allows us to sync past block 321280, which previously
emitted an "unexpected difficulty" error.

This code path was never excercised due to the '-maes' flag being forced
on via CMake. That was removed in this commit to make it specifiable by
the user.

oxen-io@17be0ed
Force aes instruction availability in the pico & heavy implementations;
they each have runtime checks that will ensure they are supported before
called, and so this allows creating a binary that supports both non-AES
and AES CPUs.

This also unifies some of the common cpuid checking code, and moves it
to a single global variable (previously pico used a somewhat inefficient
static local variable, and cn-heavy used a hugely inefficiently cpuid
call on every hash call).

Also removes the x86-specific __m128i code from cn_heavy_hash.hpp and
adds a simple wrapper for it in the intel-specific code instead.
Fix inverted logic, and rename it to something more descriptive.
@Doy-lee Doy-lee merged commit 0411599 into oxen-io:master Jul 10, 2020
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.

None yet

2 participants