Skip to content

Commit

Permalink
Merge pull request #25 from LedgerHQ/develop
Browse files Browse the repository at this point in the history
v0.8.4
  • Loading branch information
lpascal-ledger authored Aug 7, 2024
2 parents 932e2cf + 43b4a1b commit 9d40962
Show file tree
Hide file tree
Showing 453 changed files with 217 additions and 178 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
version: ${{ steps.store-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- run: make version
Expand Down
92 changes: 82 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
image: zondax/rust-ci:latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Cache/restore Cargo dependencies
Expand All @@ -43,7 +43,7 @@ jobs:
image: zondax/rust-ci:latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Cache/restore Cargo dependencies
Expand All @@ -70,7 +70,7 @@ jobs:
size: ${{steps.build.outputs.size}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build Standard app
Expand All @@ -92,7 +92,7 @@ jobs:
size: ${{steps.build.outputs.size}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build Production app
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
tests: ${{ steps.get-tests.outputs.tests }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
BOLOS_SDK: /opt/nanos-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install deps
Expand All @@ -208,7 +208,7 @@ jobs:
- name: Build NanoS
shell: bash -l {0}
run: |
make
make PRODUCTION_BUILD=0
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh
- name: Set tag
id: nanos
Expand All @@ -235,7 +235,7 @@ jobs:
BOLOS_SDK: /opt/nanosplus-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install deps
Expand All @@ -244,7 +244,7 @@ jobs:
- name: Build NanoSP
shell: bash -l {0}
run: |
make
make PRODUCTION_BUILD=0
mv ./app/pkg/installer_s2.sh ./app/pkg/installer_nanos_plus.sh
- name: Set tag
id: nanosp
Expand All @@ -259,3 +259,75 @@ jobs:
tag_name: ${{ steps.nanosp.outputs.tag_name }}
draft: false
prerelease: false

build_package_stax:
needs: [configure, build_ledger, tests_zemu_setup, test_zemu, rust_tests]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: /opt/stax-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install deps
run: pip install ledgerblue

- name: Build Stax
shell: bash -l {0}
run: |
make PRODUCTION_BUILD=0
- name: Set tag
id: stax
run: echo "tag_name=$(./app/pkg/installer_stax.sh version)" >> $GITHUB_OUTPUT
- name: Update Release
id: update_release_3
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
files: |
./app/pkg/installer_stax.sh
tag_name: ${{ steps.stax.outputs.tag_name }}
draft: false
prerelease: false

build_package_flex:
needs: [configure, build_ledger, tests_zemu_setup, test_zemu, rust_tests]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: /opt/flex-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install deps
run: pip install ledgerblue

- name: Build Flex
shell: bash -l {0}
run: |
make PRODUCTION_BUILD=0
- name: Set tag
id: flex
run: echo "tag_name=$(./app/pkg/installer_flex.sh version)" >> $GITHUB_OUTPUT
- name: Update Release
id: update_release_3
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
files: |
./app/pkg/installer_flex.sh
tag_name: ${{ steps.flex.outputs.tag_name }}
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Install node
Expand Down
15 changes: 3 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
[submodule "deps/ledger-rust"]
path = deps/ledger-rust
url = https://github.com/Zondax/ledger-rust
[submodule "deps/nanos-secure-sdk"]
path = deps/nanos-secure-sdk
url = https://github.com/LedgerHQ/nanos-secure-sdk
[submodule "deps/nanox-secure-sdk"]
path = deps/nanox-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk
[submodule "deps/nanosplus-secure-sdk"]
path = deps/nanosplus-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk
[submodule "deps/ledger-zxlib"]
path = deps/ledger-zxlib
url = https://github.com/Zondax/ledger-zxlib.git
[submodule "deps/stax-secure-sdk"]
path = deps/stax-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk
[submodule "cmake/cmake-modules"]
path = cmake/cmake-modules
url = https://github.com/bilke/cmake-modules
[submodule "deps/ethereum"]
path = deps/ethereum
url = https://github.com/Zondax/app-ethereum.git
[submodule "deps/ledger-secure-sdk"]
path = deps/ledger-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ ifeq ($(BOLOS_SDK),)
# In this case, there is not predefined SDK and we run dockerized
# When not using the SDK, we override and build the XL complete app

ZXLIB_COMPILE_STAX ?= 1
# by default builds are not production ready
PRODUCTION_BUILD ?= 1

include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk

else
Expand All @@ -41,8 +38,8 @@ endif

test_all:
make clean
make PRODUCTION_BUILD=1
make zemu_install
make
make zemu_test

prod:
Expand Down
36 changes: 19 additions & 17 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ifeq ($(PRODUCTION_BUILD), 1)
$(info ************ PRODUCTION_BUILD = [PRODUCTION BUILD])
else
$(info ************ PRODUCTION_BUILD = [INTERNAL USE])
endif
endif

DEFINES += PRODUCTION_BUILD=$(PRODUCTION_BUILD)

Expand Down Expand Up @@ -69,6 +69,13 @@ endif

APP_LOAD_PARAMS = $(COMMON_LOAD_PARAMS) --curve secp256k1

# Configure minimun stack size
ifeq ($(TARGET_NAME),TARGET_NANOS)
APP_STACK_MIN_SIZE := 1752
else
APP_STACK_MIN_SIZE := 2000
endif

include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices

$(info TARGET_NAME = [$(TARGET_NAME)])
Expand All @@ -82,13 +89,6 @@ endif
DEFINES += HAVE_HASH HAVE_BLAKE2
INCLUDES_PATH += $(BOLOS_SDK)/lib_cxng/src

# Configure minimun stack size
ifeq ($(TARGET_NAME),TARGET_NANOS)
APP_STACK_MIN_SIZE := 1752
else
APP_STACK_MIN_SIZE := 2000
endif

ifeq ($(APP_TESTING), 1)
DEFINES += APP_TESTING ZEMU_LOGGING
$(info ************ LOGGING ENABLED ************)
Expand All @@ -99,24 +99,29 @@ ifeq ($(TARGET_NAME), TARGET_NANOS)
RUST_TARGET := thumbv6m-none-eabi
APP_FULL := 1
APP_SOURCE_PATH += $(MY_DIR)/../deps/zxlib/view_s.c
RUST_TARGET_NAME := TARGET_NANOS
endif

ifeq ($(TARGET_NAME), TARGET_NANOX)
RUST_TARGET := thumbv6m-none-eabi
APP_FULL := 1
RUST_TARGET_NAME := TARGET_NANOX
endif

ifeq ($(TARGET_NAME), TARGET_NANOS2)
RUST_TARGET := thumbv6m-none-eabi
APP_FULL := 1
RUST_TARGET_NAME := TARGET_NANOS2
endif

ifeq ($(TARGET_NAME), TARGET_STAX)
NBGL_TARGETS := TARGET_STAX TARGET_FLEX
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME), $(NBGL_TARGETS)))
RUST_TARGET := thumbv6m-none-eabi
APP_FULL := 1
DEFINES += ICONGLYPH=C_icon_stax_64
DEFINES += ICONBITMAP=C_icon_stax_64
DEFINES += ICONGLYPH_SMALL=C_icon_stax_32
RUST_TARGET_NAME := TARGET_STAX
endif

ifeq ($(APP_TESTING), 1)
Expand All @@ -140,7 +145,7 @@ CFLAGS += -DMAJOR_VERSION=$(APPVERSION_M) -DMINOR_VERSION=$(APPVERSION_N) -DPATC
ifeq (,$(filter $(TARGET_NAME),TARGET_NANOS))
DEFINES += HAVE_ETH_INTEGRATION HAVE_ETH2 USE_LIB_ETHEREUM
DEFINES += HAVE_BYPASS_SIGNATURES
# commented out as we no longer use app-ethereum
# commented out as we no longer use app-ethereum
# for handling erc20 tokens.
# DEFINES += HAVE_CONTRACT_NAME_IN_DESCRIPTOR
HAVE_EIP712_FULL_SUPPORT = 1
Expand All @@ -151,9 +156,6 @@ DEFINES += TICKER=\"$(TICKER)\"
DEFINES += HAVE_BOLOS_APP_STACK_CANARY HAVE_HASH3
DEFINES += HAVE_DYN_MEM_ALLOC

ETH_GLYPHS = $(MY_DIR)/../deps/ethereum/glyphs
GLYPH_FILES += $(addprefix $(ETH_GLYPHS)/,$(sort $(notdir $(shell find $(ETH_GLYPHS)/))))

DEFINES += BIP44_COIN_TYPE_3=60 COIN_COINID_SHORT=\"AVAX\"
DEFINES += HAVE_SNPRINTF_FORMAT_U IO_HID_EP_LENGTH=64
DEFINES += HAVE_U2F HAVE_IO_U2F U2F_PROXY_MAGIC=\"w0w\"
Expand All @@ -169,7 +171,7 @@ INCLUDES_PATH += $(MY_DIR)/../deps/ethereum/src_features/
INCLUDES_PATH += $(MY_DIR)/../deps/ethereum/src_plugins/

ETHEREUM_SRC_DIR := $(MY_DIR)/../deps/ethereum/src
# With the line bellow we remove app-ethereum/src/main.c file from our sources
# With the line bellow we remove app-ethereum/src/main.c file from our sources
ETHEREUM_SRC_FILES := $(filter-out $(ETHEREUM_SRC_DIR)/main.c, $(shell find $(ETHEREUM_SRC_DIR) -name '*.c'))
APP_SOURCE_PATH += $(ETHEREUM_SRC_FILES)
APP_SOURCE_PATH += $(MY_DIR)/../deps/ethereum/src_features
Expand All @@ -178,7 +180,7 @@ APP_SOURCE_PATH += $(MY_DIR)/../deps/ethereum/ethereum-plugin-sdk

SDK_SOURCE_PATH += lib_u2f lib_standard_app

ifeq ($(TARGET_NAME), TARGET_STAX)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME), $(NBGL_TARGETS)))
NBGL_SRC_DIR := $(MY_DIR)/../deps/ethereum/src_nbgl
NBGL_SRC_FILES := $(filter-out $(NBGL_SRC_DIR)/network_icons.c, $(shell find $(NBGL_SRC_DIR) -name '*.c'))
NBGL_SRC_FILES := $(filter-out $(NBGL_SRC_DIR)/ui_idle.c, $(NBGL_SRC_FILES))
Expand All @@ -199,7 +201,7 @@ LDFLAGS += -L$(BOLOS_SDK)/lib_cxng

DEFINES += FEATURE_ETH=$(FEATURE_ETH)

# not present in app-ethereum/master but in develop branch
# not present in app-ethereum/master but in develop branch
# so it could be needed once develop gets revased onto master
# include $(CURDIR)/../deps/ethereum/makefile_conf/features.mk

Expand Down Expand Up @@ -233,7 +235,7 @@ APP_CUSTOM_LINK_DEPENDENCIES := rust

.PHONY: rust
rust:
cd rust && RUSTC_BOOTSTRAP=1 CARGO_HOME="$(CURDIR)/rust/.cargo" TARGET_NAME=$(TARGET_NAME) ZEMU_LOGGING=$(ZEMU_LOGGING) \
cd rust && RUSTC_BOOTSTRAP=1 CARGO_HOME="$(CURDIR)/rust/.cargo" TARGET_NAME=$(RUST_TARGET_NAME) ZEMU_LOGGING=$(ZEMU_LOGGING) \
cargo build --release --target $(RUST_TARGET) \
--no-default-features $(RUST_FEATURES)

Expand Down
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=0
# Minor
APPVERSION_N=8
# Patch
APPVERSION_P=3
APPVERSION_P=4
Binary file added app/flex_icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9d40962

Please sign in to comment.