input-output-hk / mithril

Stake-based threshold multi-signatures protocol
https://mithril.network
Apache License 2.0
122 stars 37 forks source link

Fails to download a snapshot on preview #1475

Closed ffakenz closed 7 months ago

ffakenz commented 7 months ago

Context & versions

Using latest binaries released for linux: https://github.com/input-output-hk/mithril/releases/tag/2403.1

Steps to reproduce

$ echo $GENESIS_VERIFICATION_KEY
5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d

$ echo $SNAPSHOT_DIGEST
c4ef2898a1f135dfe0b87ea42e27f5bcb8043b80760a9e2a7e594676ced785c8

$ mithril-client snapshot download $SNAPSHOT_DIGEST --json --genesis-verification-key $GENESIS_VERIFICATION_KEY
{"timestamp": "2024-01-31T09:35:12.579456292+00:00", "step_num": 1, "total_steps": 5, "message": "Checking local disk info…"}
{"timestamp": "2024-01-31T09:35:12.579598145+00:00", "step_num": 2, "total_steps": 5, "message": "Fetching the certificate and verifying the certificate chain…"}
Illegal instruction (core dumped)

same using latest:

$ mithril-client snapshot download latest --json --genesis-verification-key $GENESIS_VERIFICATION_KEY
{"timestamp": "2024-01-31T09:43:47.383709815+00:00", "step_num": 1, "total_steps": 5, "message": "Checking local disk info…"}
{"timestamp": "2024-01-31T09:43:47.383829427+00:00", "step_num": 2, "total_steps": 5, "message": "Fetching the certificate and verifying the certificate chain…"}
Illegal instruction (core dumped)

Actual behavior

Can't download a snapshot (c4ef2898a1f135dfe0b87ea42e27f5bcb8043b80760a9e2a7e594676ced785c8) which I see valid in the explorer

Expected behavior

Expected a snapshot to have been downloaded.

ch1bo commented 7 months ago

@ffakenz Can you attach the core dump please?

jpraynaud commented 7 months ago

It looks like your are probably using a CPU that lacks Intel ADX instructions which is used internally by the Mithril STM library (and in particular by the BLST dependency).

A turnaround is to build the Mithril client from source.

Can you share the configuration of your machine?

jpraynaud commented 7 months ago

Also I successfully restored the snapshot on my computer:

$ mithril-client snapshot download c4ef2898a1f135dfe0b87ea42e27f5bcb8043b80760a9e2a7e594676ced785c8
1/5 - Checking local disk info…
2/5 - Fetching the certificate and verifying the certificate chain…                                                                                                                                
Certificate chain validated        
3/5 - Downloading and unpacking the snapshot…
[00:00:37] [#########################################################################################################################################################] 1.81 GiB/1.81 GiB (0.0s)
4/5 - Computing the snapshot message 
5/5 - Verifying the snapshot signature… 
Snapshot 'c4ef2898a1f135dfe0b87ea42e27f5bcb8043b80760a9e2a7e594676ced785c8' has been unpacked and successfully checked against Mithril multi-signature contained in the certificate.

Files in the directory 'db' can be used to run a Cardano node with version >= 8.7.3.

If you are using Cardano Docker image, you can restore a Cardano Node with:

docker run -v cardano-node-ipc:/ipc -v cardano-node-data:/data --mount type=bind,source="/home/jp/Downloads/client/db",target=/data/db/ -e NETWORK=preview ghcr.io/intersectmbo/cardano-node:8.7.3
ffakenz commented 7 months ago

@jpraynaud is this any helpful?

$ lscpu
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
Address sizes:                      46 bits physical, 48 bits virtual
CPU(s):                             8
On-line CPU(s) list:                0-7
Thread(s) per core:                 1
Core(s) per socket:                 8
Socket(s):                          1
NUMA node(s):                       1
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              63
Model name:                         Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
Stepping:                           2
CPU MHz:                            2399.930
BogoMIPS:                           4800.03
Hypervisor vendor:                  Xen
Virtualization type:                full
L1d cache:                          256 KiB
L1i cache:                          256 KiB
L2 cache:                           2 MiB
L3 cache:                           30 MiB
NUMA node0 CPU(s):                  0-7
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Mitigation: VMX unsupported
Vulnerability L1tf:                 Mitigation; PTE Inversion
Vulnerability Mds:                  Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx pdpe1gb rdtscp
                                    lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcn
                                    t tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti fsgsbase bmi1 avx2 smep bm
                                    i2 erms invpcid xsaveopt
jpraynaud commented 7 months ago

@jpraynaud is this any helpful?

$ lscpu
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
Address sizes:                      46 bits physical, 48 bits virtual
CPU(s):                             8
On-line CPU(s) list:                0-7
Thread(s) per core:                 1
Core(s) per socket:                 8
Socket(s):                          1
NUMA node(s):                       1
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              63
Model name:                         Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
Stepping:                           2
CPU MHz:                            2399.930
BogoMIPS:                           4800.03
Hypervisor vendor:                  Xen
Virtualization type:                full
L1d cache:                          256 KiB
L1i cache:                          256 KiB
L2 cache:                           2 MiB
L3 cache:                           30 MiB
NUMA node0 CPU(s):                  0-7
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Mitigation: VMX unsupported
Vulnerability L1tf:                 Mitigation; PTE Inversion
Vulnerability Mds:                  Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx pdpe1gb rdtscp
                                    lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcn
                                    t tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti fsgsbase bmi1 avx2 smep bm
                                    i2 erms invpcid xsaveopt

Yes, I see that the adx flag is not listed in your CPU Flags. Unfortunately, we don't currently provide binary out of the box for non ADX CPUs.

Can you make a test by building the binary from the same machine (you can find a guide in here)? The compiled binary should be working on your machine.

ffakenz commented 7 months ago

I can confirm that building the binary was successful for me!

Thanks to @jpraynaud for the support 🙏

jpraynaud commented 7 months ago

@ffakenz by any chance can you share the EC2 instance type that you are using?