fix(protocol): regenerate bindings with the canonical protoc (unblocks firmware integration CI) - #108
Merged
Conversation
31d8c27 regenerated messages_pb2.py and messages_ethereum_pb2.py with a host protoc (builder-style, needs protobuf >= 3.20) instead of docker_build_pb.sh. The firmware integration container runs Python 3.6.9 / protobuf 3.17.3, so every python-integration-tests job failed at import: "cannot import name 'builder'". Regenerated via build_pb.sh inside the CI-pinned firmware image (protoc 3.5.1). Serialized descriptors are byte-identical to the builder files (messages 14590 B, ethereum 3046 B, types 4686 B). test_erc7730_protocol_bindings + test_message_signing_protocol_bindings: 8 passed on protobuf 3.17.3 (py3.6, CI image) and 3.20.3. setup.py range narrowed to what was tested: protoc-3.5.1 code does not load on protobuf >= 4.21.
BitHighlander
added a commit
to BitHighlander/keepkey-firmware
that referenced
this pull request
Sep 18, 2026
python-integration-tests failed at import on the CI image (py3.6 / protobuf 3.17.3) because the pinned bindings were builder-style. BitHighlander/python-keepkey#108 regenerates them with the canonical protoc; descriptors are byte-identical.
(cherry picked from commit 2771e17)
The authoritative-network guard allowed loopback only. In firmware CI the emulator is the compose service kkemu (KK_TRANSPORT_MAIN= kkemu:11044), so all 616 emulator tests failed with 'attempted external network access'. Allow exactly the KK_TRANSPORT_MAIN / KK_TRANSPORT_DEBUG endpoints (and their resolved addresses), as the audit line does; every other destination is still denied. test_tx_fixture_integrity: 5 passed.
- conftest: port pytest_collection_modifyitems from the audit line. Firmware CI passes KEEPKEY_SCREENSHOT_TESTS (188 report selectors); pyk alpha ignored it, so the screenshot phase ran all ~758 tests and the full-variant job hit its 30-minute limit. - test_msg_zcash_transparent_shielding: bitcoin-only builds have no Zcash (KK_ZCASH_PRIVACY OFF) and answer "Unknown message"; skip the class there, closing the transport via addCleanup since skipTest in setUp bypasses tearDown.
Firmware alpha (6816915a3) replaced direct dice entry with a host-selected mode and an on-device consent screen, then shows the device's 24 words before any roll. That firmware pinned python-keepkey f00e62f; a later re-pin to b44f1b3 (this alpha line) dropped the matching test, so test_reset_device_dice acked the consent screen as roll input and the device answered "Reset cancelled". Rewrite the test body for consent -> device words -> rolls -> digest confirm, and check the mnemonic against the published MIXED formula (device words + rolls; EntropyAck bytes excluded). Seed helpers and the requires_dice_modes capability gate come from f00e62f. Same test name, same two captures the report declares.
Firmware refuses a 68-byte approve(spender, 2^256-1) with "Unlimited ERC20 approval is disabled" (release-line policy since 7.14.2). This alpha line still expected signatures, so three tests failed on every full-variant run. Take the audit-line versions (f00e62f) that assert the refusal: test_approve_all, test_sign_uni_approve_liquidity_ETH, and the erc20-approve-unlimited clear-sign flow. Adds common.firmware_at_least.
Firmware authenticates before showing the SignMessage confirm since 7.14.2; this alpha line still expected the old order. Take the audit-line version (f00e62f), which gates the order on firmware_at_least.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Firmware CI's
python-integration-testsfails at import withImportError: cannot import name 'builder'. The cause:31d8c27regeneratedmessages_pb2.pyandmessages_ethereum_pb2.pywith a host protoc, producing builder-style code that needs protobuf >= 3.20. The integration container runs Python 3.6.9 with protobuf 3.17.3.This PR regenerates both files with
build_pb.shinside the CI-pinnedkktech/firmware@sha256:7438e539…image (protoc 3.5.1), the same way every earlier binding was built.test_erc7730_protocol_bindings.py+test_message_signing_protocol_bindings.py: 8 passed on protobuf 3.17.3 (py3.6, CI image) and 3.20.3. Control: the current alpha files fail to import in the CI image.setup.py:protobuf>=3.20.0→>=3.17,<4, the range actually tested. protoc 3.5.1 output does not load on protobuf >= 4.21.