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

Sync master branch to 2.2.4 #272

Merged
merged 59 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e043a15
NBGL: replace C_round_warning_64px with C_Important_Circle_64px
sgliner-ledger Apr 4, 2024
f1df9d5
NBGL: change ui to use flex compatible useCase
sgliner-ledger Apr 11, 2024
5bdb02b
Tests: update with latest changes
sgliner-ledger Apr 23, 2024
5b29711
manifest: add flex support
sgliner-ledger Apr 17, 2024
348d917
Tests: update snapshots
sgliner-ledger Apr 26, 2024
f1cad11
Add missing flex screenshot for dashboard
bigspider Jun 3, 2024
e589d75
Merge pull request #256 from LedgerHQ/sgl/flex-porting
bigspider Jun 3, 2024
e9d3a4b
fix-txmaker
bigspider Jun 5, 2024
ec0ca4a
Merge pull request #260 from LedgerHQ/fix-txmaker
bigspider Jun 6, 2024
41f5254
Add AUTOAPPROVE_FOR_PERF_TESTS command line option to Makefile
bigspider Jun 17, 2024
75fa3e8
Add initial set of performance tests
bigspider Jun 18, 2024
8598837
Add performance report to the CI
bigspider Jun 18, 2024
9444356
Generalize txmaker to most supported policies
bigspider Jun 19, 2024
30967e5
Generalize txmaker to key expressions with <NUM;NUM>/*
bigspider Jun 19, 2024
b380c9b
Delete legacy tests using the txmaker
bigspider Jun 19, 2024
bcbbfa3
Remove ragger screenshots in tests with synthetic data
bigspider Jun 19, 2024
02767c2
Add psbt and screenshot for test_sign_psbt_singlesig_large_amount
bigspider Jun 19, 2024
50e554b
Update flex screenshots
bigspider Jun 19, 2024
4bc144a
Merge pull request #261 from LedgerHQ/perftests
bigspider Jun 19, 2024
034a1f2
Remove nanos from CI workflow; added missing flex compilation target
bigspider Jun 20, 2024
3bd5a56
Tests for the legacy app need to still be done on Nano S, as they are…
bigspider Jun 26, 2024
1e3ed81
Remove Nano S compilation from the Makefile
bigspider Jun 20, 2024
f14331d
Delete Nano S icon
bigspider Jun 20, 2024
0e50996
Delete USE_NVRAM_STASH and related code
bigspider Jun 20, 2024
42ddd2a
Delete USE_CXRAM_STASH and related optimizations
bigspider Jun 20, 2024
16c2ce0
Revert code size optimizations for base58
bigspider Jun 20, 2024
90f8f29
Removed all code paths for TARGET_NANOS; deleted test code targeting …
bigspider Jun 20, 2024
8336f0a
Remove hacks to avoid divisions
bigspider Jun 20, 2024
e4f880e
Make sure 'make clean' works even if the target is 'nanos'
bigspider Jun 26, 2024
fd0b095
Fix sonarcloud build
bigspider Jun 26, 2024
8d9309f
Disable dashboard test that doesn't work on flex
bigspider Jun 26, 2024
3d66a7d
Nit from code review
bigspider Jun 26, 2024
1a5b170
Merge pull request #262 from LedgerHQ/goodbye-nanos
bigspider Jun 26, 2024
7e4acf4
Split process_outputs into two separate preprocess_outputs and displa…
bigspider Jun 28, 2024
721ec16
Add simplified transaction validation on devices with a large screen …
bigspider Jul 2, 2024
e2a1e18
Simplify and refactor swap code.
bigspider Jul 3, 2024
3ccbf62
Use cached output info if available
bigspider Jul 3, 2024
705f4d2
Move wallet policy header into the global transaction signing state
bigspider Jul 3, 2024
6c2be42
Incorporate warnings in the simplified transaction UX
bigspider Jul 4, 2024
d239361
Update self-transfer screen; support self-transfers in the simplified…
bigspider Jul 5, 2024
aff17b2
Updated sign_psbt tests to reflect the new UX.
bigspider Jul 5, 2024
3d754f7
Increase threshold for high-fee-warning to 100k sats instead of 10k sats
bigspider Jul 8, 2024
622b04e
Format transaction amounts as "<amount> TICKER" on large screens
bigspider Jul 8, 2024
bb59e60
Align wording of the 'send transaction' flow to design guidelines
bigspider Jul 8, 2024
81f6efd
Show the 'Processing...' spinner immediately when signing starts, ins…
bigspider Jul 8, 2024
c0ffdb6
Remove obsolete code
bigspider Jul 8, 2024
a03429b
Introduce a limit of 10 keys in a supported wallet policy
bigspider Jul 8, 2024
128786b
Revamp and simplify the 'register wallet policy' when using NBGL
bigspider Jul 9, 2024
783aa15
Update wallet policy registration tests
bigspider Jul 9, 2024
67f4135
Update wording 'wallet policy' ==> 'account' also for BAGL devices
bigspider Jul 9, 2024
4023ff8
Update test with the new key limit of 10
bigspider Jul 9, 2024
4b1f0e0
Fix formatting of OP_RETURN outputs with a data push for 0x00
bigspider Jul 9, 2024
1852840
Bump version to 2.2.4; update CHANGELOG.md
bigspider Jul 9, 2024
13cca55
Update speculos automation strings
bigspider Jul 9, 2024
e9c355d
Initialize array (deal with false positive in clang static analyzer)
bigspider Jul 9, 2024
0886412
Update address verification flow to use the standard NBGL api; switch…
bigspider Jul 10, 2024
a314da7
Update ragger snapshots
bigspider Jul 9, 2024
40c3623
Update Stax snapshots to API level 21
bigspider Jul 12, 2024
f17c7fd
Merge pull request #270 from LedgerHQ/revamp
bigspider Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
71 changes: 65 additions & 6 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ on:

jobs:
job_build:
name: Compilation for NanoS, X, S+, and Stax
name: Compilation for X, S+, Stax and Flex

strategy:
matrix:
include:
- model: nanos
SDK: "$NANOS_SDK"
- model: nanox
SDK: "$NANOX_SDK"
- model: nanosp
SDK: "$NANOSP_SDK"
- model: stax
SDK: "$STAX_SDK"
- model: flex
SDK: "$FLEX_SDK"

runs-on: ubuntu-latest

Expand Down Expand Up @@ -53,6 +53,28 @@ jobs:
name: bitcoin-testnet-app-${{ matrix.model }}
path: bitcoin-testnet-bin

job_build_app_perftest:
name: Compile the UX-less version of the app on Nano S+ for performance tests

runs-on: ubuntu-latest

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

steps:
- name: Clone
uses: actions/checkout@v2

- name: Build
run: |
make DEBUG=0 COIN=bitcoin_testnet BOLOS_SDK="$NANOSP_SDK" AUTOAPPROVE_FOR_PERF_TESTS=1

- name: Upload Bitcoin Testnet app binary
uses: actions/upload-artifact@v2
with:
name: bitcoin-testnet-perftest-app-nanosp
path: bin

job_unit_test:
name: Unit test
needs: job_build
Expand Down Expand Up @@ -105,10 +127,10 @@ jobs:
strategy:
matrix:
include:
- model: nanos
- model: nanox
- model: nanosp
- model: stax
- model: flex

needs: job_build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -164,8 +186,45 @@ jobs:
run: |
cd bitcoin_client/tests
pip install -r requirements.txt
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --timeout=300
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --timeout=300 --model=nanos

job_perftests:
name: Performance report

needs: job_build_app_perftest
runs-on: ubuntu-latest

container:
image: ghcr.io/ledgerhq/app-bitcoin-new/speculos-bitcoin:latest
ports:
- 1234:1234
- 9999:9999
- 40000:40000
- 41000:41000
- 42000:42000
- 43000:43000
options: --entrypoint /bin/bash

steps:
- name: Clone
uses: actions/checkout@v2

- name: Download Bitcoin app binary for perftests
uses: actions/download-artifact@v2
with:
name: bitcoin-testnet-perftest-app-nanosp
path: bin

- name: Run tests
run: |
cd tests_perf
pip install -r requirements.txt
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --model=nanosp --benchmark-json=benchmarks.json
- name: Upload benchmarks summary
uses: actions/upload-artifact@v2
with:
name: benchmarks-log
path: tests_perf/benchmarks.json

job_test_js_lib:
name: Tests with the JS library
Expand Down Expand Up @@ -199,7 +258,7 @@ jobs:
- name: Download Bitcoin Testnet app binary
uses: actions/download-artifact@v2
with:
name: bitcoin-testnet-app-nanos
name: bitcoin-testnet-app-nanosp
path: bin

- name: Run tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codeql-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
strategy:
matrix:
include:
- SDK: "$NANOS_SDK"
b0l0k marked this conversation as resolved.
Show resolved Hide resolved
artifact: boilerplate-app-nanoS
- SDK: "$NANOX_SDK"
artifact: boilerplate-app-nanoX
- SDK: "$NANOSP_SDK"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
gcovr --root .. --sonarqube coverage.xml
- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make TARGET=nanosp
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"*.h": "c"
},
"C_Cpp.clang_format_path": "/usr/bin/clang-format",
"editor.formatOnSave": true
"editor.formatOnSave": true,
"ledgerDevTools.appSettings": {
"selectedUseCase": "release"
}
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Dates are in `dd-mm-yyyy` format.

## [2.2.4] - 09-07-2024

### Changed

- Major revamp of the UI for transaction signing and wallet policy registration on Stax. Changed "wallet policy" with the simpler wording "account".
- Slight performance improvements in the signing flow.
- Added a technical limit of at most 10 distinct cosigners in a wallet policy.

### Fixed

- OP_RETURN outputs with a `0x00` data push were incorrectly rejected.

## [2.2.3] - 06-05-2024

### Added
Expand Down
80 changes: 42 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PATH_SLIP21_APP_LOAD_PARAMS = "LEDGER-Wallet policy"
# Application version
APPVERSION_M = 2
APPVERSION_N = 2
APPVERSION_P = 3
APPVERSION_P = 4
APPVERSION_SUFFIX = # if not empty, appended at the end. Do not add a dash.

ifeq ($(APPVERSION_SUFFIX),)
Expand All @@ -56,6 +56,13 @@ else
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)-$(strip $(APPVERSION_SUFFIX))"
endif

# If set, the app will automatically approve all requests without user interaction. Useful for performance tests.
# It is critical that no such app is ever deployed in production.
AUTOAPPROVE_FOR_PERF_TESTS ?= 0
ifneq ($(AUTOAPPROVE_FOR_PERF_TESTS),0)
DEFINES += HAVE_AUTOAPPROVE_FOR_PERF_TESTS
endif

# Setting to allow building variant applications
VARIANT_PARAM = COIN
VARIANT_VALUES = bitcoin_testnet bitcoin
Expand All @@ -74,41 +81,50 @@ HAVE_APPLICATION_FLAG_BOLOS_SETTINGS = 1
HAVE_APPLICATION_FLAG_LIBRARY = 1

ifeq ($(COIN),bitcoin_testnet)

# Bitcoin testnet, no legacy support
DEFINES += BIP32_PUBKEY_VERSION=0x043587CF
DEFINES += BIP44_COIN_TYPE=1
DEFINES += COIN_P2PKH_VERSION=111
DEFINES += COIN_P2SH_VERSION=196
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"tb\"
DEFINES += COIN_COINID_SHORT=\"TEST\"

APPNAME = "Bitcoin Test"

# Bitcoin testnet, no legacy support
DEFINES += BIP32_PUBKEY_VERSION=0x043587CF
DEFINES += BIP44_COIN_TYPE=1
DEFINES += COIN_P2PKH_VERSION=111
DEFINES += COIN_P2SH_VERSION=196
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"tb\"
DEFINES += COIN_COINID_SHORT=\"TEST\"

APPNAME = "Bitcoin Test"
else ifeq ($(COIN),bitcoin)

# Bitcoin mainnet, no legacy support
DEFINES += BIP32_PUBKEY_VERSION=0x0488B21E
DEFINES += BIP44_COIN_TYPE=0
DEFINES += COIN_P2PKH_VERSION=0
DEFINES += COIN_P2SH_VERSION=5
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"bc\"
DEFINES += COIN_COINID_SHORT=\"BTC\"

APPNAME = "Bitcoin"
# the version for performance tests automatically approves all requests
# there is no reason to ever compile the mainnet app with this flag
ifneq ($(AUTOAPPROVE_FOR_PERF_TESTS),0)
$(error Use testnet app for performance tests)
endif

# Bitcoin mainnet, no legacy support
DEFINES += BIP32_PUBKEY_VERSION=0x0488B21E
DEFINES += BIP44_COIN_TYPE=0
DEFINES += COIN_P2PKH_VERSION=0
DEFINES += COIN_P2SH_VERSION=5
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"bc\"
DEFINES += COIN_COINID_SHORT=\"BTC\"

APPNAME = "Bitcoin"

else
ifeq ($(filter clean,$(MAKECMDGOALS)),)
$(error Unsupported COIN - use bitcoin_testnet, bitcoin)
ifeq ($(filter clean,$(MAKECMDGOALS)),)
$(error Unsupported COIN - use bitcoin_testnet, bitcoin)
endif
endif

ifneq (,$(filter-out clean,$(MAKECMDGOALS)))
ifeq ($(TARGET_NAME),TARGET_NANOS)
$(error This branch is not compatible with the Nano S device. Checkout the 'nanos' branch for the latest code for Nano S.)
endif
endif

# Application icons following guidelines:
# https://developers.ledger.com/docs/embedded-app/design-requirements/#device-icon
ICON_NANOS = icons/nanos_app_bitcoin.gif
ICON_NANOX = icons/nanox_app_bitcoin.gif
ICON_NANOSP = icons/nanox_app_bitcoin.gif
ICON_STAX = icons/stax_app_bitcoin.gif
ICON_FLEX = icons/flex_app_bitcoin.gif

########################################
# Application communication interfaces #
Expand All @@ -133,19 +149,7 @@ DISABLE_DEFAULT_IO_SEPROXY_BUFFER_SIZE = 1
DEFINES += HAVE_BOLOS_APP_STACK_CANARY


ifeq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=72
DEFINES += HAVE_WALLET_ID_SDK
else
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300
endif

ifeq ($(TARGET_NAME),TARGET_NANOS)
# enables optimizations using the shared 1K CXRAM region
DEFINES += USE_CXRAM_SECTION
# enables usage of the NVRAM to free up some RAM
DEFINES += USE_NVRAM_STASH
endif
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300

# debugging helper functions and macros
CFLAGS += -include debug-helpers/debug.h
Expand Down
2 changes: 0 additions & 2 deletions bitcoin_client_js/src/__tests__/appClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ describe("test AppClient", () => {
beforeEach(async () => {
sp = spawn(speculos_path, [
repoRootPath + "/bin/app.elf",
'-k', '2.1',
'--model', 'nanos',
'--display', 'headless'
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 1,
"rules": [
{
"regexp": "Register wallet|Wallet name|Wallet policy|Key",
"regexp": "Register account|Account name|Wallet policy|Key",
"actions": [
["button", 2, true],
["button", 2, false]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 1,
"rules": [
{
"regexp": "Spend from|Wallet name|Review|Amount|Address|Fees",
"regexp": "Spend from|Account name|Review|Amount|Address|Fees",
"actions": [
["button", 2, true],
["button", 2, false]
Expand Down
Binary file added icons/flex_app_bitcoin.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/nanos_app_bitcoin.gif
Binary file not shown.
2 changes: 1 addition & 1 deletion ledger_app.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanos", "nanox", "nanos+", "stax"]
devices = ["nanox", "nanos+", "stax", "flex"]

[tests]
unit_directory = "./unit-tests/"
Expand Down
Loading
Loading