Skip to content

Clear signing definitions pipeline: 1. Firmware prerequisites#6748

Merged
ibz merged 13 commits intomainfrom
ibz/clear-signing-pipeline
Apr 28, 2026
Merged

Clear signing definitions pipeline: 1. Firmware prerequisites#6748
ibz merged 13 commits intomainfrom
ibz/clear-signing-pipeline

Conversation

@ibz
Copy link
Copy Markdown
Contributor

@ibz ibz commented Apr 13, 2026

Follow up for #6235

Besides the existing Ethereum network and token definitions add a new one: ETHEREUM_ERC7730_DISPLAY_FORMAT.

  • This kind of definition is used to receive serialized ERC-7730 "display formats" - which are what the firmware needs during clear signing in order to:
    1. parse and understand ERC-20 calldata
    2. format calldata intent and fields in a human-readable way according to ERC-7730
  • This kind of definition must be signed in the same way as we sign the other kinds of definitions

Note: the protobuf serialization of DisplayFormat (EthereumERC7730DisplayFormatInfo) is meant to be future proof and support nested arrays / tuples, but the actual implementation of DisplayFormat in the clear signing code does not support that as of now.

The ability for firmware to request extra definitions during signing has been moved to a new PR (#6798) that will be merged after this, for simplicity.

@coderabbitai

This comment was marked as outdated.

@trezor-bot trezor-bot Bot added this to Firmware Apr 13, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs review in Firmware Apr 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

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)
Translations

cs main(all)

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

de main(all)

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

es main(all)

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

fr main(all)

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

pt main(all)

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

Latest CI run: 25061585467

@ibz ibz force-pushed the ibz/clear-signing-pipeline branch 2 times, most recently from f333dae to f7de9c2 Compare April 13, 2026 12:27
@ibz ibz changed the title WIP [WIP] Clear signing definitions pipeline Apr 13, 2026
@ibz ibz force-pushed the ibz/clear-signing-pipeline branch 14 times, most recently from ad41024 to b6eee2f Compare April 15, 2026 09:00
@ibz ibz changed the title [WIP] Clear signing definitions pipeline [WIP] Clear signing definitions pipeline (Firmware part) Apr 15, 2026
@ibz ibz force-pushed the ibz/clear-signing-pipeline branch from b6eee2f to ef5fd73 Compare April 15, 2026 09:27
@ibz ibz marked this pull request as ready for review April 15, 2026 09:28
@ibz ibz changed the title [WIP] Clear signing definitions pipeline - Firmware part (1) [WIP] Clear signing definitions pipeline: 1. Firmware prerequisites Apr 24, 2026
Copy link
Copy Markdown
Contributor

@PrisionMike PrisionMike left a comment

Choose a reason for hiding this comment

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

LGTM. Just a nit and a point of clarification.

Comment thread core/src/apps/ethereum/clear_signing.py Outdated
return Array(
Tuple(
tuple(_get_leaf_parser(f) for f in element.tuple.fields),
is_dynamic=False, # Tuples inside Arrays are always parsed as static!
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this an EVM thing or is it our limitation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not really a limitation, but a way of parsing calldata. It's both an EVM thing and also due to our implementation. I am guessing we could have had implemented it in a way that would not require this flag to be set (depending on how we compute pointers inside containers). Can be changed any time, it's just an implementation detail of the parsing code, after all.

@ibz ibz force-pushed the ibz/clear-signing-pipeline branch 4 times, most recently from 5071780 to 17a2d09 Compare April 28, 2026 10:53
@ibz ibz added the translations Put this label on a PR to run tests in all languages label Apr 28, 2026
@ibz ibz changed the title [WIP] Clear signing definitions pipeline: 1. Firmware prerequisites Clear signing definitions pipeline: 1. Firmware prerequisites Apr 28, 2026
@ibz ibz force-pushed the ibz/clear-signing-pipeline branch from 347bce5 to 17a2d09 Compare April 28, 2026 14:43
ibz added 13 commits April 28, 2026 18:17
They are the same thing, but we are actually referring the fields by
index.

[no changelog]
Add a callable that will be invoked on every page of the default input
flow. Can be used for extra checks while confirming everything.

[no changelog]
Go back to having a single `token` passed with the definitions up-front
like we had before e059db5.

[no changelog]
[no changelog]
@ibz ibz force-pushed the ibz/clear-signing-pipeline branch from 17a2d09 to d350121 Compare April 28, 2026 15:19
@ibz ibz merged commit 46540d8 into main Apr 28, 2026
166 checks passed
@ibz ibz deleted the ibz/clear-signing-pipeline branch April 28, 2026 15:57
@trezor-bot trezor-bot Bot moved this from 🔎 Needs review to 🤝 Needs QA in Firmware Apr 28, 2026
@ibz ibz moved this from 🤝 Needs QA to ✅ Done (no QA) in Firmware Apr 29, 2026
@ibz ibz mentioned this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

translations Put this label on a PR to run tests in all languages

Projects

Status: ✅ Done (no QA)

Development

Successfully merging this pull request may close these issues.

2 participants