Skip to content

chore(core): return N4W1 in Features.capabilities#6841

Merged
romanz merged 1 commit into
mainfrom
romanz/2604/n4w1-cap
Apr 28, 2026
Merged

chore(core): return N4W1 in Features.capabilities#6841
romanz merged 1 commit into
mainfrom
romanz/2604/n4w1-cap

Conversation

@romanz

@romanz romanz commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Will be used to detect N4W1-enabled builds.

$ trezorctl -j get-features | jq .capabilities | grep N4W1
  "N4W1"

@romanz romanz self-assigned this Apr 27, 2026
@romanz romanz added the no-QA On PR-merge, automatically transition status in the "Firmware" project to "Done (no QA)" state. label Apr 27, 2026
@coderabbitai

coderabbitai Bot commented Apr 27, 2026

Copy link
Copy Markdown

Walkthrough

This change introduces a new device capability identifier N4W1 assigned to enum value 25. The capability is added to the protobuf definition in messages-management.proto and propagated to corresponding Python enum files in both core and client libraries. The get_features() function in base.py is modified to conditionally include this capability in the advertised features list when utils.USE_N4W1 evaluates to true.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is minimal and vague, lacking structured sections required by the repository template (development status, project assignment, QA notes). Add structured sections following the template: development status, project assignment details, and QA testing instructions or mark as 'no-QA' if testing is not required.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding N4W1 capability to Features.capabilities, which aligns with all file modifications in the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch romanz/2604/n4w1-cap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@trezor-bot trezor-bot Bot added this to Firmware Apr 27, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs review in Firmware Apr 27, 2026
@romanz romanz requested a review from mmilata April 27, 2026 16:15
@github-actions

github-actions Bot commented Apr 27, 2026

Copy link
Copy Markdown

en main(all)

model device_test click_test persistence_test
T2T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all) test(all) main(all)

Latest CI run: 25006683765

@romanz romanz requested a review from OriginalEveres April 27, 2026 16:18
@romanz romanz marked this pull request as ready for review April 27, 2026 16:18
@romanz romanz added core Trezor Core firmware. Runs on Trezor Model T and Safe models. protobuf Structure of messages exchanged between Trezor and the host T3W1 Trezor Safe 7 labels Apr 27, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@core/src/apps/base.py`:
- Around line 165-167: get_features() currently appends Capability.N4W1 when
utils.USE_N4W1 is true, but this can advertise N4W1 in universal builds; change
the guard so Capability.N4W1 is only appended when both utils.USE_N4W1 and the
bitcoin-only build flag are true (e.g., check utils.BITCOIN_ONLY or equivalent
build flag alongside utils.USE_N4W1) where the append to f.capabilities (the
f.capabilities.append(Capability.N4W1) call) occurs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 039da179-4365-4792-9a62-2b8c120758c9

📥 Commits

Reviewing files that changed from the base of the PR and between 7c014e2 and fa04119.

⛔ Files ignored due to path filters (1)
  • rust/trezor-client/src/protos/generated/messages_management.rs is excluded by !**/generated/**
📒 Files selected for processing (5)
  • common/protob/messages-management.proto
  • core/src/apps/base.py
  • core/src/trezor/enums/Capability.py
  • core/src/trezor/enums/__init__.py
  • python/src/trezorlib/messages.py

Comment thread core/src/apps/base.py
@romanz romanz merged commit 195382b into main Apr 28, 2026
141 of 221 checks passed
@romanz romanz deleted the romanz/2604/n4w1-cap branch April 28, 2026 13:22
@trezor-bot trezor-bot Bot moved this from 🔎 Needs review to ✅ Done (no QA) in Firmware Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Trezor Core firmware. Runs on Trezor Model T and Safe models. no-QA On PR-merge, automatically transition status in the "Firmware" project to "Done (no QA)" state. protobuf Structure of messages exchanged between Trezor and the host T3W1 Trezor Safe 7

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants