Skip to content

Support chunked addresses in SignTX flow for Solana#6545

Open
Copilot wants to merge 1 commit into
mainfrom
copilot/support-chunked-addresses
Open

Support chunked addresses in SignTX flow for Solana#6545
Copilot wants to merge 1 commit into
mainfrom
copilot/support-chunked-addresses

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Adds chunkify support to SolanaSignTx, matching the existing pattern in SolanaGetAddress. The flag is propagated through the predefined transaction confirmation path to confirm_value.

Changes

  • Proto: Added optional bool chunkify = 5 to SolanaSignTx in messages-solana.proto
  • Message classes: Updated generated Python (trezorlib/messages.py, core/trezor/messages.py) and Rust (messages_solana.rs) message definitions
  • trezorlib: Added chunkify param to solana.sign_tx()
  • Core flow: sign_txtry_confirm_predefined_transactionconfirm_system_transfer / try_confirm_token_transfer_transactionconfirm_token_transferconfirm_solana_recipientconfirm_value(chunkify=...)
  • Layouts: Added chunkify param to confirm_solana_recipient in all 4 layout variants (bolt, caesar, delizia, eckhart)
  • Tests: Added test_solana_sign_tx_with_chunked_addresses exercising chunkify=True against predefined transaction fixtures
Original prompt

This section details on the original issue you should resolve

<issue_title>Support chunked addresses in SignTX and Receive flows for Solana</issue_title>
<issue_description></issue_description>

<agent_instructions>The message SolanaSignTx in common/protob/messages-solana.proto needs to be extended by optional bool chunkify similarly to SolanaGetAddress message.

Then the sign_tx handler in core/src/apps/solana/sign_tx.py needs to be adjusted to utilize this new value. It must be propagated all the way from try_confirm_predefined_transaction to the call of confirm_value (which already has chunkify parameter).

Then adjust tests/device_tests/solana/test_sign_tx.py so that this new value is used at least in one test.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Hannsek @gabrielKerekes please take a look once you have some time. @Hannsek @tomasklim Let's create another issue for your issue. This one is about supporting chunked addresses during SignTX and Receive flow.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Support chunked addresses in SignTX and Receive flows for Solana Support chunked addresses in SignTX flow for Solana Mar 2, 2026
@obrusvit obrusvit added altcoin Any non-Bitcoin coins core Trezor Core firmware. Runs on Trezor Model T and Safe models. labels Mar 2, 2026
@obrusvit obrusvit added this to Firmware Mar 2, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs review in Firmware Mar 2, 2026
@obrusvit obrusvit moved this from 🔎 Needs review to 🏃‍♀️ In progress in Firmware Mar 2, 2026
@obrusvit obrusvit force-pushed the copilot/support-chunked-addresses branch from 7392411 to c0c075e Compare March 2, 2026 22:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 2, 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: 25016458231

@obrusvit obrusvit force-pushed the copilot/support-chunked-addresses branch from c0c075e to 6f4d660 Compare March 3, 2026 14:08
@obrusvit obrusvit added the translations Put this label on a PR to run tests in all languages label Mar 3, 2026
@obrusvit obrusvit moved this from 🏃‍♀️ In progress to 🔎 Needs review in Firmware Mar 3, 2026
@obrusvit obrusvit marked this pull request as ready for review March 3, 2026 15:53
Copilot AI review requested due to automatic review settings March 3, 2026 15:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds chunkify support to SolanaSignTx, matching the existing behavior in SolanaGetAddress. When enabled, recipient addresses are displayed in 4-character chunks on the device screen during the sign transaction confirmation flow.

