-
-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bitcoin-only strings filtering #1633
Conversation
what would be the point of the check in BITCOIN_ONLY ? I believe bitcoin-only firmware should ignore the existence of the field (iow, treat its value as if it were an unknown field), and protobuf messages containing unknown fields are valid (their values are ignored when decoding) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
ready to merge code-wise but depends on #1654 |
2b5cd0a
to
56ccab1
Compare
Added cff1d5e that mostly fixes altcoins leaking into core by moving the "Mostly fixes" means that there are still mentions of Decred. I'm tempted to allow it as an exception since it seems to be tightly bound to the bitcoin logic and separating it doesn't seem worthwhile.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely done.
I think keeping Decred is OK. We could export the Decred types into a separate messages-bitcoin-decred.proto
file, and wrap mentions in if not BITCOIN_ONLY
, but it's probably not worth the effort.
I'm surprised that the field names (decred_tree
, decred_staking_spend_type
) don't come up in the strings check.
Do you know why?
@@ -5,6 +5,10 @@ package hw.trezor.messages.bootloader; | |||
option java_package = "com.satoshilabs.trezor.lib.protobuf"; | |||
option java_outer_classname = "TrezorMessageBootloader"; | |||
|
|||
option (include_in_bitcoin_only) = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary? bootloader is not affected by BITCOIN_ONLY, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Also webauthn doesn't belong in bitcoin-only fw.
Very good point. Turns out the check was case-sensitive and the altcoin names are capitalized. In c465f21 I've added a whitelist which notably includes |
shellcheck saves the day In tools/check-bitcoin-only line 9: RETURN=1 ^----^ SC2030: Modification of RETURN is local (to subshell caused by pipeline). In tools/check-bitcoin-only line 13: exit $RETURN ^-----^ SC2031: RETURN was modified in a subshell. That change might be lost.
c7bcbf6
to
ee924c6
Compare
I propose merging this after core is made conformant, otherwise the
core fw btconly build
is gonna be red in every CI pipeline run.Regarding legacy ISTM that the check should stay in the
BITCOIN_ONLY
, so only the error messages differ. Perhaps we can use the generic one even in full firmware?