feat: render byte sequence call args as text or hex instead of per-byte cards#2549
Open
stepanLav wants to merge 3 commits into
Open
feat: render byte sequence call args as text or hex instead of per-byte cards#2549stepanLav wants to merge 3 commits into
stepanLav wants to merge 3 commits into
Conversation
6 tasks
- Ignore 6 new RUSTSEC advisories (bytes, libsecp256k1, rustls-webpki, time) in deny.toml following the existing transitive-dependency convention; these come from substrate/subxt/jsonrpsee and have no upgrade path available yet. - Fix real spelling typos in docs/comments (particular, cryptographic, Polkadot.js, running, uninitiated). - Add missing domain/code terms to the spellcheck dictionary. Verified locally with cargo-spellcheck 0.15.7 (matching CI): exit 0.
eea0eee to
5f35539
Compare
Xcode runs script phases with a minimal PATH that excludes Homebrew's bin dir (/opt/homebrew/bin on Apple Silicon), so 'which swiftformat' failed even when installed. The script then fell into a brittle install/symlink branch and ended with an 'echo error:' while exiting 0, producing the 'Failed to install SwiftFormat' error and the spurious 'PhaseScriptExecution emitted errors but did not return a nonzero exit code' message. Prepend Homebrew paths to PATH, drop the Homebrew-bootstrap and symlink hacks, and downgrade the not-installed case to a warning.
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.
Purpose
With the metadata-proof parsing flow (payload types
06/07),Vec<u8>call arguments are rendered as one numeric card per byte. Asystem.remarkWithEventremark turns into a screen-long column of decimal numbers (123,34,107, …) that is impossible to review before signing.The legacy decoder (
decoding_sci.rs) already special-casesremark/remark_with_eventfields and shows them as a single text card — this behavior was lost when call decoding moved to the state-machine parser.Scope
rust/parser/src/state_machine.rs— byte sequences (Vec<u8>) now collapse into a single card invisit_sequence: UTF-8 text when the current state expects text,0x…hex otherwise (also a fallback for non-UTF-8 "text" bytes). Added a minimalU8Collectorvisitor to drain the bytes without producing per-byte cards.rust/parser/src/state.rs— newTextStateand aState::expects_text()hook; the defaultprocess_fieldentersTextStatefor fields namedremark/remark_with_event, mirroring the legacy decoder rule.rust/parser/src/tests.rs— three new tests: remark rendered as text, invalid-UTF-8 remark rendered as hex, non-remark byte sequence (e.g.system.set_code) rendered as a single hex card.No UI changes needed:
ParserCard::Textalready maps toTextCardand is rendered by both apps.Discussion
Vec<u8>rendering: a single0xdeadbeefline is reviewable and matches how other tools display byte blobs. Text rendering is deliberately limited to remark-like fields to avoid content-sniffing on a signing device.Screenshots
Before:
system.remarkWithEventremark shown as a column of decimal byte values, one row per byte.Screenshot
After:
Screenshot