Fix BITCOIN_ONLY version issue.#136
Conversation
WalkthroughThis pull request updates the build workflow and firmware configuration to support multiple build configurations using a matrix. It adds new jobs and outputs for firmware building and Slack notifications. The changes implement conditional logic throughout the firmware source and Makefiles based on the Changes
Sequence Diagram(s)sequenceDiagram
participant B as Build Job (build-classic1s)
participant N as Notification Job (notify-slack)
participant S as Slack API
B->>N: Complete build with output variables
N->>S: Send Slack notification with build details
S-->>N: Acknowledge notification
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (8)
.github/workflows/build-classic1s.yml(3 hunks)legacy/firmware/Makefile(2 hunks)legacy/firmware/menu_list.c(3 hunks)legacy/firmware/protect.c(1 hunks)legacy/firmware/protob/Makefile(1 hunks)legacy/firmware/usb.c(3 hunks)legacy/script/cibuild(1 hunks)tools/version.sh(1 hunks)
🧰 Additional context used
🧬 Code Definitions (3)
legacy/firmware/menu_list.c (2)
legacy/firmware/menu_para.c (2)
menu_para_passphrase(50-54)menu_para_passphrase_index(108-112)legacy/firmware/menu_para.h (2)
menu_para_passphrase(10-10)menu_para_passphrase_index(20-20)
legacy/firmware/usb.c (3)
legacy/firmware/fido2/ctap_trans.c (3)
get_ble_fido_data_ptr(1312-1312)set_ble_fido_data_len(1310-1310)ctap_ble_cmd(1694-1733)legacy/firmware/fido2/ctap_trans.h (3)
get_ble_fido_data_ptr(74-74)set_ble_fido_data_len(75-75)ctap_ble_cmd(72-72)legacy/trans_fifo.c (1)
fifo_read_lock(66-82)
legacy/firmware/protect.c (2)
legacy/firmware/layout2.c (1)
layoutScreensaver(289-298)legacy/firmware/layout2.h (1)
layoutScreensaver(57-57)
🪛 Shellcheck (0.10.0)
tools/version.sh
[info] 7-7: Double quote to prevent globbing and word splitting.
(SC2086)
🪛 actionlint (1.7.4)
.github/workflows/build-classic1s.yml
61-61: shellcheck reported issue in this script: SC2086:info:2:3: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 YAMLlint (1.35.1)
.github/workflows/build-classic1s.yml
[error] 64-64: trailing spaces
(trailing-spaces)
[error] 67-67: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 103-103: trailing spaces
(trailing-spaces)
[error] 104-104: trailing spaces
(trailing-spaces)
[error] 105-105: trailing spaces
(trailing-spaces)
[error] 132-132: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Gen check
- GitHub Check: Defs check
🔇 Additional comments (13)
legacy/firmware/protob/Makefile (1)
17-18: Correctly adds new cryptocurrencies to BITCOIN_ONLY skip listThis change properly extends the list of skipped messages for BITCOIN_ONLY mode to include Cardano, Scdo, Nostr, Tron, Ripple, and Lnurl. This ensures these non-Bitcoin cryptocurrencies are excluded when BITCOIN_ONLY=1.
legacy/firmware/Makefile (1)
10-14: Correct conditional naming for BITCOIN_ONLY buildsThe firmware name now correctly indicates "bc-only" when BITCOIN_ONLY=1, making Bitcoin-only builds easily identifiable.
legacy/firmware/protect.c (1)
810-817: Correctly conditioned U2F functionality for non-Bitcoin buildsAdded appropriate conditional compilation directive to exclude U2F handler code from Bitcoin-only builds. This ensures U2F functionality is only included when needed.
legacy/firmware/usb.c (2)
452-460: Appropriate conditional compilation for FIDO functionalityGood addition of
#if !BITCOIN_ONLYconditional to exclude FIDO-specific code when building the Bitcoin-only version. This helps reduce binary size and remove unused functionality.
570-584: Proper conditional compilation of U2F data sending functionWrapping the
usb_u2f_data_sendfunction in#if !BITCOIN_ONLYcorrectly excludes this function from Bitcoin-only builds where U2F functionality isn't needed.🧰 Tools
🪛 Cppcheck (2.10-2)
[style] 571-571: The function 'usb_u2f_data_send' is never used.
(unusedFunction)
legacy/firmware/menu_list.c (3)
20-23: Good conditional inclusion of FIDO credentialsProperly wrapped the FIDO2 header inclusion and
resident_credential_refreshvariable in#if !BITCOIN_ONLYcondition to exclude from Bitcoin-only builds.
374-505: Appropriate conditional compilation of FIDO2 resident credential functionsCorrectly wrapped the entire FIDO2 resident credential implementation in
#if !BITCOIN_ONLYconditional. This eliminates unnecessary code from Bitcoin-only firmware builds.
512-515: Proper conditional inclusion of FIDO menu itemGood job conditionally including the "FIDO Keys" menu item only when not in Bitcoin-only mode. This ensures the menu structure remains consistent with available functionality.
.github/workflows/build-classic1s.yml (5)
10-33: Well-structured build matrix setupGood implementation of build matrix to generate different firmware variants (prod/qa and with/without Bitcoin-only support). The naming scheme with descriptive artifact suffixes will help distinguish the builds.
42-58: Improved variable population and outputsSimplified firmware version extraction with
awkand properly set up output variables that can be used by dependent jobs.
68-80: Good conditional build configurationWell-structured conditional build configuration based on matrix values. The approach makes it clear which environment variables are set for each build type.
85-104: Well-implemented build artifact handlingGood conditional logic for handling different artifact types based on build configuration. The approach ensures correct file naming and hash generation.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 103-103: trailing spaces
(trailing-spaces)
[error] 104-104: trailing spaces
(trailing-spaces)
112-131: Well-structured Slack notification jobGood addition of a notification job that reuses outputs from the build job. This keeps the notification logic separate from the build logic.
There was a problem hiding this comment.
Actionable comments posted: 9
🔭 Outside diff range comments (1)
core/src/trezor/enums/__init__.py (1)
731-736:⚠️ Potential issueMove Ton-specific enums inside the BITCOIN_ONLY check
These Ton-specific enum classes should be conditionally included based on the BITCOIN_ONLY flag.
if TYPE_CHECKING: - class TonWalletVersion(IntEnum): - V4R2 = 3 - - class TonWorkChain(IntEnum): - BASECHAIN = 0 - MASTERCHAIN = 1Suggested implementation:
if TYPE_CHECKING: if not utils.BITCOIN_ONLY: class TonWalletVersion(IntEnum): V4R2 = 3 class TonWorkChain(IntEnum): BASECHAIN = 0 MASTERCHAIN = 1
♻️ Duplicate comments (3)
tools/version.sh (1)
7-7: 🧹 Nitpick (assertive)Good change to use absolute path for cpp
Using the full path
/usr/bin/cppensures consistent behavior across environments, eliminating potential PATH-related issues.You should also add double quotes around the variable reference to prevent word splitting:
-echo "VERSION_MAJOR.VERSION_MINOR.VERSION_PATCH" | /usr/bin/cpp -include $1 -nostdinc -P | tr -d " " +echo "VERSION_MAJOR.VERSION_MINOR.VERSION_PATCH" | /usr/bin/cpp -include "$1" -nostdinc -P | tr -d " "🧰 Tools
🪛 Shellcheck (0.10.0)
[info] 7-7: Double quote to prevent globbing and word splitting.
(SC2086)
legacy/script/cibuild (1)
35-36: 🧹 Nitpick (assertive)Add comment explaining why these steps are disabled
The intermediate firmware build steps have been commented out, but there's no explanation why. Add a brief comment to help future developers understand the reason.
- # make -C intermediate_fw - # make -C intermediate_fw sign + # Disabled intermediate firmware build for BITCOIN_ONLY compatibility + # make -C intermediate_fw + # make -C intermediate_fw signlegacy/firmware/Makefile (1)
90-91:⚠️ Potential issueMove Bitcoin-specific objects into conditional block
These Bitcoin-specific object files should be conditionally included based on
BITCOIN_ONLYlike other crypto-specific objects.Apply this fix:
-OBJS += psbt/psbt.o -OBJS += bip322_simple/bip322_simple.o +ifdef BITCOIN_ONLY +OBJS += psbt/psbt.o +OBJS += bip322_simple/bip322_simple.o +endif
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro (Legacy)
📒 Files selected for processing (20)
.github/workflows/build-classic1s.yml(3 hunks)core/src/all_modules.py(2 hunks)core/src/apps/ethereum/networks.py(19 hunks)core/src/trezor/enums/CardanoCertificateType.py(1 hunks)core/src/trezor/enums/CardanoDRepType.py(1 hunks)core/src/trezor/enums/CardanoTxAuxiliaryDataSupplementType.py(1 hunks)core/src/trezor/enums/MessageType.py(2 hunks)core/src/trezor/enums/SolanaOffChainMessageFormat.py(1 hunks)core/src/trezor/enums/SolanaOffChainMessageVersion.py(1 hunks)core/src/trezor/enums/__init__.py(5 hunks)core/src/trezor/messages.py(16 hunks)legacy/firmware/Makefile(2 hunks)legacy/firmware/menu_list.c(3 hunks)legacy/firmware/protect.c(1 hunks)legacy/firmware/protob/Makefile(1 hunks)legacy/firmware/usb.c(3 hunks)legacy/script/cibuild(1 hunks)python/src/trezorlib/cli/sol.py(1 hunks)python/src/trezorlib/messages.py(21 hunks)tools/version.sh(1 hunks)
🧰 Additional context used
🧬 Code Definitions (8)
legacy/firmware/menu_list.c (2)
legacy/firmware/menu_para.c (2)
menu_para_passphrase(50-54)menu_para_passphrase_index(108-112)legacy/firmware/menu_para.h (2)
menu_para_passphrase(10-10)menu_para_passphrase_index(20-20)
legacy/firmware/protect.c (2)
legacy/firmware/layout2.c (1)
layoutScreensaver(289-298)legacy/firmware/layout2.h (1)
layoutScreensaver(57-57)
legacy/firmware/usb.c (3)
legacy/firmware/fido2/ctap_trans.c (3)
get_ble_fido_data_ptr(1312-1312)set_ble_fido_data_len(1310-1310)ctap_ble_cmd(1694-1733)legacy/firmware/fido2/ctap_trans.h (3)
get_ble_fido_data_ptr(74-74)set_ble_fido_data_len(75-75)ctap_ble_cmd(72-72)legacy/trans_fifo.c (1)
fifo_read_lock(66-82)
core/src/all_modules.py (2)
core/src/trezor/enums/__init__.py (7)
SolanaOffChainMessageFormat(701-703)SolanaOffChainMessageVersion(698-699)TonWalletVersion(731-732)TonWorkChain(734-736)CardanoCVoteRegistrationFormat(562-564)CardanoCertificateType(538-545)CardanoDRepType(547-551)python/src/trezorlib/messages.py (7)
SolanaOffChainMessageFormat(751-753)SolanaOffChainMessageVersion(747-748)TonWalletVersion(787-788)TonWorkChain(791-793)CardanoCVoteRegistrationFormat(588-590)CardanoCertificateType(560-567)CardanoDRepType(570-574)
core/src/trezor/enums/MessageType.py (1)
core/src/trezor/messages.py (15)
SolanaSignOffChainMessage(7442-7462)SolanaMessageSignature(7480-7494)SolanaSignUnsafeMessage(7464-7478)BenfenGetAddress(420-434)BenfenAddress(436-448)BenfenSignTx(450-470)BenfenSignedTx(472-486)BenfenSignMessage(520-534)BenfenMessageSignature(536-550)BenfenTxRequest(488-504)BenfenTxAck(506-518)NeoGetAddress(6674-6688)NeoAddress(6690-6704)NeoSignTx(6706-6722)NeoSignedTx(6724-6738)
core/src/trezor/enums/__init__.py (1)
core/src/trezor/messages.py (15)
SolanaSignOffChainMessage(7442-7462)SolanaMessageSignature(7480-7494)SolanaSignUnsafeMessage(7464-7478)BenfenGetAddress(420-434)BenfenAddress(436-448)BenfenSignTx(450-470)BenfenSignedTx(472-486)BenfenSignMessage(520-534)BenfenMessageSignature(536-550)BenfenTxRequest(488-504)BenfenTxAck(506-518)NeoGetAddress(6674-6688)NeoAddress(6690-6704)NeoSignTx(6706-6722)NeoSignedTx(6724-6738)
python/src/trezorlib/messages.py (2)
core/src/trezor/messages.py (12)
SolanaSignOffChainMessage(7442-7462)SolanaMessageSignature(7480-7494)SolanaSignUnsafeMessage(7464-7478)BenfenGetAddress(420-434)BenfenAddress(436-448)BenfenSignTx(450-470)BenfenSignedTx(472-486)BenfenSignMessage(520-534)BenfenMessageSignature(536-550)BenfenTxRequest(488-504)BenfenTxAck(506-518)CardanoDRep(2126-2142)core/src/trezor/enums/__init__.py (5)
CardanoDRepType(547-551)CardanoCVoteRegistrationFormat(562-564)SolanaOffChainMessageVersion(698-699)SolanaOffChainMessageFormat(701-703)MessageType(23-415)
core/src/trezor/messages.py (2)
python/src/trezorlib/messages.py (14)
CardanoCVoteRegistrationFormat(588-590)CardanoCertificateType(560-567)CardanoDRepType(570-574)SolanaOffChainMessageFormat(751-753)SolanaOffChainMessageVersion(747-748)BenfenGetAddress(1173-1187)MessageType(31-423)BenfenSignTx(1204-1227)BenfenSignedTx(1230-1244)CardanoDRep(3393-3410)CardanoTxCertificate(3413-3445)CardanoCVoteRegistrationDelegation(3471-3485)CardanoCVoteRegistrationParametersType(3488-3520)CardanoTxAuxiliaryData(3523-3537)core/src/trezor/enums/__init__.py (6)
CardanoCVoteRegistrationFormat(562-564)CardanoCertificateType(538-545)CardanoDRepType(547-551)SolanaOffChainMessageFormat(701-703)SolanaOffChainMessageVersion(698-699)MessageType(23-415)
🪛 Shellcheck (0.10.0)
tools/version.sh
[info] 7-7: Double quote to prevent globbing and word splitting.
(SC2086)
🪛 actionlint (1.7.4)
.github/workflows/build-classic1s.yml
61-61: shellcheck reported issue in this script: SC2086:info:2:3: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 Ruff (0.8.2)
python/src/trezorlib/messages.py
1175-1178: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
1186-1186: Remove quotes from type annotation
Remove quotes
(UP037)
1192-1194: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
1206-1212: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
1223-1223: Remove quotes from type annotation
Remove quotes
(UP037)
1232-1235: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
1249-1253: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
1269-1271: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
1283-1286: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
1294-1294: Remove quotes from type annotation
Remove quotes
(UP037)
1300-1303: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
3395-3399: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
3438-3438: Remove quotes from type annotation
Remove quotes
(UP037)
3473-3476: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
3490-3499: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
3513-3513: Remove quotes from type annotation
Remove quotes
(UP037)
3514-3514: Remove quotes from type annotation
Remove quotes
(UP037)
3525-3528: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
3707-3707: Remove quotes from type annotation
Remove quotes
(UP037)
8485-8488: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
8496-8496: Remove quotes from type annotation
Remove quotes
(UP037)
8502-8505: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
8519-8523: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
8532-8532: Remove quotes from type annotation
Remove quotes
(UP037)
8539-8542: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
9315-9321: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
9332-9332: Remove quotes from type annotation
Remove quotes
(UP037)
9341-9344: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
9352-9352: Remove quotes from type annotation
Remove quotes
(UP037)
9358-9361: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
core/src/trezor/messages.py
27-27: Unused noqa directive (unused: F401)
Remove unused noqa directive
(RUF100)
28-28: Unused noqa directive (unused: F401)
Remove unused noqa directive
(RUF100)
29-29: Unused noqa directive (unused: F401)
Remove unused noqa directive
(RUF100)
62-62: Unused noqa directive (unused: F401)
Remove unused noqa directive
(RUF100)
63-63: Unused noqa directive (unused: F401)
Remove unused noqa directive
(RUF100)
433-433: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
447-447: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
469-469: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
485-485: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
503-503: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
517-517: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
533-533: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
549-549: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
2141-2141: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
2205-2205: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
2233-2233: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
6687-6687: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
6703-6703: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
6721-6721: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
6737-6737: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
7439-7439: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
7461-7461: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
7477-7477: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
7493-7493: Dynamically typed expressions (typing.Any) are disallowed in msg
(ANN401)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Gen check
- GitHub Check: Defs check
🔇 Additional comments (66)
legacy/firmware/protob/Makefile (1)
17-18: Updated BITCOIN_ONLY exclusion listThe list of skipped messages for BITCOIN_ONLY mode has been expanded to include additional cryptocurrency types. This matches the overall objective of creating a Bitcoin-only firmware version.
legacy/firmware/protect.c (1)
810-817: Appropriate BITCOIN_ONLY conditional checkAdding the conditional compilation directive ensures this U2F-related code is excluded from Bitcoin-only builds. This helps reduce firmware size and streamlines functionality for Bitcoin-only devices.
The change correctly guards the screen saver and U2F command handling logic that would be unnecessary in a Bitcoin-only firmware.
legacy/firmware/Makefile (1)
10-14: Good conditional naming for Bitcoin-only builds.The conditional naming convention helps users identify Bitcoin-only firmware builds by adding the
bc-onlysuffix. This clearly distinguishes between the two build types.legacy/firmware/usb.c (2)
452-460: Appropriate conditional for FIDO functionalityProperly excluding FIDO-related code when in Bitcoin-only mode ensures a cleaner build and smaller firmware size.
570-584: Good separation of U2F functionalityConditionally excluding the
usb_u2f_data_sendfunction in Bitcoin-only builds aligns with the design goal of limiting functionality to just Bitcoin features.🧰 Tools
🪛 Cppcheck (2.10-2)
[style] 571-571: The function 'usb_u2f_data_send' is never used.
(unusedFunction)
legacy/firmware/menu_list.c (3)
20-23: Proper conditional inclusion of FIDO headers and variablesCorrectly wrapping FIDO-related include and variables in the conditional block ensures they're only compiled when needed.
374-505: Appropriate conditional for FIDO resident credential functionalityThe FIDO credential management code is properly excluded from Bitcoin-only builds, reducing code size and simplifying the firmware.
512-515: Correctly removed FIDO menu item in Bitcoin-only modeThe menu item is properly excluded when in Bitcoin-only mode, ensuring users don't see options that aren't available.
.github/workflows/build-classic1s.yml (8)
10-33: Well-structured matrix build strategyThe matrix approach efficiently handles multiple build configurations (regular/Bitcoin-only and prod/qa). The defined outputs will help downstream jobs access build information.
43-43: Improved version extractionUsing
awkfor version extraction simplifies the command and makes it more readable.
51-58: Good job exposing build variables as outputsSetting build information as both environment variables and job outputs makes the data accessible to downstream jobs (like the notification job).
68-80: Clean conditional logic for build configurationThe script clearly sets the appropriate environment variables based on matrix configuration options.
85-96: Appropriate conditional signing processThe QA build signing process is properly conditioned and uses secrets securely.
98-104: Proper artifact handling based on build typeThe conditional logic correctly handles bootloader artifacts only for non-Bitcoin-only builds.
112-131: Useful Slack notification integrationThe notification job effectively uses the outputs from the build job to send contextual information to Slack.
132-133: 🧹 Nitpick (assertive)Add newline at end of file
YAML files should end with a newline character.
Add a newline at the end of the file.
change-log: 'firmware@${{ env.FIRMWARE_VERSION }} / boot@${{ env.BOOT_VERSION }}' custom-issue-url: '' +core/src/trezor/enums/CardanoDRepType.py (1)
1-8: Looks good: Clean enum implementation for Cardano DRep types.The constants use clear, descriptive names and follow Python naming conventions for constants. The sequential numbering (0-3) provides a logical structure for the enum values.
core/src/apps/ethereum/networks.py (15)
118-118: Network name updated for clarity.The rename from "Ethereum Classic Testnet Kotti" to "Kotti Testnet" is more concise.
181-181: Network name clarification.Renaming "Flare Testnet Coston" to "Songbird Testnet Coston" better reflects the network's identity.
237-237: Simplified network name."Rootstock" is the preferred name for what was previously labeled "RSK".
244-244: Network name consistency update.Changed from "RSK Testnet" to "Rootstock Testnet" for consistency with the main network name change.
363-363: Clearer testnet naming.The rename from "Ethereum Classic Testnet Morden" to "Morden Testnet" removes redundancy.
370-370: More concise testnet name.Similar to other changes, "Mordor Testnet" is clearer than "Ethereum Classic Testnet Mordor".
1166-1166: Updated slip44 value for testnet.Changed slip44 value from 60 to 1 for Moonbase Alpha, which is the standard value for testnets.
1413-1413: Network name simplification.Changing from "Kava EVM" to just "Kava" makes the name more straightforward.
1971-1971: Corrected slip44 value.Updated slip44 from 60 to 1 for Atelier network, which appears to be a testnet.
2071-2071: More descriptive network name."Wireshape Floripa Testnet" provides better context than just "Floripa".
2127-2127: Network name enhancement.Adding "Network" to "eSync" creates a more complete name.
2160-2160: Testnet slip44 value update.Changed slip44 from 60 to 1 for Firenze test network.
2356-2356: Standardized testnet slip44.Updated slip44 to 1 for Kekchain testnet, aligning with convention.
2524-2524: Fixed testnet slip44 value.Set slip44 to 1 for maistestsubnet, following the standard for test networks.
2565-2590: Updated slip44 for Harmony networks.Changed slip44 to 1023 for all Harmony network entries, reflecting the correct coin type.
core/src/trezor/enums/SolanaOffChainMessageVersion.py (1)
1-5: Clean version constant for Solana off-chain messages.Adds a clear version identifier constant for Solana off-chain message handling. The version starts at 0, allowing for future versioning.
core/src/trezor/enums/SolanaOffChainMessageFormat.py (1)
1-6: Appropriate format constants for Solana messages.Defines two message format options for version 0 of Solana off-chain messages:
- Restricted ASCII (value 0)
- Limited UTF8 (value 1)
These constants provide clear encoding options for message handling.
python/src/trezorlib/cli/sol.py (1)
22-22: Good addition of explicit importAdding the explicit
base58import is good. It's used in thesign_txfunction (line 57), so this improves code clarity.core/src/trezor/enums/CardanoTxAuxiliaryDataSupplementType.py (1)
6-6:Details
✅ Verification successful
Renamed constant for clarity
Renaming from GOVERNANCE_REGISTRATION_SIGNATURE to CVOTE_REGISTRATION_SIGNATURE matches other changes in the codebase. This improves consistency in Cardano-related terminology.
🏁 Script executed:
#!/bin/bash # Check if this constant is properly handled in BITCOIN_ONLY configurations rg -p "CVOTE_REGISTRATION_SIGNATURE" --type py rg -p "BITCOIN_ONLY.*CardanoTxAuxiliaryDataSupplementType" --type pyLength of output: 369
Renamed constant verified for clarity and consistency.
- The constant is correctly renamed to
CVOTE_REGISTRATION_SIGNATUREacross the codebase (found incore/src/trezor/enums/CardanoTxAuxiliaryDataSupplementType.py,python/src/trezorlib/messages.py, andcore/src/trezor/enums/__init__.py).- The BITCOIN_ONLY configuration check returned no matches, which is expected for Cardano-specific logic.
core/src/trezor/enums/CardanoCertificateType.py (1)
9-11:Details
❓ Verification inconclusive
Added new certificate types
Added three new certificate types for Cardano Conway features and vote delegation. This expands functionality for Cardano blockchain operations.
🏁 Script executed:
#!/bin/bash # Verify these new constants are properly handled in BITCOIN_ONLY configurations rg -p "STAKE_REGISTRATION_CONWAY|STAKE_DEREGISTRATION_CONWAY|VOTE_DELEGATION" --type py rg -p "BITCOIN_ONLY.*CardanoCertificateType" --type pyLength of output: 577
Action: Verify BITCOIN_ONLY Handling for New Cardano Certificate Constants
The new constants for Cardano Conway and vote delegation appear in the expected files:
python/src/trezorlib/messages.pyshows the new constants at lines 565–567.core/src/trezor/enums/CardanoCertificateType.pyandcore/src/trezor/enums/__init__.pycorrectly list these constants.- The BITCOIN_ONLY search returned no hits, which suggests these Cardano-specific constants aren’t mistakenly active in Bitcoin-only contexts. Please confirm that this outcome is intentional.
python/src/trezorlib/messages.py (14)
283-285: New Solana message types added.These message types enable off-chain message signing capabilities for Solana blockchain, including both safe and unsafe message handling.
411-422: Added support for Benfen and Neo blockchains.Clean implementation of message types for two new blockchains.
565-574: Added Cardano Conway governance support.New stake operations and DRep types support Cardano's governance features.
585-590: Enhanced Cardano transaction auxiliary data.Added support for vote registration signatures, consistent with Conway governance features.
747-753: Added Solana message format enums.These enums properly support the new Solana message signing capabilities.
3023-3023: Added chunkify option to Cardano address.This field allows breaking large data into smaller chunks for processing.
Also applies to: 3034-3034, 3041-3041
3119-3120: Added chunkify and CBOR tagging options to Cardano transactions.These options improve processing of large transactions and structure tagging.
Also applies to: 3147-3148, 3171-3172
3393-3411: Added Cardano DRep message type.New message type supports Conway governance, matching the DRep enum added earlier.
🧰 Tools
🪛 Ruff (0.8.2)
3395-3399: Mutable class attributes should be annotated with
typing.ClassVar(RUF012)
3422-3423: Added deposit and DRep fields to Cardano certificates.These fields properly support Conway governance stake operations.
Also applies to: 3435-3436, 3444-3445
3471-3537: Enhanced Cardano vote registration.Updated field names and added support for delegation parameters, format options, and payment addresses.
🧰 Tools
🪛 Ruff (0.8.2)
3473-3476: Mutable class attributes should be annotated with
typing.ClassVar(RUF012)
3490-3499: Mutable class attributes should be annotated with
typing.ClassVar(RUF012)
3513-3513: Remove quotes from type annotation
Remove quotes
(UP037)
3514-3514: Remove quotes from type annotation
Remove quotes
(UP037)
3525-3528: Mutable class attributes should be annotated with
typing.ClassVar(RUF012)
3614-3614: Added vote registration signature field.This completes the Cardano governance implementation for transaction auxiliary data.
Also applies to: 3622-3622, 3626-3626
3695-3695: Added address type to Cardano message signing.Provides additional context for the signing operation.
Also applies to: 3705-3705, 3711-3711
9271-9271: Updated Solana address and signature fields.Made these fields required for better type safety.
Also applies to: 9277-9277, 9302-9302, 9308-9308
9313-9371: Implemented Solana message signing types.Complete implementation of off-chain and unsafe message signing capabilities with proper format options.
🧰 Tools
🪛 Ruff (0.8.2)
9315-9321: Mutable class attributes should be annotated with
typing.ClassVar(RUF012)
9332-9332: Remove quotes from type annotation
Remove quotes
(UP037)
9341-9344: Mutable class attributes should be annotated with
typing.ClassVar(RUF012)
9352-9352: Remove quotes from type annotation
Remove quotes
(UP037)
9358-9361: Mutable class attributes should be annotated with
typing.ClassVar(RUF012)
core/src/all_modules.py (1)
372-377: Cardano enums correctly placed in conditional blockThese Cardano enum imports are correctly placed inside the
if not utils.BITCOIN_ONLY:block, which aligns with the PR goal of fixing BITCOIN_ONLY version issues.core/src/trezor/enums/__init__.py (3)
543-551: Cardano certificate types correctly placed in conditional structureThese Cardano enum additions are correctly placed inside the TYPE_CHECKING block where other Cardano-related types exist. Since they appear within the CardanoCertificateType and CardanoDRepType classes that would only be included when BITCOIN_ONLY is false, this implementation is correct.
560-560: Enum value rename is correctly implementedRenaming GOVERNANCE_REGISTRATION_SIGNATURE to CVOTE_REGISTRATION_SIGNATURE maintains the same enum value while updating its name to better reflect its purpose. This change is correctly placed within the conditional structure.
562-564: Enum class rename is correctly implementedRenaming CardanoGovernanceRegistrationFormat to CardanoCVoteRegistrationFormat maintains consistency with the previous enum value rename. This change is correctly placed inside the conditional structure.
core/src/trezor/messages.py (11)
420-551: Good addition of Benfen blockchain support.The implementation follows the same pattern as other blockchain protocols in this file. Methods and class structures are consistent with the codebase.
🧰 Tools
🪛 Ruff (0.8.2)
433-433: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
447-447: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
469-469: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
485-485: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
503-503: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
517-517: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
533-533: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
549-549: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
1810-1810: Support for chunked address operations in Cardano.Adding the
chunkifyparameter enables chunked operations for Cardano address handling, which helps with memory-constrained operations.Also applies to: 1820-1820
1898-1899: Enhanced transaction processing in Cardano.Adding
chunkifyandtag_cbor_setsparameters improves memory efficiency and CBOR set handling for Cardano transactions.Also applies to: 1925-1926
2126-2143: New structure for Cardano DRep support.The
CardanoDRepclass properly implements the necessary fields and types for Cardano delegation representatives.🧰 Tools
🪛 Ruff (0.8.2)
2141-2141: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
2151-2152: Enhanced Cardano certificate functionality.The addition of
depositanddrepfields toCardanoTxCertificateenables stake delegation and voting capabilities.Also applies to: 2164-2164
2192-2207: Renamed governance to CVote for Cardano.Good refactoring to align with Cardano naming conventions. Updated class and field names maintain functionality while following standard Cardano terminology.
Also applies to: 2208-2234, 2237-2243, 2323-2330
🧰 Tools
🪛 Ruff (0.8.2)
2205-2205: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
2403-2412: Enhanced Cardano message signing.Added optional
address_typefield toCardanoSignMessagefor flexibility in address handling.
6674-6739: Added Neo blockchain support.Complete implementation with address, signing, and transaction handling capabilities. Structure follows the established pattern used for other blockchains.
🧰 Tools
🪛 Ruff (0.8.2)
6687-6687: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
6703-6703: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
6721-6721: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
6737-6737: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
7399-7400: Solana address and signed transaction updates.Minor formatting changes maintain the functionality while improving code readability.
Also applies to: 7429-7430
7442-7495: Added Solana off-chain messaging support.Comprehensive implementation of off-chain messaging capabilities with proper versioning and format handling.
🧰 Tools
🪛 Ruff (0.8.2)
7461-7461: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
7477-7477: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
7493-7493: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
433-549: Dynamically typed expressions in method return types.Static analysis flags dynamic typing with
Anyin several type guard methods. While not a functional issue, it's worth noting for future type safety improvements.Consider using more specific return types when possible to improve type safety throughout the codebase.
Also applies to: 2141-2233, 6687-6737, 7439-7493
🧰 Tools
🪛 Ruff (0.8.2)
433-433: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
447-447: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
469-469: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
485-485: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
503-503: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
517-517: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
533-533: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
549-549: Dynamically typed expressions (typing.Any) are disallowed in
msg(ANN401)
Summary by CodeRabbit
New Features
Chores