Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Build fails - map_or in basic-authority #11667

Closed
ldeffenb opened this issue Apr 30, 2020 · 7 comments
Closed

Build fails - map_or in basic-authority #11667

ldeffenb opened this issue Apr 30, 2020 · 7 comments

Comments

@ldeffenb
Copy link

  • OpenEthereum version: latest source
  • Operating system: Linux
  • Installation: builing from source
  • Fully synchronized: N/A
  • Network: ropsten (once I get it up again)
  • Restarted: N/A

Did the following commands from the readme to build from source.

$ git clone https://github.com/openethereum/openethereum
$ cd openethereum
$ cargo build --release --features final

And the build fails with the following messages:

Compiling basic-authority v0.1.0 (/home/ldeffenb/openethereum/ethcore/engines/basic-authority)
error[E0599]: no method named map_or found for type std::result::Result<&std::vec::Vec<EmptyStep>, &rlp::error::DecoderError> in the current scope
--> ethcore/engines/authority-round/src/lib.rs:1283:58
|
1283 | let empty_steps = header_empty_steps(header).as_ref().map_or(String::new(), |empty_steps| {
| ^^^^^^ help: there is a method with a similar name: map_err

error: aborting due to previous error

I cannot run the pre-built binary as it fails with an "illegal instruction" in my Ubuntu VM.

The old parity-tech\parity builds just fine on this machine, so I believe my rust environment is up to date. Unfortunately the newly-downloaded pre-built parity from openethereum updated my database BEFORE crashing, so I need to build one that works with the updated database.

@dvdplm
Copy link
Collaborator

dvdplm commented Apr 30, 2020

Hmm, builds fine here. I'm at commit 748a8e384 and rustc 1.45.0-nightly (e83f75634 2020-04-26). Also works with stable at rustc 1.43.0 (4fb7144ed 2020-04-20).

The migration in openethereum 3 is not irreversible so you can manually edit overlayrecent/db_version from 15 to 14 if you want to run the db with the 2.7.2 release (not officially supported ofc! ;)

illegal instruction likely means that the aesni cryptographic instructions are not available. Maybe there's a way to tell your VM supervisor to pass through the proper CPU capabilities to your guest OS?

@ldeffenb
Copy link
Author

My rustc is at rustc 1.40.0 (73528e339 2019-12-16), so I'll see if upgrading it helps.

@ldeffenb
Copy link
Author

Ok, a rustup update got me 1.43.0 which builds openethereum fine. But now I"m back to:

59324 Illegal instruction (core dumped)

Now, how exactly to I build it "the issue should be solved by building from source for your architecture." as mentioned in issue 9684 (https://github.com/openethereum/openethereum/issues/9684)?

Just did an "export PORTABLE=OFF" followed by cargo clean followed by "cargo build --release --features final" and I'm waiting for it to get done. Last time was 59 minutes.

@ldeffenb
Copy link
Author

BTW, with the crashing build, openethereum works with --version and/or --help, but crashes if it tries to actually DO something.

@ldeffenb
Copy link
Author

lscpu gives:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 4
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 26
Model name: Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz
Stepping: 5
CPU MHz: 2806.390
BogoMIPS: 5612.78
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0-7
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf pni ssse3 cx16 sse4_1 sse4_2 x2apic popcnt hypervisor lahf_lm pti dtherm ida

cat /proc/cpuinfo gives 8 copies of:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz
stepping : 5
microcode : 0x11
cpu MHz : 2806.390
cache size : 8192 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf pni ssse3 cx16 sse4_1 sse4_2 x2apic popcnt hypervisor lahf_lm pti dtherm ida
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5612.78
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

@ldeffenb
Copy link
Author

Looks like 11395 might have a clue...

https://github.com/openethereum/openethereum/issues/11395

I'm afraid the new versions require the aes-ni CPU feature. You could try to build the binary from source and remove this and perhaps enable target-cpu=native.

"this" links to
https://github.com/openethereum/openethereum/blob/be5db14160e2aa04a64f1a8fe027ad58c2f42c44/.cargo/config

But no details on where/how to "enable target-cpu=native".

@ldeffenb
Copy link
Author

That worked. The key for me was to edit .cargo/config and remove the +aes from the rustflags setting in the [target.x86_64-unknown-linux-gnu] section.

Before: rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
After: rustflags = ["-Ctarget-feature=+sse2,+ssse3"]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants