feat(thorchain): any-denom MsgSend (TCY/RUJI) + refactor(eip712): eth-sig-util→eip-712#48
Merged
Merged
Conversation
Drop the hardcoded `denom !== 'rune'` rejection in the keepkey MsgSend signer and forward non-rune denoms to the device via the ThorchainMsgSend.denom proto field (device-protocol 7.16.0+). Firmware defaults an unset denom to 'rune', so denom is only set when it differs — existing RUNE sends keep byte-identical proto/signatures. TCY, RUJI/Rujira and secured assets (e.g. btc-btc) now sign as MsgSend.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…uct hashing ethSignTypedData used @metamask/eth-sig-util's TypedDataUtils.hashStruct only to compute the domain separator + message hash sent to the firmware (one import, two call sites). eip-712's getStructHash is a byte-identical V4 replacement — verified across nested structs, V4 struct arrays (the one V3/V4 divergence) and the real Permit2 payload — and hdwallet-core already depends on eip-712. Drops @metamask/eth-sig-util + @metamask/utils (2.8MB) + its NESTED @ethereumjs@4/common chain (a Windows MAX_PATH deep-path offender) and a redundant second EIP-712 lib. Top-level @ethereumjs@3 (tx signing) is untouched. Signatures are unchanged (neutral to the open 7.14 EIP-712 signing incident — same hashes as before). Adds a known-answer regression test pinning getStructHash output.
25db446 to
91a9e9d
Compare
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.
Two ff-only commits on top of master (c5a4d79):
1. e39ff8c — feat(thorchain): allow any denom in MsgSend (TCY, RUJI, secured assets) — forwards non-rune denoms via ThorchainMsgSend.denom (device-protocol 7.16.0+). Verified live: TCY→RUJI mainnet swap signed + broadcast.
2. 25db446 — refactor(eip712): replace @metamask/eth-sig-util with eip-712 — ethSignTypedData used eth-sig-util only for TypedDataUtils.hashStruct (domain separator + message hash → firmware). eip-712.getStructHash is a byte-identical V4 replacement (verified across nested structs, V4 struct arrays, real Permit2) and hdwallet-core already depends on it. Drops @metamask/eth-sig-util + @metamask/utils (2.8MB) + its nested @ethereumjs@4 chain (a Windows MAX_PATH deep-path offender) + a redundant second EIP-712 lib. Top-level @ethereumjs@3 (tx signing) untouched. Signatures unchanged. Adds a known-answer regression test.
Pinned by keepkey-vault feature-ruji (PR #292).