cryptoadvance / specter-diy

DIY airgapped hardware wallet that uses QR codes for communication with the host
MIT License
440 stars 73 forks source link

simulator does not work #189

Open chri2 opened 2 years ago

chri2 commented 2 years ago

Hardware: rock64 (pine64): ARMv8 Processor, 4GB ram Software: Linux rock64 4.4.190-1233-rockchip-ayufan-gd3f1be0ed310 #1 SMP Wed Aug 28 08:59:34 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"

make unix compiles without errors. make simulate finishes without errors until it tries to start bin/micropython_unix simulate.py.

rock64@rock64:~/specter-diy$ bin/micropython_unix simulate.py 
Traceback (most recent call last):
  File "simulate.py", line 7, in <module>
  File "./src/main.py", line 2, in <module>
  File "./src/specter.py", line 7, in <module>
  File "./src/platform.py", line 18, in <module>
MemoryError: memory allocation failed, allocating 1048577 bytes
rock64@rock64:~/specter-diy$ bin/micropython_unix -X heapsize=2500K simulate.py 
Traceback (most recent call last):
  File "simulate.py", line 7, in <module>
  File "./src/main.py", line 2, in <module>
  File "./src/specter.py", line 18, in <module>
  File "./src/hosts/__init__.py", line 1, in <module>
  File "./src/hosts/core.py", line 5, in <module>
  File "./src/gui/__init__.py", line 1, in <module>
  File "./src/gui/core.py", line 6, in <module>
  File "./src/gui/common.py", line 7, in <module>
  File "./src/gui/components/__init__.py", line 1, in <module>
RuntimeError: maximum recursion depth exceeded

Is this supposed to work?

stepansnigirev commented 2 years ago

I didn't test on arm, but I think it should work. I have a pi4 somewhere so let me check tomorrow and report back.

chri2 commented 2 years ago

Thanks a lot! I also tested on rpi2,1gb and rpi3,1gb using raspbian based on bullseye and on cubox. No success. But those two are armv7 and have very little memory. A CuBox-i 4X4 (armv7, 4GB, debian bullseye image provided by NXP) didn't make a difference. I would have tested on a rpi4,8gb if I would have had a hdmi-micro cable at hand.

To really run the simulator on one of those sbc I'd prefer the rock64 or the rpi2, because both of them just have an ethernet an no further wireless communication.

Maybe such a setup could make a good compromise for an (temporary) air-gapped wallet, given that the used storage (and maybe the spi flash) are erased/destroyed properly to prevent data leaks.

chri2 commented 2 years ago

I successfully build and ran the simulator on a Pinephone running mobian(bullseye).

Installed armbian focal (based on bullseye) on the rock64 - works.

The problem seems only to show on armv7 or armv8 running old software.