AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 13 Bitcoin

refactor(core): don't store text font in `Op::Text`

Public commit record

What the developer wrote

Authored by Roman Zeyde

85/100 · Strong
refactor(core): don't store text font in `Op::Text`

Also, increase `MAX_OPS` a bit, since each `Op` takes less RAM now.

After:
```
print-type-size type: `ui::component::text::op::Op<'_>`: 16 bytes, alignment: 4 bytes
print-type-size variant `Text`: 16 bytes
print-type-size field `.0`: 12 bytes
print-type-size field `.1`: 4 bytes
print-type-size variant `Font`: 8 bytes
print-type-size padding: 4 bytes
print-type-size field `.0`: 4 bytes, alignment: 4 bytes
print-type-size variant `Chunkify`: 8 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 6 bytes, alignment: 2 bytes
print-type-size variant `CursorOffset`: 6 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 4 bytes, alignment: 2 bytes
print-type-size variant `Color`: 5 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 3 bytes, alignment: 1 bytes
print-type-size variant `LineSpacing`: 4 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 2 bytes, alignment: 2 bytes
print-type-size variant `Alignment`: 3 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 1 bytes, alignment: 1 bytes
print-type-size variant `LineBreaking`: 3 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 1 bytes, alignment: 1 bytes
print-type-size variant `NextPage`: 0 bytes
```

Before:
```
print-type-size type: `ui::component::text::op::Op<'_>`: 20 bytes, alignment: 4 bytes
print-type-size variant `Text`: 17 bytes
print-type-size field `.0`: 12 bytes
print-type-size field `.1`: 4 bytes
print-type-size field `.2`: 1 bytes
print-type-size variant `Font`: 8 bytes
print-type-size padding: 4 bytes
print-type-size field `.0`: 4 bytes, alignment: 4 bytes
print-type-size variant `Chunkify`: 8 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 6 bytes, alignment: 2 bytes
print-type-size variant `CursorOffset`: 6 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 4 bytes, alignment: 2 bytes
print-type-size variant `Color`: 5 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 3 bytes, alignment: 1 bytes
print-type-size variant `LineSpacing`: 4 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 2 bytes, alignment: 2 bytes
print-type-size variant `Alignment`: 3 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 1 bytes, alignment: 1 bytes
print-type-size variant `LineBreaking`: 3 bytes
print-type-size padding: 2 bytes
print-type-size field `.0`: 1 bytes, alignment: 1 bytes
print-type-size variant `NextPage`: 0 bytes
print-type-size end padding: 3 bytes
```

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a routine internal code cleanup in the Trezor firmware's on-screen text rendering system. It removes the font field from individual text-drawing instructions and instead tracks the next font to use separately, slightly reducing memory use per instruction and allowing a few more instructions to be stored. There is no indication this fixes a security bug or changes user-visible behavior.

Recommended action

No security action required. Treat as normal maintenance/refactor.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 13/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 9/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.