Repository navigation
fix(calldata): always emit DECIMALS in PARAM_UNIT - #353
Merged
Merged
Conversation
app-ethereum >= 1.22.4 rejects PARAM_UNIT structs without DECIMALS (6a80), although its spec documents the tag as optional with a default of 0. Unit fields without decimals (e.g. opencover "Cover duration") therefore fall back to blind signing on released devices. Always serialize DECIMALS, defaulting to 0, which is byte-for-byte the value the app is specified to assume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ckorchane-ledger
approved these changes
Oct 9, 2026
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.
Problem
app-ethereum commit
21d2695f(shipped since 1.22.4) madeDECIMALSmandatory inPARAM_UNIT, while the app's own spec documents it as optional with a default of0. python-erc7730 only emitted the tag whendecimalswas set, so anyunitfield without decimals is rejected with6a80and the whole transaction falls back to blind signing on released devices (e.g. opencover's "Cover duration").Fix
Always serialize
DECIMALSintlv_param_unit, defaulting to0— the exact value the app is specified to assume when the tag is absent, so display is unchanged. The calldata model (decimals: int | None) is left as is.The app-side check should still be relaxed (or the spec updated) so other descriptor producers don't hit the same issue.
Tests
test_convert_unit_always_serializes_decimals(unset →0, set → value); the unset case fails without the fix.prek run --all-filesandpytest testspass locally.🤖 Generated with Claude Code