ci(core): avoid restarting MicroPython event loop for faster tests
What changed, and why it matters
This is a small test/UX optimization for the Trezor hardware wallet firmware. It changes when the device briefly resets its internal message-processing loop. Previously this only happened on one device model (Eckhart); now it also applies to the T3W1 model so the on-screen menu stays open when a `GetFeatures` request arrives. There is no obvious security bug, but it slightly widens the set of situations where the event loop is not restarted, which could matter if that restart was ever a security boundary.
No immediate action required. As a defensive review, verify that skipping the event-loop restart for `GetFeatures` on non-Eckhart models does not allow a stale session state, UI race, or unexpected re-entrancy. Review related tests in the CI suite that motivated this change and confirm the behavior is covered.
Security signals we found
Behavioral change in message dispatch path
Removal of model-specific guard for event-loop restart behavior
No changelog entry (marked [no changelog])
No cryptographic, authorization, or memory-safety code modified
Evidence from the diff
The patch removes a model-gated branch in core/src/trezor/wire/message_handler.py. The constant AVOID_RESTARTING_FOR is now always set to (MessageType.GetFeatures,), regardless of utils.UI_LAYOUT. The stated goal is to avoid restarting the MicroPython event loop during tests and to keep the T3W1 device menu open on GetFeatures. The change is purely behavioral/UX and does not alter cryptographic code, authorization checks, or message parsing.
Changed components
core/src/trezor/wire/message_handler.pyTrezor Core message dispatch / event loop restart logicT3W1 device model interaction flowInspect captured patch +3 / −5
diff --git a/core/src/trezor/wire/message_handler.py b/core/src/trezor/wire/message_handler.py
index 6b7eba6b..97e8e88c 100644
--- a/core/src/trezor/wire/message_handler.py
+++ b/core/src/trezor/wire/message_handler.py
@@ -178,11 +178,9 @@ async def handle_single_message(ctx: Context, msg: Message) -> bool:
return msg.type in AVOID_RESTARTING_FOR
-if utils.UI_LAYOUT == "ECKHART":
- # Don't close device menu when `GetFeatures` is received.
- AVOID_RESTARTING_FOR: Container[int] = (MessageType.GetFeatures,)
-else:
- AVOID_RESTARTING_FOR: Container[int] = ()
+# Don't restart MicroPython event loop, to lower device interaction latency.
+# Allows keeping T3W1 device menu open when `GetFeatures` is received (#6211).
+AVOID_RESTARTING_FOR: Container[int] = (MessageType.GetFeatures,)
def failure(exc: BaseException) -> Failure:
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.