Changes:

  • Added optional bool chunkify = 5 field to SolanaSignTx protobuf message and regenerated all message class bindings (Python, Rust)
  • Propagated the chunkify parameter through the predefined transaction confirmation call chain: sign_txtry_confirm_predefined_transactionconfirm_system_transfer / confirm_token_transferconfirm_solana_recipientconfirm_value
  • Added the chunkify param to confirm_solana_recipient in all four layout implementations (bolt, caesar, delizia, eckhart), plus a Caesar-specific fix to use confirm_address with chunking in place of confirm_with_info when chunkify=True and info items are present; updated the Rust confirm_address backend to call Flow::new(pages).with_menu(info_button) for debug tracing

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
common/protob/messages-solana.proto Adds optional bool chunkify = 5 to SolanaSignTx
core/src/trezor/messages.py Adds chunkify field to core Python SolanaSignTx class
python/src/trezorlib/messages.py Adds chunkify field to trezorlib Python SolanaSignTx class
rust/trezor-client/src/protos/generated/messages_solana.rs Adds chunkify field to Rust SolanaSignTx struct with full getter/setter support
python/src/trezorlib/solana.py Adds chunkify param to sign_tx() and forwards it to the message
core/src/apps/solana/sign_tx.py Passes msg.chunkify to try_confirm_predefined_transaction
core/src/apps/solana/predefined_transaction.py Propagates chunkify through predefined-transaction confirm helpers
core/src/apps/solana/layout.py Passes bool(chunkify) to confirm_solana_recipient from both confirm_system_transfer and confirm_token_transfer
core/src/trezor/ui/layouts/bolt/__init__.py Adds chunkify param to confirm_solana_recipient
core/src/trezor/ui/layouts/caesar/__init__.py Adds chunkify param; uses confirm_address (with chunking) instead of confirm_with_info when chunkify=True and info_items present
core/src/trezor/ui/layouts/delizia/__init__.py Adds chunkify param to confirm_solana_recipient
core/src/trezor/ui/layouts/eckhart/__init__.py Adds chunkify param to confirm_solana_recipient
core/embed/rust/src/ui/layout_caesar/ui_firmware.rs Adds .with_menu(info_button) to Flow in confirm_address (debug build only)
tests/device_tests/solana/test_sign_tx.py Passes chunkify from fixture params to sign_tx()
common/tests/fixtures/solana/sign_tx.predefined_transactions.json Adds chunkify: false/true variants to token transfer test cases
common/tests/fixtures/solana/sign_tx.compute_budget_program.json Adds chunkify: true to two multi-instruction test cases
core/.changelog.d/3446.fixed Adds changelog entry for the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread common/tests/fixtures/solana/sign_tx.compute_budget_program.json
Comment thread tests/device_tests/solana/test_sign_tx.py
@obrusvit obrusvit force-pushed the copilot/support-chunked-addresses branch from 6f4d660 to e4c9cf2 Compare March 5, 2026 16:01
@obrusvit
Copy link
Copy Markdown
Contributor

obrusvit commented Mar 5, 2026

Fixtures updated with the caveat that the Solana tests using chunkify on Caesar (T3B1) do not visit all the menu. That's because we switch to using confirm_address in this case and adding with_menu(info_button) into the respective Rust function resulted in infinite recursion in the test code when visit_menu is invoked. That happened in other tests where the info button leads to QR code of an address.

This is acceptable for now as other tests where chunkify == False visits the menu correctly.

image

@obrusvit obrusvit force-pushed the copilot/support-chunked-addresses branch from e4c9cf2 to c1e0a32 Compare March 5, 2026 18:59
@PrisionMike PrisionMike self-requested a review April 7, 2026 13:58
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.

Chunkification missing in a lot of places. Please re-visit.

Comment thread core/src/apps/solana/layout.py
Comment thread core/src/apps/solana/layout.py
Comment thread core/src/apps/solana/layout.py
Comment thread core/src/trezor/ui/layouts/bolt/__init__.py
@github-project-automation github-project-automation Bot moved this from 🔎 Needs review to 🏃‍♀️ In progress in Firmware Apr 8, 2026
@PrisionMike
Copy link
Copy Markdown
Contributor

@coderabbitai make me a similar issue for Tron as that too does not have chunkification as an argument for signing transactions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@PrisionMike: I've opened a new issue for Tron chunkification support in the SignTx flow. Here's a summary of what was filed:

