ethermint icon indicating copy to clipboard operation
ethermint copied to clipboard

fix: eip712 support for pubkey any messages

Open hanchon opened this issue 2 years ago • 6 comments

Closes: #XXX

Description

Most messages with EIP712 are working fine, but the code is not working if some values that are not the cosmos transaction itself, are contained inside a proto.Any object.

The issue is that when we create read the transactions values, they are parsed using the JSON lib, for example, for public keys it returns the base64 representation of the pubkey as a string.

When the lib generates the types for the EIP712 message, it uses codec.UnpackAny if the message is contained inside a proto.Any object it will return {type:string, value:...} instead of the expected string

For now the only value that I found that is sent as a proto.Any message is the pubkey, but I need to review the rest of the cosmos-sdk messages


For contributor use:

  • [ ] Targeted PR against correct branch (see CONTRIBUTING.md)
  • [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • [ ] Code follows the module structure standards.
  • [ ] Wrote unit and integration tests
  • [ ] Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • [ ] Added relevant godoc comments.
  • [ ] Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • [ ] Re-reviewed Files changed in the Github PR explorer

For admin use:

  • [ ] Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • [ ] Reviewers assigned
  • [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

hanchon avatar May 04 '22 11:05 hanchon

This PR would close https://github.com/tharsis/evmos/issues/545

zmanian avatar May 04 '22 15:05 zmanian

@zmanian we also would need to remove the single signature check as @tony-iqlusion mentioned

fedekunze avatar May 04 '22 15:05 fedekunze

Iqlusion would be willing to join the validator set with a single sig ledger backed key.

zmanian avatar May 04 '22 15:05 zmanian

It's a partial fix for the issue.

zmanian avatar May 04 '22 15:05 zmanian

Codecov Report

Merging #1076 (03cc04b) into main (d559893) will increase coverage by 0.09%. The diff coverage is n/a.

:exclamation: Current head 03cc04b differs from pull request most recent head f7ea579. Consider uploading reports for the commit f7ea579 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1076      +/-   ##
==========================================
+ Coverage   59.39%   59.49%   +0.09%     
==========================================
  Files          85       84       -1     
  Lines        6992     6940      -52     
==========================================
- Hits         4153     4129      -24     
+ Misses       2622     2598      -24     
+ Partials      217      213       -4     
Impacted Files Coverage Δ
rpc/types/utils.go 0.00% <0.00%> (ø)
x/evm/client/cli/query.go 0.00% <0.00%> (ø)
x/evm/migrations/v2/migration.go
x/evm/keeper/state_transition.go 75.54% <0.00%> (+0.16%) :arrow_up:
x/evm/module.go 53.73% <0.00%> (+0.87%) :arrow_up:
x/evm/types/params.go 100.00% <0.00%> (+6.52%) :arrow_up:
x/evm/keeper/migrations.go 100.00% <0.00%> (+33.33%) :arrow_up:

codecov[bot] avatar May 26 '22 16:05 codecov[bot]

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs.

github-actions[bot] avatar Jul 11 '22 02:07 github-actions[bot]

Replaced by this https://github.com/evmos/ethermint/pull/1283

facs95 avatar Aug 19 '22 13:08 facs95