Skip to content

Remove static networks#1044

Draft
cedelavergne-ledger wants to merge 6 commits into
developfrom
cev/remove_static_networks
Draft

Remove static networks#1044
cedelavergne-ledger wants to merge 6 commits into
developfrom
cev/remove_static_networks

Conversation

@cedelavergne-ledger

Copy link
Copy Markdown
Contributor

Description

  • Remove static networks, rely on dynamic networks only
  • Drop generated static network icons
  • Resolve swap fee ticker from chain config

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

elf sizes
source = source branch cev/remove_static_networks
target = target branch develop

Device .text source .text target .text delta .bss source .bss target .bss delta max stack size source max stack size target max stack size delta
nanox 103251 115795 -12544 20532 20532 0 8192 8192 0
nanos2 103523 116323 -12800 20504 20504 0 20452 20452 0
apex_p 129177 161433 -32256 21806 21806 0 19148 19148 0
flex 133965 182093 -48128 21806 21806 0 15052 15052 0
stax 133374 181502 -48128 21806 21806 0 15052 15052 0

Stack consumption summary (clone_app_stack_consumption)

⚠️ This summary is for informative purpose only. It may not give the application actual worst case, for example if the test coverage is low.

Device Worst case (bytes) Remaining stack (bytes) Test
apex_p 1737 38615 test_clone.py::test_clone_thundercore_tx[apex_p]
flex 1785 34471 test_clone.py::test_clone_thundercore_tx[flex]
nanosp 1697 38655 test_clone.py::test_clone_thundercore_tx[nanosp]
nanox 1689 6503 test_clone.py::test_clone_thundercore_tx[nanox]
stax 1785 34471 test_clone.py::test_clone_thundercore_tx[stax]

Full details

Stack consumption summary

⚠️ This summary is for informative purpose only. It may not give the application actual worst case, for example if the test coverage is low.

Device Worst case (bytes) Remaining stack (bytes) Test
apex_p 3249 15899 test_eip712.py::test_eip712_batch[apex_p]
flex 3249 11803 test_eip712.py::test_eip712_batch[flex]
nanosp 3249 17203 test_eip712.py::test_eip712_batch[nanosp]
nanox 3249 4943 test_eip712.py::test_eip712_batch[nanox]
stax 3249 11803 test_eip712.py::test_eip712_batch[stax]

Full details

@cedelavergne-ledger cedelavergne-ledger force-pushed the cev/remove_static_networks branch 4 times, most recently from 779edc1 to 1797a5b Compare June 4, 2026 16:02
@github-code-quality

github-code-quality Bot commented Jun 4, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: C

C / code-coverage/unittests

The overall coverage in the branch is 93%. Coverage data for the branch is not yet available.

Show a code coverage summary of the most covered files.
File 3969537 +/-
src/uint256.c 100%
src/plugins/eth...lugin_handler.c 97%
src/features/ge...ser/gtp_field.c 97%
src/features/ge...gtp_param_raw.c 95%
src/features/si...x/eth_ustream.c 94%
src/features/pr...tx_simulation.c 90%
src/features/pr.../trusted_name.c 90%
src/features/pr...md_get_gating.c 90%
src/features/ge...gtp_data_path.c 89%
src/features/si...logic_sign_tx.c 83%

Updated June 05, 2026 13:38 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@codecov-commenter

codecov-commenter commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.73%. Comparing base (31492ed) to head (3969537).
⚠️ Report is 55 commits behind head on develop.

Files with missing lines Patch % Lines
...eatures/generic_tx_parser/gtp_param_token_amount.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1044      +/-   ##
===========================================
- Coverage    87.73%   87.73%   -0.01%     
===========================================
  Files           92       92              
  Lines         7259     7257       -2     
  Branches      1620     1618       -2     
===========================================
- Hits          6369     6367       -2     
  Misses         468      468              
  Partials       422      422              
Flag Coverage Δ
unittests 87.73% <96.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cedelavergne-ledger and others added 6 commits June 5, 2026 15:35
Drop the hardcoded NETWORK_MAPPING table and resolve networks solely from
dynamically loaded ones. Simplify the lookup API by removing the now-useless
`dynamic` parameter.

The app's own (build-time) chain is still handled via the build config: name
from APPNAME, ticker from chain_config, and it is always considered
Ethereum-compatible (so trusted names on the native chain keep working).
The net_icons.gen.{c,h} generator parsed the now-removed NETWORK_MAPPING and
produced an empty array. Remove the generation (Makefile rule + gen_networks.py)
and unify network_icons.c: return the dynamic network icon, else the app's own
icon for its native chain.
In swap (library) mode the dynamic network list is wiped by the signature
BSS reset, so the device validates the swapped chain's ticker against the
networks provided before the swap and the app's own chain config:

- parse_swap_config: fees asset info stays optional (the CAL omits it for
  ERC20 swaps on the native chain, where the fee is the native currency).
- get_asset_info_on_network: when the swap config omits the fee asset, fall
  back to the chain config ticker instead of the removed static table.

Non-native chains (e.g. BSC) must now be provided as dynamic networks before
the swap, like any other network.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cedelavergne-ledger cedelavergne-ledger force-pushed the cev/remove_static_networks branch from 1797a5b to 3969537 Compare June 5, 2026 13:35
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Code coverage report

Code Coverage

Per-file coverage
Package Line Rate Branch Rate Health
src.features.generic_tx_parser 94% 82%
src.features.get_app_configuration 100% 100%
src.features.get_challenge 100% 100%
src.features.get_eth2_public_key 100% 96%
src.features.get_public_key 100% 100%
src.features.perform_privacy_operation 100% 87%
src.features.provide_enum_value 96% 87%
src.features.provide_erc20_token_information 94% 88%
src.features.provide_gating 90% 83%
src.features.provide_map_entry 93% 76%
src.features.provide_network_info 90% 82%
src.features.provide_nft_information 91% 80%
src.features.provide_proxy_info 97% 89%
src.features.provide_safe_account 95% 88%
src.features.provide_trusted_name 90% 82%
src.features.provide_tx_simulation 90% 85%
src.features.set_eth2_withdrawal_index 100% 100%
src.features.set_external_plugin 88% 79%
src.features.set_plugin 95% 90%
src.features.sign_authorization_eip7702 90% 81%
src.features.sign_message 91% 80%
src.features.sign_tx 89% 79%
src 99% 99%
src.nbgl 97% 87%
src.plugins.eip7002 95% 86%
src.plugins.eip7251 97% 86%
src.plugins.erc1155 91% 81%
src.plugins.erc20 91% 86%
src.plugins.erc721 93% 86%
src.plugins.eth2 95% 89%
src.plugins 97% 91%
src.plugins.swap_with_calldata 98% 94%
src.swap 95% 90%
src.utils 94% 95%
Summary 93% (6882 / 7374) 85% (3338 / 3944)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants