selfcustody / krux

Open-source signing device firmware for Bitcoin
https://selfcustody.github.io/krux/
Other
185 stars 37 forks source link

System optimizations #453

Closed odudex closed 1 month ago

odudex commented 2 months ago

Description

Problem: A damaged camera currently renders devices unusable.

Solution: This PR addresses the issue by allowing Krux to operate without a functioning camera and includes some performance optimizations.

Changes:

Other Optimizations

What is the purpose of this pull request?

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 94.96124% with 13 lines in your changes missing coverage. Please review.

Project coverage is 94.67%. Comparing base (4495164) to head (223d74f). Report is 22 commits behind head on develop.

Files with missing lines Patch % Lines
src/krux/pages/home_pages/sign_message_ui.py 93.25% 12 Missing :warning:
src/krux/camera.py 94.11% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #453 +/- ## =========================================== - Coverage 94.82% 94.67% -0.15% =========================================== Files 60 70 +10 Lines 7434 7575 +141 =========================================== + Hits 7049 7172 +123 - Misses 385 403 +18 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

odudex commented 1 month ago

Translation refactor reduces total firmware size in ~5% and increases free RAM at boot in ~3%

jdlcdl commented 1 month ago

I've visually reviewed the code changes in 30 files here.

Much of this I've tested on Amigo (whose camera works fine), but none since this pr was readied last week, nor any of the changes since "translation optimizations". Currently I'm having personal hw problems and cannot build for my amigo but I expect this to be resolved soon and will edit this message when done.

odudex commented 1 month ago

Thank you Jean! I also ended up adding new Sparrow's SD message signing feature here too, and this will require a few more tests to be written. I hope you have your hw issues solved without too much hassle 🙏.

jdlcdl commented 1 month ago

Message signing via qrcode and via sdcard with sparrow 2.0.0 worked fine for me. All tests passed since commit 4855a70 and poetry run poe pre-commit also completed successfully. I like the baked translations tables separated per locale so that krux is loading a much smaller module and the others -- or the last-one-used can be garbage-collected.