Repository navigation
fix: preserve leading zeros in ENS Ethereum address fallback - #5436
mortezashojaei wants to merge 4 commits into
Conversation
|
@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 8eaa99a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I know the description keeps other coin types as they are, so this may be out of scope, but in case it helps: I ran this branch (8eaa99a) with a small offline test: a
Would it make sense to apply the padding to EVM coin types too? For example, |
|
Superseded by #5442, which keeps your commits and extends the fix to ENSIP-11 EVM chain coin types. Thanks @mortezashojaei! |
Summary
getEnsAddresstrims leading zeros in its address-response compatibility path, then requires 20 bytes. ForcoinType: 60n, this rejects valid leading-zero Ethereum addresses and throws for the zero address instead of returningnull.Reuses
pad, declares its error type, and names the address/ABI-word sizes. Other coin types and successful dynamic-bytes decoding keep their existing behavior. Includes a patch changeset describing both corrected behaviors.Evidence
abiandrawregression rows fail on base source.After: all 28 ENS tests pass locally with the normal Anvil harness. Dynamic bytes have a separately named compatibility test. Additional controls cover other coin types, short/oversized data, and dirty padding.
pnpm check:types, the full pre-commit Biome check, andgit diff --checkpassed locally.CI for
a41c5a0completed: 20 jobs passed, four failed, and five core shards were cancelled by fail-fast. CI is not cleared for merge.Comparison against exact base
9f083800:Merge Danger
Door: two-way
Blast Radius: ENS
The added interpretation is restricted to Ethereum (
coinType: 60n). No new API or dependencies.For
coinType: 60n, the address-response path accepts every 32-byte word with a numeric value below2^160, returningnullfor zero. This includes words that could instead be incomplete ABI offsets, lengths, or other scalars; the ambiguity is not limited to0x20. Tests include0x1,0x20, and0x40. Words at or above2^160are rejected by this path.Whether to retain or remove the 32-byte compatibility branch is a maintainer decision. These tests establish decoding behavior, not what live gateways return. Universal malformed-response rejection is not promised.
Prepared with AI assistance; the checks above were run locally.