[Support chunked addresses in SignTx flow for Tron]

Tracks adding chunkify to TronSignTx, mirroring the work done for Solana in this PR (#6545). The required changes cover the proto definition, generated message classes, trezorlib, the core signing flow, all layout variants, and device tests.

The issue has been assigned to you. I'll post the link once the script runs. Let me know if you'd like to adjust the title, description, or assignee!


🏁 Script executed:

gh issue create \
  --repo trezor/trezor-firmware \
  --title "Support chunked addresses in SignTx flow for Tron" \
  --body "## Summary

The \`TronSignTx\` message does not currently support the \`chunkify\` flag, which is used to display long addresses in readable chunks on the device screen.

This issue tracks adding \`chunkify\` support to the Tron SignTx flow, similar to what was done for Solana in `#6545`.

## Required Changes

- **Proto**: Add \`optional bool chunkify\` to the relevant \`TronSignTx\` message in \`common/protob/messages-tron.proto\`
- **Message classes**: Update generated Python (\`trezorlib/messages.py\`, \`core/trezor/messages.py\`) and Rust message definitions accordingly
- **trezorlib**: Add \`chunkify\` param to the Tron \`sign_tx()\` function
- **Core flow**: Propagate \`chunkify\` through the transaction confirmation path down to \`confirm_value\` (which already supports the \`chunkify\` parameter)
- **Layouts**: Add \`chunkify\` param to the relevant recipient/address confirmation layout helpers for all layout variants (bolt, caesar, delizia, eckhart)
- **Tests**: Add a test exercising \`chunkify=True\` in \`tests/device_tests/tron/\` against predefined transaction fixtures

## Background

The \`chunkify\` flag was introduced to improve readability of long addresses on Trezor device screens by splitting them into visually distinct chunks. Solana gained this support in both \`GetAddress\` and \`SignTx\` flows. Tron should receive the same treatment.

## References

- Solana implementation (reference PR): `#6545`
- Requested by `@PrisionMike`" \
  --assignee PrisionMike

Length of output: 53


@PrisionMike: The issue has been created and assigned to you:

Support chunked addresses in SignTx flow for Tron#6730

It covers all the required changes (proto, message classes, trezorlib, core flow, layouts, and tests), with this PR (#6545) linked as the reference implementation for Solana.

@obrusvit obrusvit force-pushed the copilot/support-chunked-addresses branch 2 times, most recently from 69fef03 to 4f21ea3 Compare April 25, 2026 10:26
@obrusvit
Copy link
Copy Markdown
Contributor

@PrisionMike I had to rebase the PR because it was too old. I addressed your points. The only problem stays with visiting the menus in Caesar.

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. Tiny questions and suggestions.

@@ -0,0 +1 @@
Allow chunkified recipient address in Solana transactions.
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.

Suggested change
Allow chunkified recipient address in Solana transactions.
Allow chunkified addresses in Solana transactions.

chunkify=chunkify,
)
else:
main = trezorui_api.confirm_with_info(
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.

Why not use the same confirm_address function?

@PrisionMike PrisionMike self-requested a review May 26, 2026 11:26
@obrusvit obrusvit force-pushed the copilot/support-chunked-addresses branch from f1a9fd1 to 6cbe6f0 Compare May 26, 2026 11:48
@obrusvit obrusvit moved this from 🏃‍♀️ In progress to 🔎 Needs review in Firmware May 26, 2026
@obrusvit obrusvit marked this pull request as draft May 26, 2026 13:37
@obrusvit obrusvit marked this pull request as ready for review May 26, 2026 13:37
@obrusvit obrusvit moved this from 🔎 Needs review to 🏃‍♀️ In progress in Firmware May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

altcoin Any non-Bitcoin coins core Trezor Core firmware. Runs on Trezor Model T and Safe models. translations Put this label on a PR to run tests in all languages

Projects

Status: 🏃‍♀️ In progress

Development

Successfully merging this pull request may close these issues.

Support chunked addresses in SignTX and Receive flows for Solana

4 participants