EIPs icon indicating copy to clipboard operation
EIPs copied to clipboard

Update EIP-712: Fix incorrect byte counts

Open jshufro opened this issue 1 year ago • 4 comments

The current byte counts are plainly wrong and easy to fix. The first commit fixes it. The second gets the linter to be quiet - excepting a couple spurious errors.

The example signature only has 65 bytes, but is said to 129 bytes:

$ echo -n "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c" | wc -c
132

Removing 2 characters for the 0x prefix leaves 130 characters of hex, which encodes only 65 bytes.

(Oddly, the "last byte" on top of 128 bytes is counted as 1 character instead of 2)

Appendix F of the yellow paper and the function signature in EIP-191 (signatureBasedExecution(address target, uint256 nonce, bytes memory payload, uint8 v, bytes32 r, bytes32 s) public payable) reaffirm that these fields are 32 bytes, ergo 64 characters of hex, or when combined, 64 byte ergo 128 characters of hex. The final byte is one byte and 2 characters of hex for 65 total bytes and 130 hex characters, or 132 with the prefix.

jshufro avatar Jul 04 '24 18:07 jshufro

File EIPS/eip-712.md

Requires 1 more reviewers from @dekz, @logvinovleon, @recmo Requires 2 more reviewers from @axic, @g11tech, @gcolvin, @samwilsn, @xinbenlv

eth-bot avatar Jul 04 '24 18:07 eth-bot

The remaining linter errors feel very much out of my jurisdiction :sob:

jshufro avatar Jul 04 '24 18:07 jshufro

ok

Parasos avatar Jul 04 '24 19:07 Parasos

@jshufro thanks for the contribution! For Final proposals, you should completely ignore the linter and make only the minimal required change. Since you have them in separate commits, just remove 1de8cf44f01334f97f791cdb023feb0a57135d96.

SamWilsn avatar Jul 10 '24 22:07 SamWilsn

I've rebased and dropped 1de8cf4

jshufro avatar Jul 11 '24 00:07 jshufro

The commit 188f7aa0daf404a4e9399b4d1869ddb1b70b82d0 (as a parent of c7d84ae5f2d685f69625fe82b08a1b36354d73fe) contains errors. Please inspect the Run Summary for details.

github-actions[bot] avatar Jul 11 '24 00:07 github-actions[bot]

@jshufro thanks for the contribution! For Final proposals, you should completely ignore the linter and make only the minimal required change. Since you have them in separate commits, just remove 1de8cf4.

Anything I need to do to move this forwards?

jshufro avatar Jul 24 '24 00:07 jshufro