Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
chore(release): v0.20-rc4 (#1546)
Browse files Browse the repository at this point in the history
* deps(sdk): bump to v0.46.4 (#1423)

* deps(sdk): bump to v0.46.4

* deps(sdk): add IAVLDisableFastNode flag with false default

* imp: reduce integration test block time to 2s (#1428)

* build(deps): bump github.com/onsi/gomega from 1.23.0 to 1.24.0 (#1429)

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](onsi/gomega@v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(rpc): different result from `eth_getProof` comparing with Ethereum (#1431)

* align with eth_getProof

for more info, see https://eips.ethereum.org/EIPS/eip-1186

* add GetHexProofs

* add change doc

* keep default res

* fix lint

* add e2e test

* Apply suggestions from code review

* fix lint

* nix run -f ./nix gomod2nix

* Refactor EIP-712 signature verification (#1397)

* [WIP] EIP-712 Signature Refactor

* Debug and add ante tests

* Add tests for failure cases

* Add changelog entry

* Code cleanup

* Add tests for MsgDelegate and MsgWithdrawDelegationReward

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Code cleanup

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Minor codefix

* Update ethereum/eip712/encoding.go

* Minor code revision updates

* Refactor EIP712 unit tests to use test suite

* Address import cycle and implement minor refactors

* Fix lint issues

* Add EIP712 unit suite test function

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/eip712/encoding.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Add minor refactors; increase test coverage

* Correct ante_test for change in payload

* Add single-signer util and tests

* Update ethereum/eip712/encoding.go

* Update ethereum/eip712/encoding.go

* fix build

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* fix: build test on mac by updating to python3.10 (#1437)

* build(deps): bump loader-utils from 1.4.0 to 1.4.1 in /tests/solidity (#1445)

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md)
- [Commits](webpack/loader-utils@v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* imp(evm): improve performance of EstimateGas (#1444)

* imp(evm): improve performance of EstimateGas

* changelog

* fix(rpc): decode `finalized` block number (#1442)

* fix(rpc): decode 'finalized' block number

* changelog

Co-authored-by: Freddy Caceres <facs95@gmail.com>

* build(deps): bump github.com/onsi/gomega from 1.24.0 to 1.24.1 (#1449)

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.24.0 to 1.24.1.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](onsi/gomega@v1.24.0...v1.24.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/spf13/viper from 1.13.0 to 1.14.0 (#1439)

Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](spf13/viper@v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 4rgon4ut <59182467+4rgon4ut@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* fix: unstable tx_priority test (#1440)

* fix unstable tx_priority test

* Update tests/integration_tests/test_priority.py

Co-authored-by: yihuang <huang@crypto.com>

* Update tests/integration_tests/test_priority.py

Co-authored-by: yihuang <huang@crypto.com>

Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Adi Saravanan <59209660+adisaran64@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* build(deps): bump github.com/cosmos/ibc-go/v5 from 5.0.1 to 5.1.0 (#1450)

Bumps [github.com/cosmos/ibc-go/v5](https://github.com/cosmos/ibc-go) from 5.0.1 to 5.1.0.
- [Release notes](https://github.com/cosmos/ibc-go/releases)
- [Changelog](https://github.com/cosmos/ibc-go/blob/v5.1.0/CHANGELOG.md)
- [Commits](cosmos/ibc-go@v5.0.1...v5.1.0)

---
updated-dependencies:
- dependency-name: github.com/cosmos/ibc-go/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump golangci/golangci-lint-action from 3.3.0 to 3.3.1 (#1454)

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor(all): refactor errors import to use cosmossdk.io (#1456)

* refactor (errors) refactor errors import to use cosmossdk.io instead of cosmos-sdk/types/errors

* refactor (errors) refactor errors import in ethsecp256k1 file

* refactor (errors) add changes to changelog

* build(deps): bump alpine from 3.16.2 to 3.16.3 (#1453)

Bumps alpine from 3.16.2 to 3.16.3.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Empty KV gas config (#1460)

* update sdk version

* setup empty gas config

* fix lint

* fix integration tests

* add Ante unit test

* update changelog

* test: remove unused integration tests (#1462)

* fix: remove e2e github action (#1463)

* remove unused tests

* imp: remove e2e github action

* build(deps): bump loader-utils from 1.4.1 to 1.4.2 in /tests/solidity (#1464)

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](webpack/loader-utils@v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore (deps): Update geth version to v1.10.25 (#1413)

* build(deps): bump github.com/ethereum/go-ethereum

Bumps [github.com/ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) from 1.10.19 to 1.10.25.
- [Release notes](https://github.com/ethereum/go-ethereum/releases)
- [Commits](ethereum/go-ethereum@v1.10.19...v1.10.25)

---
updated-dependencies:
- dependency-name: github.com/ethereum/go-ethereum
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* wip geth update

* fix geth init flag order

* add chainId to getTransaction. fix types comparison. update expected values on tests

* wip add tracer config

* tracers test

* update tests

* update to v1.10.25

* fix linter python

* ignore error

* fix lint

* additional changes from diff

* fix issues

* solve lint issues

* fix tests

* fix flake

* wrap types comparison in integration tests

* fix integration tests

* fix flake

* update changelog

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* Add EIP-712 encoding support type for any array (#1430)

* Add EIP-712 encoding support type for any array

* Refactor implementation + add tests

* Refactor unpacking implementation; refactor test case

* Fix lint issue

* Add MsgExec test case

* Update comment for clarity

* Add changelog entry

* Refactor `sdkerrors` to `errorsmod`

Co-authored-by: Freddy Caceres <facs95@gmail.com>

* fix: extend geth config on integration tests (#1467)

* changing git config and adding tests

* removing print statements

* remove unneccessary imports

* fix flake

* remove geth setup test

Co-authored-by: Freddy Caceres <facs95@gmail.com>

* tests: Add unit tests for rpc client endpoints (#1409)

* test: add preliminary unit tests and additional mocks for chain_info, account_info and filters

* tests: added additional mocked client calls

* tests: bumped coverage of call_tx to 56% and chain_info to 77%

* tests: bumped call_tx coverage to 70.2% and added additional mock client calls

* tests: tx_info preliminary tests added for debugging.

* tests: added test coverage for sign_tx and additional mocks

* tests: tx_info test coverage bumped to 60.3%

* test: coverage for tracing_tests now at 72%

* tests: added fee makert query client mocks and bumped chain_info to 87.6% coverage.

* tests: failing Cosmos auth module account query.

* tests: added FeeMarket Params mock to call_tx_test

* cleanup some unused code

* tests: added helper function to test suite for signing a Tx and bumped coverage of tx_info to 71.2%

* test: commented GetAccount error case and bumped chain_info to 90.3% coverage

* test: cleanup of tests in node_info, sign_tx and account_info

* Clean up print

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Apply suggestions from code review

* fix import issues

Co-authored-by: Vladislav Varadinov <vlad@evmos.org>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* Refactor to omit empty optionals from EIP-712 type generation (#1459)

* Refactor to omit empty values from type creation; add test for v1.vote

* Add test for createValidator with optional fields left blank

* Add changelog entry

* Update changelog entry

Co-authored-by: Freddy Caceres <facs95@gmail.com>

* fix: protogen scripts were not correctly implemented (#1466)

* Delete local copy of third party proto files

* Update protocgen script and buf yaml files to mirror cosmos-sdk

* Update makefile commands for proto-gen and proto-swagger-gen to correctly use docker

* Commit changed .pb.go files after updating the protogen scripts

* Adjust grep in proto-tools-installer script to look for correct gogoproto replacement

* address reviews - remove unnecessary ignore in buf.yaml and cosmos-sdk download in the protocgen script

* remove proto-update-deps from makefile as we don't store local copies of third party protofiles anymore

* Add changelog entry

* Update protoc-swagger-gen.sh

* Remove third party queries from swagger-ui config (for now)

* fix integrations tests

* fix dead changelog links (markdown-link-check)

Co-authored-by: Freddy Caceres <facs95@gmail.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* added gas consumption test (#1474)

* build(deps): bump github.com/cosmos/cosmos-proto (#1475)

Bumps [github.com/cosmos/cosmos-proto](https://github.com/cosmos/cosmos-proto) from 1.0.0-alpha7 to 1.0.0-alpha8.
- [Release notes](https://github.com/cosmos/cosmos-proto/releases)
- [Commits](cosmos/cosmos-proto@v1.0.0-alpha7...v1.0.0-alpha8)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-proto
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: chain-id in grpc query is not initialized without abci event (#1405)

* fix: chain-id in grpc query is not initialized without abci event

Closes: #1404

Solution:
- pass the chain-id from caller.

* Update CHANGELOG.md

* only override if input is not empty

* add comment to chain id

* pass chain-id to state transition

* Update x/evm/keeper/grpc_query.go

* Apply suggestions from code review

* fix golang lint

* update gomod2nix.toml

* fix unit tests

* update gomod2nix

* api breaking changelog

* add unit tests, and fix TraceBlock by the way

* Update CHANGELOG.md

* test --grpc-only mode in integration tests

* remove tmp var

* Update tests/integration_tests/test_grpc_only.py

* Update x/evm/keeper/grpc_query_test.go

Co-authored-by: mmsqe <tqd0800210105@gmail.com>

* fix linters

* fix nil pointer in tests

* fix conflicts

* fix conflicts

* fixes

* fix lint

* fix unit test

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* fix(evm): Simplify Gas Math (#1452)

* fix math

* changelog

* imp(ante): refactor `AnteHandler` (#1455)

* fix(ante): block gas check

* refactor

* rename

* use gas wanted

* remove consume gas logic on ante handler

* comment

* c++

* move min gas price

* comment

* Update app/ante/eth.go

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* fix build

* fix integration test script

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* tests: add additional gas consumption tests (#1477)

* split existing gas test

* added contract call test

* fix flake issues, update gomod2nix

* isort imports

* add stateful contract calls

* chore: update proto make commands (#1471)

* Update proto make commands to use cosmos docker image and add notes for possible problems

* Apply make proto-all with new docker container

* Remove stale DOCKER_BUF variable

* Revert to using the tendermintdev/sdk-proto-gen docker image

* remove '@' in proto-lint and proto-check-breaking for consistency with other commands

* Remove unnecessary go get from protocgen.sh (only works after adding --network host to docker run)

* Add --network host to docker run for compatibility on linux

* use cosmos/proto-builder docker image for proto-format because clang-format is not installed on tendermintdev/sdk-proto-gen

* update swagger docs after recent additions to evm.proto in #1413

Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>

* Remove unbound labels from added custom tendermint metrics (#1434)

* Remove unbound labels from added custom tendermint metrics

* Add entry to changelog

* deps: bump SDK to v0.46.6 (#1486)

* deps: bump SDK to v0.46.6

* changelog

* Update CHANGELOG.md

Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>

Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>

* fear(eip712): Add EIP-712 encoding for multiple messages of the same type (#1483)

* Add EIP-712 encoding for multiple messages of the same type

* Fix Protobuf encoding bug

* Add ante tests

* Refactor naming and minor implementation details

* Test empty transaction coverage

* Address revisions for code clarity

* Move aminoMessage type definition

* fix: enable `fixIssue172` flag for non-deterministic keyring test (#1447)

* enable fixIssue172 flag for test

for more info, https://github.com/btcsuite/btcutil/pull/182/files

* fix import

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Adi Saravanan <59209660+adisaran64@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* fix(tests): Delete inconsistent test (#1481)

* Delete inconsistent test

* delete test

* build(deps): bump alpine from 3.16.3 to 3.17.0 (#1492)

Bumps alpine from 3.16.3 to 3.17.0.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump google.golang.org/grpc from 1.50.1 to 1.51.0 (#1490)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.50.1 to 1.51.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.50.1...v1.51.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/onsi/ginkgo/v2 from 2.5.0 to 2.5.1 (#1489)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: refactor imports naming for clarity (#1491)

* chore: refactor imports naming for clarity

* Merge main and fix conflicts

* fix: align empty account result for old blocks as ethereum (#1484)

* align result account as ethereum

* add test_get_transaction_count

* add change doc

* sync gomod2nix

* Apply suggestions from code review

* crosscheck with ws & geth

* sync gomod2nix

* Update rpc/backend/utils.go

* use session provider

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* imp(ante): refactor AnteHandler (#1479)

* imp(ante): refactor AnteHandler

* fix test

* test

* Adjust deprecated sdkerrors import (#1493)

* refactor test files

* Apply suggestions from code review

Co-authored-by: 4rgon4ut <59182467+4rgon4ut@users.noreply.github.com>

* lint

* prioritization comment

* fix test

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: 4rgon4ut <59182467+4rgon4ut@users.noreply.github.com>

* chore: Update linter and protogen configuration (#1478)

* add protolint yaml

* Update .protolint.yml with Evmos settings

* Add super-linter.yml for GH action

* Copy .markdownlint.yml settings from Evmos

* Sort proto imports

* address protolint error in all Protobuf files

* update Makefile to mirror Proto commands for Evmos

* remove unnecessary go get command in protocgen.sh when using cosmos docker image

* copy .clang-format from Evmos repo

* apply make proto-format

* Execute make proto-all after changes to config are complete

* address last linter comment

* fix(server): telemetry setup (#1497)

* fix(server): telemetry setup

* more fixes

* fix

* changelog

* update standalone process

* chore(evm) - Delete deprecated store migrations (#1498)

* (fix): Delete deprecated migrations

* Update x/evm/module.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* fix(evm): Added Cancun and Shanghai blocks to ChainConfig (#1499)

* (refactor): Added Cancun and Shanghai blocks to ChainConfig

* (tests): Added test for invalid Shanghai and Cancun block

* (fix): ran proto linter

* Applied changes from code review

* Added CHANGELOG entry

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* chore(app): add store listener to Ethermint app (#1501)

* add store listener to Ethermint app

* add changelog entry

* build(deps): bump cosmossdk.io/math from 1.0.0-beta.3 to 1.0.0-beta.4 (#1502)

Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.0.0-beta.3 to 1.0.0-beta.4.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md)
- [Commits](cosmos/cosmos-sdk@math/v1.0.0-beta.3...math/v1.0.0-beta.4)

---
updated-dependencies:
- dependency-name: cosmossdk.io/math
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(app): register node service (#1505)

* fix(app): register node service

* changelog

* fix(cmd): add missing GetAuxToFeeCommand (#1504)

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* chore(feemarket): Delete deprecated migration logic (#1508)

* (refactor): Remove old migration code

* (fix): Lint and add CHANGELOG entry

* Remove simulation checks (#1507)

* Add cli rollback command

it's useful in app-hash mismatch situation.

* Update CHANGELOG.md

* (refactor): removed old sim tests logic

* (fix): removed tests from CI

* (fix): fix test.yml

* (fix): format and lint

* (fix): fix linter issue

* (fix): fix linter issues v2

* (fix): linter

* (fix): removed sim-test references

* Applied changes from code review

Co-authored-by: HuangYi <huang@crypto.com>

* chore: verify fees refactor (#1496)

* chore: verify fees refactor

* adjust call structure in rest of repo after splitting up DeductTxCostsFromUserBalance

* adjust test logic after splitting DeductTxCostsFromUserBalance up

* remove outdated TODO

* address PR comments - remove import name for evm keeper

* remove misleading comment

* address review comments - only handover boolean instead of context

* remove TODO

Co-authored-by: MalteHerrmann <malteherrmann.mail@web.de>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* json-rpc(filters) fix block hash on newBlock filter (#1503)

* tests(filters) add block hash check on newBlock filter

* tests(filters) fix linting errors

* fix(filters): fix newBlock filter response

* fix(filters): add changes on CHANGELOG file

* fix(ci): add gitleaks config (#1513)

* fix(ci): add gitleaks config to ignore init.sh

* make ci lint init.sh

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* tests(filters): add/improve integration tests for JSON-RPC methods (#1480)

* tests(filters) add block hash check on newBlock filter

* tests(filters) add getLogs test cases

* tests(filters) add eth_newFilter multiple filters test cases

* tests(filters) add eth_newFilter and eth_eth_uninstallFilter test case

* tests(filters) fix linting errors

* tests(filters) fix linting error on imports

* tests(filters) add test case: register filter before contract deploy

* tests(filters) refactor logs topics assertion

* tests(filters) add topics filter test cases

* tests(filters) fix linting errors

* tests(filters) remove unnecessary package.json file

* tests(filters) update based on PR comments

* tests(filters) separate getNewBlocks failing test to a separate PR

* tests(filters) add retry on send_tx to avoid Timeout error

* tests(filters) add logs by topic and block range test case

* update gomod2nix

* tests(filters) remove test elapsed time log

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* build(deps): bump minimist in /tests/integration_tests/hardhat (#1516)

Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](minimistjs/minimist@v1.2.5...v1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* tests(filters): add logs by topic test case (#1515)

* tests(filters) add logs by topic test case

* fix(logs): add getLogs http call in test

* tests(logs) add test case for getLogs by topic

* tests(logs) fix lint errors

* chore(all): markdownlint (#1522)

* build(deps): bump github.com/cosmos/cosmos-proto (#1525)

Bumps [github.com/cosmos/cosmos-proto](https://github.com/cosmos/cosmos-proto) from 1.0.0-alpha8 to 1.0.0-beta.1.
- [Release notes](https://github.com/cosmos/cosmos-proto/releases)
- [Commits](cosmos/cosmos-proto@v1.0.0-alpha8...v1.0.0-beta.1)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-proto
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump decode-uri-component in /tests/solidity (#1526)

Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* tests(integration): block gas limit tests (#1500)

* added antehandler test

* add integration tests

* add back gas call test

* added integration tests v2

* linters

* Update tests/integration_tests/test_gas.py

* Update tests/integration_tests/test_gas.py

* update gomod2nix

* Update tests/integration_tests/test_gas.py

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>

* chore(ante): deprecate legacy EIP-712 signature verification via AnteHandler (#1521)

* fix: rename EIP-712 sig. verification to indicate Legacy status

* Add changelog entry

* Update changelog, refactor implementation, update comments

* Apply suggestions from code review

* address comments

* changelog

* Update CHANGELOG.md

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* fix test

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* feat(ci): add Golang dependency vulnerability check (#1528)

* feat(ci): add Golang dependency vulnerability check

* update

* check run

* c++

* chore(evm): add comment regarding RANDOM opcode (#1520)

* fix: add random field to BlockContext using block header hash

* add comment

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* fix: Bump Go-Ethereum dependency to 1.10.26 (#1532)

* fix: Bump Go-Ethereum dependency to 1.10.26

* Add changelog entry

* build(deps): bump golang.org/x/text from 0.4.0 to 0.5.0 (#1534)

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](golang/text@v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump qs from 6.5.2 to 6.5.3 in /tests/solidity (#1537)

Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump golang.org/x/net from 0.2.0 to 0.3.0 (#1535)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](golang/net@v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump golang.org/x/net from 0.3.0 to 0.4.0 (#1542)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](golang/net@v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump technote-space/get-diff-action from 6.1.1 to 6.1.2 (#1541)

Bumps [technote-space/get-diff-action](https://github.com/technote-space/get-diff-action) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/technote-space/get-diff-action/releases)
- [Changelog](https://github.com/technote-space/get-diff-action/blob/main/.releasegarc)
- [Commits](technote-space/get-diff-action@v6.1.1...v6.1.2)

---
updated-dependencies:
- dependency-name: technote-space/get-diff-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* imp (docs): Point to Evmos mempool docs for tx prioritization (#1536)

* Adjust priority tip docs to point to Evmos mempool docs

* remove some typos and out of place commas in feemarket concepts

* add missing "in"

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Skip undeterministic integration test (#1531)

* skip undeterministic integration test

* fix flake

* update gomod2nix

* Rename getEIP712Hash to Bytes to clarity method intent (#1539)

* Rename getEIP712Hash to Bytes to clarity method intent

* Update comments and revert unrelated code

* Fix variable naming in tests

* Fix to use raw data rather than hash from Go-Ethereum interface

* Update eip712_test to detect EIP-712 hash vs bytes

* Update TypedData conversion error message

Co-authored-by: Freddy Caceres <facs95@gmail.com>

* build(deps): bump certifi in /tests/integration_tests (#1545)

Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](certifi/python-certifi@2022.09.24...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: improve error handling for EIP-712 encoding config init (#1543)

* Improve error handling for EIP-712 encoding config init

* changelog

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Daniel Burckhardt <daniel.m.burckhardt@gmail.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Austin Chandra <austinchandra@berkeley.edu>
Co-authored-by: 4rgon4ut <59182467+4rgon4ut@users.noreply.github.com>
Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Adi Saravanan <59209660+adisaran64@users.noreply.github.com>
Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: Ramiro Carlucho <ramirocarlucho@gmail.com>
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: Vladislav Varadinov <vlad@evmos.org>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: Devon Bear <itsdevbear@berachain.com>
Co-authored-by: v-homsi <110708931+v-homsi@users.noreply.github.com>
Co-authored-by: MalteHerrmann <malteherrmann.mail@web.de>
  • Loading branch information
18 people authored Dec 9, 2022
1 parent d24bfe7 commit 7f546d3
Show file tree
Hide file tree
Showing 23 changed files with 110 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
go-version: 1.19
check-latest: true
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.sol
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
check-latest: true
- name: "Checkout Repository"
uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: '12.x'
- name: Install dependencies
run: npm install
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
go-version: 1.19
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
Expand All @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
docs/**/*.md
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: cachix/cachix-action@v12
with:
name: ethermint
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.py
Expand All @@ -77,7 +77,7 @@ jobs:
- uses: cachix/cachix-action@v12
with:
name: ethermint
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Checkout Source
uses: actions/checkout@v3
- name: Get Diff
uses: technote-space/get-diff-action@v6.1.1
uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/*.go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: git config --global --add safe.directory /__w/ethermint/ethermint
- uses: actions/checkout@v3
- name: Get Diff
uses: technote-space/get-diff-action@v6.1.1
uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/*.go
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
go-version: 1.19
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.sol
Expand All @@ -49,7 +49,7 @@ jobs:
go-version: 1.19
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
Expand All @@ -70,7 +70,7 @@ jobs:
go-version: 1.19
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.sol
Expand All @@ -91,7 +91,7 @@ jobs:
with:
name: ethermint
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- uses: technote-space/get-diff-action@v6.1.1
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.sol
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [v0.20.0-rc3] - 2022-12-02
## [v0.20.0-rc4] - 2022-12-09

### State Machine Breaking

Expand Down Expand Up @@ -90,6 +90,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* (eip712) [#1543](https://github.com/evmos/ethermint/pull/1543) Improve error handling for EIP-712 encoding config initialization.
* (app) [#1505](https://github.com/evmos/ethermint/pull/1505) Setup gRPC node service with the application.
* (server) [#1497](https://github.com/evmos/ethermint/pull/1497) Fix telemetry server setup for observability
* (rpc) [#1442](https://github.com/evmos/ethermint/pull/1442) Fix decoding of `finalized` block number.
Expand Down
2 changes: 1 addition & 1 deletion app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ func (suite *AnteTestSuite) generateSingleSignature(signMode signing.SignMode, p
msg = signDocBytes

if signType == "EIP-712" {
msg, err = eip712.GetEIP712HashForMsg(signDocBytes)
msg, err = eip712.GetEIP712BytesForMsg(signDocBytes)
suite.Require().NoError(err)
}

Expand Down
3 changes: 3 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ import (
_ "github.com/evmos/ethermint/client/docs/statik"

"github.com/evmos/ethermint/app/ante"
"github.com/evmos/ethermint/ethereum/eip712"
srvflags "github.com/evmos/ethermint/server/flags"
ethermint "github.com/evmos/ethermint/types"
"github.com/evmos/ethermint/x/evm"
Expand Down Expand Up @@ -252,6 +253,8 @@ func NewEthermintApp(
cdc := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry

eip712.SetEncodingConfig(encodingConfig)

// NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx
bApp := baseapp.NewBaseApp(
appName,
Expand Down
6 changes: 3 additions & 3 deletions crypto/ethsecp256k1/ethsecp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ func (pubKey PubKey) VerifySignature(msg, sig []byte) bool {
}

// Verifies the signature as an EIP-712 signature by first converting the message payload
// to an EIP-712 hashed object, performing ECDSA verification on the hash. This is to support
// to EIP-712 object bytes, then performing ECDSA verification on the hash. This is to support
// signing a Cosmos payload using EIP-712.
func (pubKey PubKey) verifySignatureAsEIP712(msg, sig []byte) bool {
eip712Hash, err := eip712.GetEIP712HashForMsg(msg)
eip712Bytes, err := eip712.GetEIP712BytesForMsg(msg)
if err != nil {
return false
}

return pubKey.verifySignatureECDSA(eip712Hash, sig)
return pubKey.verifySignatureECDSA(eip712Bytes, sig)
}

// Perform standard ECDSA signature verification for the given raw bytes and signature.
Expand Down
11 changes: 5 additions & 6 deletions ethereum/eip712/eip712_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,17 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() {

// Verify that the payload passes signature verification if signed as its EIP-712 representation.
func (suite *EIP712TestSuite) verifyEIP712SignatureVerification(expectedSuccess bool, privKey ethsecp256k1.PrivKey, pubKey ethsecp256k1.PubKey, signBytes []byte) {
// Convert to EIP712 hash and sign
eip712Hash, err := eip712.GetEIP712HashForMsg(signBytes)
// Convert to EIP712 bytes and sign
eip712Bytes, err := eip712.GetEIP712BytesForMsg(signBytes)
if !expectedSuccess {
// Expect failure generating EIP-712 hash
// Expect failure generating EIP-712 bytes
suite.Require().Error(err)
return
}

suite.Require().NoError(err)

sigHash := crypto.Keccak256Hash(eip712Hash)
sig, err := privKey.Sign(sigHash.Bytes())
sig, err := privKey.Sign(eip712Bytes)
suite.Require().NoError(err)

// Verify against original payload bytes. This should pass, even though it is not
Expand All @@ -420,7 +419,7 @@ func (suite *EIP712TestSuite) verifyEIP712SignatureVerification(expectedSuccess
suite.Require().True(res)

// Verify against the signed EIP-712 bytes. This should pass, since it is the message signed.
res = pubKey.VerifySignature(eip712Hash, sig)
res = pubKey.VerifySignature(eip712Bytes, sig)
suite.Require().True(res)

// Verify against random bytes to ensure it does not pass unexpectedly (sanity check).
Expand Down
36 changes: 25 additions & 11 deletions ethereum/eip712/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,21 @@ func SetEncodingConfig(cfg params.EncodingConfig) {
protoCodec = codec.NewProtoCodec(cfg.InterfaceRegistry)
}

// Get the EIP-712 object hash for the given SignDoc bytes by first decoding the bytes into
// Get the EIP-712 object bytes for the given SignDoc bytes by first decoding the bytes into
// an EIP-712 object, then hashing the EIP-712 object to create the bytes to be signed.
// See https://eips.ethereum.org/EIPS/eip-712 for more.
func GetEIP712HashForMsg(signDocBytes []byte) ([]byte, error) {
func GetEIP712BytesForMsg(signDocBytes []byte) ([]byte, error) {
typedData, err := GetEIP712TypedDataForMsg(signDocBytes)
if err != nil {
return nil, err
}

domainSeparator, err := typedData.HashStruct("EIP712Domain", typedData.Domain.Map())
_, rawData, err := apitypes.TypedDataAndHash(typedData)
if err != nil {
return nil, fmt.Errorf("could not hash EIP-712 domain: %w", err)
return nil, fmt.Errorf("could not get EIP-712 object bytes: %w", err)
}

typedDataHash, err := typedData.HashStruct(typedData.PrimaryType, typedData.Message)
if err != nil {
return nil, fmt.Errorf("could not hash EIP-712 primary type: %w", err)
}
rawData := []byte(fmt.Sprintf("\x19\x01%s%s", string(domainSeparator), string(typedDataHash)))

return rawData, nil
return []byte(rawData), nil
}

// GetEIP712TypedDataForMsg returns the EIP-712 TypedData representation for either
Expand Down Expand Up @@ -85,6 +79,11 @@ func isValidEIP712Payload(typedData apitypes.TypedData) bool {
// decodeAminoSignDoc attempts to decode the provided sign doc (bytes) as an Amino payload
// and returns a signable EIP-712 TypedData object.
func decodeAminoSignDoc(signDocBytes []byte) (apitypes.TypedData, error) {
// Ensure codecs have been initialized
if err := validateCodecInit(); err != nil {
return apitypes.TypedData{}, err
}

var aminoDoc legacytx.StdSignDoc
if err := aminoCodec.UnmarshalJSON(signDocBytes, &aminoDoc); err != nil {
return apitypes.TypedData{}, err
Expand Down Expand Up @@ -140,6 +139,11 @@ func decodeAminoSignDoc(signDocBytes []byte) (apitypes.TypedData, error) {
// decodeProtobufSignDoc attempts to decode the provided sign doc (bytes) as a Protobuf payload
// and returns a signable EIP-712 TypedData object.
func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) {
// Ensure codecs have been initialized
if err := validateCodecInit(); err != nil {
return apitypes.TypedData{}, err
}

signDoc := &txTypes.SignDoc{}
if err := signDoc.Unmarshal(signDocBytes); err != nil {
return apitypes.TypedData{}, err
Expand Down Expand Up @@ -226,6 +230,16 @@ func decodeProtobufSignDoc(signDocBytes []byte) (apitypes.TypedData, error) {
return typedData, nil
}

// validateCodecInit ensures that both Amino and Protobuf encoding codecs have been set on app init,
// so the module does not panic if either codec is not found.
func validateCodecInit() error {
if aminoCodec == nil || protoCodec == nil {
return errors.New("missing codec: codecs have not been properly initialized using SetEncodingConfig")
}

return nil
}

// validatePayloadMessages ensures that the transaction messages can be represented in an EIP-712
// encoding by checking that messages exist, are of the same type, and share a single signer.
func validatePayloadMessages(msgs []sdk.Msg) error {
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/cosmos/gogoproto v1.4.3
github.com/cosmos/ibc-go/v5 v5.1.0
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.10.25
github.com/ethereum/go-ethereum v1.10.26
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
github.com/gorilla/mux v1.8.0
Expand All @@ -36,8 +36,8 @@ require (
github.com/tendermint/tendermint v0.34.23
github.com/tendermint/tm-db v0.6.7
github.com/tyler-smith/go-bip39 v1.1.0
golang.org/x/net v0.2.0
golang.org/x/text v0.4.0
golang.org/x/net v0.4.0
golang.org/x/text v0.5.0
google.golang.org/genproto v0.0.0-20221116193143-41c2ba794472
google.golang.org/grpc v1.51.0
sigs.k8s.io/yaml v1.3.0
Expand Down Expand Up @@ -177,8 +177,8 @@ require (
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/term v0.2.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.102.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0=
github.com/ethereum/go-ethereum v1.10.25 h1:5dFrKJDnYf8L6/5o42abCE6a9yJm9cs4EJVRyYMr55s=
github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s=
github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0=
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk=
Expand Down Expand Up @@ -1187,8 +1187,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1300,13 +1300,13 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1316,8 +1316,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
Loading

0 comments on commit 7f546d3

Please sign in to comment.