From d24bfe79652283cb76698a7380cfceefe5266c7e Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Fri, 2 Dec 2022 15:03:41 +0100 Subject: [PATCH] chore: release `v0.20.0-rc3` (#1529) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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](https://github.com/onsi/gomega/compare/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] Signed-off-by: dependabot[bot] 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 * 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](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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 * 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](https://github.com/onsi/gomega/compare/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] Signed-off-by: dependabot[bot] 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](https://github.com/spf13/viper/compare/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] Signed-off-by: dependabot[bot] 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 * Update tests/integration_tests/test_priority.py Co-authored-by: yihuang Co-authored-by: yihuang 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](https://github.com/cosmos/ibc-go/compare/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] Signed-off-by: dependabot[bot] 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](https://github.com/golangci/golangci-lint-action/compare/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] Signed-off-by: dependabot[bot] 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] Signed-off-by: dependabot[bot] 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](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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](https://github.com/ethereum/go-ethereum/compare/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] * 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] 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 * 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 * 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 * 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 Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Freddy Caceres * 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 * 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 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](https://github.com/cosmos/cosmos-proto/compare/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] Signed-off-by: dependabot[bot] 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 * 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 Co-authored-by: Freddy Caceres * 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 * fix build * fix integration test script Co-authored-by: Vladislav Varadinov Co-authored-by: Freddy Caceres * 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 * 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] Signed-off-by: dependabot[bot] 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](https://github.com/grpc/grpc-go/compare/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] Signed-off-by: dependabot[bot] 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](https://github.com/onsi/ginkgo/compare/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] Signed-off-by: dependabot[bot] 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](https://github.com/cosmos/cosmos-sdk/compare/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] Signed-off-by: dependabot[bot] 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 * 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 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 * 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](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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](https://github.com/cosmos/cosmos-proto/compare/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] Signed-off-by: dependabot[bot] 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](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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 * 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 * fix test Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Vladislav Varadinov * 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> * update release date * update changelog Signed-off-by: dependabot[bot] Co-authored-by: Daniel Burckhardt Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mmsqe Co-authored-by: Austin Chandra Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: 4rgon4ut <59182467+4rgon4ut@users.noreply.github.com> Co-authored-by: yihuang 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 Co-authored-by: Vladislav Varadinov Co-authored-by: Vladislav Varadinov Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com> Co-authored-by: mmsqe Co-authored-by: Devon Bear Co-authored-by: v-homsi <110708931+v-homsi@users.noreply.github.com> Co-authored-by: MalteHerrmann --- .github/workflows/dependencies.yml | 28 ++++++ .github/workflows/lint.yml | 2 +- CHANGELOG.md | 8 +- Makefile | 6 +- app/ante/ante.go | 4 +- app/ante/eip712.go | 43 ++++++++-- app/ante/eth_test.go | 12 +++ app/ante/handler_options.go | 24 ------ cmd/ethermintd/flags.go | 4 +- default.nix | 2 +- go.mod | 2 +- go.sum | 4 +- gomod2nix.toml | 4 +- tests/integration_tests/README.md | 7 +- .../hardhat/package-lock.json | 15 ++-- tests/integration_tests/test_filters.py | 30 +++++++ tests/integration_tests/test_gas.py | 86 ++++++++++++++----- tests/solidity/yarn.lock | 6 +- x/evm/keeper/state_transition.go | 6 ++ x/feemarket/spec/01_concepts.md | 2 +- 20 files changed, 213 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/dependencies.yml mode change 100755 => 100644 tests/integration_tests/test_gas.py diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml new file mode 100644 index 00000000..c7f3aa8a --- /dev/null +++ b/.github/workflows/dependencies.yml @@ -0,0 +1,28 @@ +name: "Dependency Review" +on: pull_request + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: 1.19 + check-latest: true + - name: "Checkout Repository" + uses: actions/checkout@v3 + - uses: technote-space/get-diff-action@v6.1.1 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - name: "Dependency Review" + uses: actions/dependency-review-action@v3 + if: env.GIT_DIFF + - name: "Go vulnerability check" + run: make vulncheck + if: env.GIT_DIFF diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9456bb5c..f9c1d988 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,7 +32,7 @@ jobs: args: --timeout 10m github-token: ${{ secrets.github_token }} # Check only if there are differences in the source code - if: "env.GIT_DIFF" + if: env.GIT_DIFF markdown-lint: name: Run markdown-lint runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 98dc0747..3d28f95e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,11 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog -## [v0.20.0-rc3] - 2022-11-30 +## [v0.20.0-rc3] - 2022-12-02 ### State Machine Breaking -* (deps) [#1419](https://github.com/evmos/ethermint/pull/1419) Add ics23 patch for dragonberry and bump iavl to v0.19.4 * (deps) [#1361](https://github.com/evmos/ethermint/pull/1361) Bump ibc-go to [`v5.1.0`](https://github.com/cosmos/ibc-go/releases/tag/v5.1.0) * (evm) [\#1272](https://github.com/evmos/ethermint/pull/1272) Implement modular interface for the EVM. * (deps) [#1168](https://github.com/evmos/ethermint/pull/1168) Upgrade Cosmos SDK to [`v0.46.6`](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.6). @@ -51,15 +50,18 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (ante) [1460](https://github.com/evmos/ethermint/pull/1460) Add KV Gas config on ethereum Txs. * (eth) [#1459](https://github.com/evmos/ethermint/pull/1459) Added support for messages with optional types omitted on eip712. * (geth) [#1413](https://github.com/evmos/ethermint/pull/1413) Update go-ethereum version to [`v1.10.26`](https://github.com/ethereum/go-ethereum/releases/tag/v1.10.26). +* (deps) [#1419](https://github.com/evmos/ethermint/pull/1419) Add ics23 patch for dragonberry and bump iavl to v0.19.4 ### API Breaking +* (ante) [#1521](https://github.com/evmos/ethermint/pull/1521) Deprecate support for legacy EIP-712 signature verification implementation via AnteHandler decorator. * (ante) [#1214](https://github.com/evmos/ethermint/pull/1214) Set mempool priority to EVM transactions. * (evm) [#1405](https://github.com/evmos/ethermint/pull/1405) Add parameter `chainID` to evm keeper's `EVMConfig` method, so caller can choose to not use the cached `eip155ChainID`. ### Features -- (app) [#1501](https://github.com/evmos/ethermint/pull/1501) Set default File store listener for application from [ADR38](https://docs.cosmos.network/v0.47/architecture/adr-038-state-listening) +* (ci) [#1528](https://github.com/evmos/ethermint/pull/1528) Add Golang dependency vulnerability checker. +* (app) [#1501](https://github.com/evmos/ethermint/pull/1501) Set default File store listener for application from [ADR38](https://docs.cosmos.network/v0.47/architecture/adr-038-state-listening) ### Improvements diff --git a/Makefile b/Makefile index 2d698c74..e9cc5663 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ clean: all: build -build-all: tools build lint test +build-all: tools build lint test vulncheck .PHONY: distclean clean build-all @@ -273,6 +273,10 @@ go.sum: go.mod go mod verify go mod tidy +vulncheck: $(BUILDDIR)/ + GOBIN=$(BUILDDIR) go install golang.org/x/vuln/cmd/govulncheck@latest + $(BUILDDIR)/govulncheck ./... + ############################################################################### ### Documentation ### ############################################################################### diff --git a/app/ante/ante.go b/app/ante/ante.go index 88bb9d0e..c3a4b1bf 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -46,8 +46,8 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { // handle as *evmtypes.MsgEthereumTx anteHandler = newEthAnteHandler(options) case "/ethermint.types.v1.ExtensionOptionsWeb3Tx": - // handle as normal Cosmos SDK tx, except signature is checked for EIP712 representation - anteHandler = newCosmosAnteHandlerEip712(options) + // Deprecated: Handle as normal Cosmos SDK tx, except signature is checked for Legacy EIP712 representation + anteHandler = NewLegacyCosmosAnteHandlerEip712(options) case "/ethermint.types.v1.ExtensionOptionDynamicFeeTx": // cosmos-sdk tx with dynamic fee extension anteHandler = newCosmosAnteHandler(options) diff --git a/app/ante/eip712.go b/app/ante/eip712.go index 96f6e373..c773ba40 100644 --- a/app/ante/eip712.go +++ b/app/ante/eip712.go @@ -13,6 +13,7 @@ import ( authante "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + ibcante "github.com/cosmos/ibc-go/v5/modules/core/ante" ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/secp256k1" @@ -32,19 +33,47 @@ func init() { ethermintCodec = codec.NewProtoCodec(registry) } -// Eip712SigVerificationDecorator Verify all signatures for a tx and return an error if any are invalid. Note, -// the Eip712SigVerificationDecorator decorator will not get executed on ReCheck. +// Deprecated: NewLegacyCosmosAnteHandlerEip712 creates an AnteHandler to process legacy EIP-712 +// transactions, as defined by the presence of an ExtensionOptionsWeb3Tx extension. +func NewLegacyCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler { + return sdk.ChainAnteDecorators( + RejectMessagesDecorator{}, // reject MsgEthereumTxs + authante.NewSetUpContextDecorator(), + authante.NewValidateBasicDecorator(), + authante.NewTxTimeoutHeightDecorator(), + NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper), + authante.NewValidateMemoDecorator(options.AccountKeeper), + authante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), + authante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), + // SetPubKeyDecorator must be called before all signature verification decorators + authante.NewSetPubKeyDecorator(options.AccountKeeper), + authante.NewValidateSigCountDecorator(options.AccountKeeper), + authante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer), + // Note: signature verification uses EIP instead of the cosmos signature validator + NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), + authante.NewIncrementSequenceDecorator(options.AccountKeeper), + ibcante.NewRedundantRelayDecorator(options.IBCKeeper), + NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper), + ) +} + +// Deprecated: LegacyEip712SigVerificationDecorator Verify all signatures for a tx and return an error if any are invalid. Note, +// the LegacyEip712SigVerificationDecorator decorator will not get executed on ReCheck. +// NOTE: As of v0.20.0, EIP-712 signature verification is handled by the ethsecp256k1 public key (see ethsecp256k1.go) // // CONTRACT: Pubkeys are set in context for all signers before this decorator runs // CONTRACT: Tx must implement SigVerifiableTx interface -type Eip712SigVerificationDecorator struct { +type LegacyEip712SigVerificationDecorator struct { ak evmtypes.AccountKeeper signModeHandler authsigning.SignModeHandler } -// NewEip712SigVerificationDecorator creates a new Eip712SigVerificationDecorator -func NewEip712SigVerificationDecorator(ak evmtypes.AccountKeeper, signModeHandler authsigning.SignModeHandler) Eip712SigVerificationDecorator { - return Eip712SigVerificationDecorator{ +// Deprecated: NewLegacyEip712SigVerificationDecorator creates a new LegacyEip712SigVerificationDecorator +func NewLegacyEip712SigVerificationDecorator( + ak evmtypes.AccountKeeper, + signModeHandler authsigning.SignModeHandler, +) LegacyEip712SigVerificationDecorator { + return LegacyEip712SigVerificationDecorator{ ak: ak, signModeHandler: signModeHandler, } @@ -52,7 +81,7 @@ func NewEip712SigVerificationDecorator(ak evmtypes.AccountKeeper, signModeHandle // AnteHandle handles validation of EIP712 signed cosmos txs. // it is not run on RecheckTx -func (svd Eip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, +func (svd LegacyEip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler, diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go index 1f591845..6d42310c 100644 --- a/app/ante/eth_test.go +++ b/app/ante/eth_test.go @@ -9,6 +9,7 @@ import ( "github.com/evmos/ethermint/app/ante" "github.com/evmos/ethermint/server/config" "github.com/evmos/ethermint/tests" + ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm/statedb" evmtypes "github.com/evmos/ethermint/x/evm/types" @@ -180,6 +181,9 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() { tx2.From = addr.Hex() tx2Priority := int64(1) + tx3GasLimit := ethermint.BlockGasLimit(suite.ctx) + uint64(1) + tx3 := evmtypes.NewTxContract(suite.app.EvmKeeper.ChainID(), 1, big.NewInt(10), tx3GasLimit, gasPrice, nil, nil, nil, ðtypes.AccessList{{Address: addr, StorageKeys: nil}}) + dynamicFeeTx := evmtypes.NewTxContract(suite.app.EvmKeeper.ChainID(), 1, big.NewInt(10), tx2GasLimit, nil, // gasPrice new(big.Int).Add(baseFee, big.NewInt(evmtypes.DefaultPriorityReduction.Int64()*2)), // gasFeeCap @@ -216,6 +220,14 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() { false, false, 0, }, + { + "gas limit above block gas limit", + tx3, + math.MaxUint64, + func() {}, + false, false, + 0, + }, { "not enough balance for fees", tx2, diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index 96387aa6..cacf2896 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -87,27 +87,3 @@ func newCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler { NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper), ) } - -func newCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler { - return sdk.ChainAnteDecorators( - RejectMessagesDecorator{}, // reject MsgEthereumTxs - ante.NewSetUpContextDecorator(), - // NOTE: extensions option decorator removed - // ante.NewRejectExtensionOptionsDecorator(), - ante.NewValidateBasicDecorator(), - ante.NewTxTimeoutHeightDecorator(), - NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper), - ante.NewValidateMemoDecorator(options.AccountKeeper), - ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), - ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), - // SetPubKeyDecorator must be called before all signature verification decorators - ante.NewSetPubKeyDecorator(options.AccountKeeper), - ante.NewValidateSigCountDecorator(options.AccountKeeper), - ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer), - // Note: signature verification uses EIP instead of the cosmos signature validator - NewEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), - ante.NewIncrementSequenceDecorator(options.AccountKeeper), - ibcante.NewRedundantRelayDecorator(options.IBCKeeper), - NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper), - ) -} diff --git a/cmd/ethermintd/flags.go b/cmd/ethermintd/flags.go index ed835f59..ea2b661f 100644 --- a/cmd/ethermintd/flags.go +++ b/cmd/ethermintd/flags.go @@ -8,9 +8,7 @@ import ( "github.com/evmos/ethermint/version" ) -const ( - flagLong = "long" -) +const flagLong = "long" func init() { infoCmd.Flags().Bool(flagLong, false, "Print full information") diff --git a/default.nix b/default.nix index c319aeaf..9b621609 100644 --- a/default.nix +++ b/default.nix @@ -3,7 +3,7 @@ , rev ? "dirty" }: let - version = "v0.17.1"; + version = "v0.20.0-rc2"; pname = "ethermintd"; tags = [ "netgo" ]; ldflags = lib.concatStringsSep "\n" ([ diff --git a/go.mod b/go.mod index 5d32bc62..16e4a358 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/armon/go-metrics v0.4.1 github.com/btcsuite/btcd v0.22.1 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce - github.com/cosmos/cosmos-proto v1.0.0-alpha8 + github.com/cosmos/cosmos-proto v1.0.0-beta.1 github.com/cosmos/cosmos-sdk v0.46.6 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.3 diff --git a/go.sum b/go.sum index 5fa85f45..710f7af4 100644 --- a/go.sum +++ b/go.sum @@ -226,8 +226,8 @@ github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= -github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= +github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= +github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= github.com/cosmos/cosmos-sdk v0.46.6 h1:K9EZsqOZ2jQX3bIQUpn7Hk/YCoaJWRLU56PzvpX8INk= github.com/cosmos/cosmos-sdk v0.46.6/go.mod h1:JNklMfXo7MhDF1j/jxZCmDyOYyqhVoKB22e8p1ATEqA= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= diff --git a/gomod2nix.toml b/gomod2nix.toml index 650e3d13..f09b5bae 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -94,8 +94,8 @@ schema = 3 version = "v1.0.4" hash = "sha256-JvcBXBdjdmnaW/nyf/tw/uaOAGn1b78yxrtl2/Rs3kA=" [mod."github.com/cosmos/cosmos-proto"] - version = "v1.0.0-alpha8" - hash = "sha256-iXzXoS5Kfh5DBy+PhdFWraDWXda/3M4j7j4VECjv4CA=" + version = "v1.0.0-beta.1" + hash = "sha256-oATkuj+fM5eBn+ywO+w/tL0AFSIEkx0J3Yz+VhVe0QA=" [mod."github.com/cosmos/cosmos-sdk"] version = "v0.46.6" hash = "sha256-H1VZxZUWXhpXiY3A9smLp09MEGpXmh+XvX6YUiXPcpQ=" diff --git a/tests/integration_tests/README.md b/tests/integration_tests/README.md index d321b7fb..df4c2b8a 100644 --- a/tests/integration_tests/README.md +++ b/tests/integration_tests/README.md @@ -44,12 +44,11 @@ pytest -s -vv If you're changing anything on the ethermint rpc, rerun the first command. - ## Caching You can enable Binary Cache to speed up the tests: ``` -$ nix-env -iA cachix -f https://cachix.org/api/v1/install -$ cachix use ethermint -``` \ No newline at end of file +nix-env -iA cachix -f https://cachix.org/api/v1/install +cachix use ethermint +``` diff --git a/tests/integration_tests/hardhat/package-lock.json b/tests/integration_tests/hardhat/package-lock.json index f114b4a0..bce890d4 100644 --- a/tests/integration_tests/hardhat/package-lock.json +++ b/tests/integration_tests/hardhat/package-lock.json @@ -13491,9 +13491,12 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mkdirp": { "version": "0.5.6", @@ -25791,9 +25794,9 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" }, "mkdirp": { "version": "0.5.6", diff --git a/tests/integration_tests/test_filters.py b/tests/integration_tests/test_filters.py index 659acc86..b20f807e 100644 --- a/tests/integration_tests/test_filters.py +++ b/tests/integration_tests/test_filters.py @@ -9,6 +9,7 @@ from .utils import ( deploy_contract, send_successful_transaction, send_transaction, + w3_wait_for_new_blocks, ) # Smart contract names @@ -21,6 +22,35 @@ CHANGE_GREETING_TOPIC = Web3.keccak(text="ChangeGreeting(address,string)") TRANSFER_TOPIC = Web3.keccak(text="Transfer(address,address,uint256)") +def test_get_logs_by_topic(cluster): + w3: Web3 = cluster.w3 + + contract, _ = deploy_contract(w3, CONTRACTS["Greeter"]) + + topic = Web3.keccak(text="ChangeGreeting(address,string)") + + # with tx + tx = contract.functions.setGreeting("world").build_transaction() + receipt = send_transaction(w3, tx) + assert receipt.status == 1 + + # The getLogs method under the hood works as a filter + # with the specified topics and a block range. + # If the block range is not specified, it defaults + # to fromBlock: "latest", toBlock: "latest". + # Then, if we make a getLogs call within the same block that the tx + # happened, we will get a log in the result. However, if we make the call + # one or more blocks later, the result will be an empty array. + logs = w3.eth.get_logs({"topics": [topic.hex()]}) + + assert len(logs) == 1 + assert logs[0]["address"] == contract.address + + w3_wait_for_new_blocks(w3, 2) + logs = w3.eth.get_logs({"topics": [topic.hex()]}) + assert len(logs) == 0 + + def test_pending_transaction_filter(cluster): w3: Web3 = cluster.w3 flt = w3.eth.filter("pending") diff --git a/tests/integration_tests/test_gas.py b/tests/integration_tests/test_gas.py old mode 100755 new mode 100644 index 223f681d..e35ae96c --- a/tests/integration_tests/test_gas.py +++ b/tests/integration_tests/test_gas.py @@ -1,4 +1,13 @@ -from .utils import ADDRS, CONTRACTS, KEYS, deploy_contract, send_transaction +import pytest + +from .utils import ( + ADDRS, + CONTRACTS, + KEYS, + deploy_contract, + send_transaction, + w3_wait_for_new_blocks, +) def test_gas_eth_tx(geth, ethermint): @@ -21,12 +30,10 @@ def test_gas_eth_tx(geth, ethermint): def test_gas_deployment(geth, ethermint): # deploy an identical contract on geth and ethermint # ensure that the gasUsed is equivalent - _, geth_contract_receipt = deploy_contract( - geth.w3, - CONTRACTS["TestERC20A"]) + _, geth_contract_receipt = deploy_contract(geth.w3, CONTRACTS["TestERC20A"]) _, ethermint_contract_receipt = deploy_contract( - ethermint.w3, - CONTRACTS["TestERC20A"]) + ethermint.w3, CONTRACTS["TestERC20A"] + ) assert geth_contract_receipt.gasUsed == ethermint_contract_receipt.gasUsed @@ -35,28 +42,65 @@ def test_gas_call(geth, ethermint): # deploy an identical contract on geth and ethermint # ensure that the contract has a function which consumes non-trivial gas - geth_contract, _ = deploy_contract( - geth.w3, - CONTRACTS["BurnGas"]) - ethermint_contract, _ = deploy_contract( - ethermint.w3, - CONTRACTS["BurnGas"]) + geth_contract, _ = deploy_contract(geth.w3, CONTRACTS["BurnGas"]) + ethermint_contract, _ = deploy_contract(ethermint.w3, CONTRACTS["BurnGas"]) # call the contract and get tx receipt for geth geth_gas_price = geth.w3.eth.gas_price - geth_txhash = (geth_contract.functions - .burnGas(function_input) - .transact({'from': ADDRS["validator"], "gasPrice": geth_gas_price})) + geth_txhash = geth_contract.functions.burnGas(function_input).transact( + {"from": ADDRS["validator"], "gasPrice": geth_gas_price} + ) geth_call_receipt = geth.w3.eth.wait_for_transaction_receipt(geth_txhash) # repeat the above for ethermint ethermint_gas_price = ethermint.w3.eth.gas_price - ethermint_txhash = (ethermint_contract.functions - .burnGas(function_input) - .transact({'from': ADDRS["validator"], - "gasPrice": ethermint_gas_price})) - ethermint_call_receipt = (ethermint.w3. - eth.wait_for_transaction_receipt(ethermint_txhash)) + ethermint_txhash = ethermint_contract.functions.burnGas(function_input).transact( + {"from": ADDRS["validator"], "gasPrice": ethermint_gas_price} + ) + ethermint_call_receipt = ethermint.w3.eth.wait_for_transaction_receipt( + ethermint_txhash + ) # ensure that the gasUsed is equivalent assert geth_call_receipt.gasUsed == ethermint_call_receipt.gasUsed + + +def test_block_gas_limit(ethermint): + tx_value = 10 + + # get the block gas limit from the latest block + w3_wait_for_new_blocks(ethermint.w3, 5) + block = ethermint.w3.eth.get_block("latest") + exceeded_gas_limit = block.gasLimit + 100 + + # send a transaction exceeding the block gas limit + ethermint_gas_price = ethermint.w3.eth.gas_price + tx = { + "to": ADDRS["community"], + "value": tx_value, + "gas": exceeded_gas_limit, + "gasPrice": ethermint_gas_price, + } + + # expect an error due to the block gas limit + with pytest.raises(Exception): + send_transaction(ethermint.w3, tx, KEYS["validator"]) + + # deploy a contract on ethermint + ethermint_contract, _ = deploy_contract(ethermint.w3, CONTRACTS["BurnGas"]) + + # expect an error on contract call due to block gas limit + with pytest.raises(Exception): + ethermint_txhash = ethermint_contract.functions.burnGas( + exceeded_gas_limit + ).transact( + { + "from": ADDRS["validator"], + "gas": exceeded_gas_limit, + "gasPrice": ethermint_gas_price, + } + ) + (ethermint.w3.eth.wait_for_transaction_receipt(ethermint_txhash)) + + + return diff --git a/tests/solidity/yarn.lock b/tests/solidity/yarn.lock index 5548bbd2..9d311442 100644 --- a/tests/solidity/yarn.lock +++ b/tests/solidity/yarn.lock @@ -6255,9 +6255,9 @@ decamelize@^4.0.0: integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== decompress-response@^3.2.0, decompress-response@^3.3.0: version "3.3.0" diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 3103a45c..2179ee55 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -72,6 +72,11 @@ func (k *Keeper) TxConfig(ctx sdk.Context, txHash common.Hash) statedb.TxConfig // (ChainConfig and module Params). It additionally sets the validator operator address as the // coinbase address to make it available for the COINBASE opcode, even though there is no // beneficiary of the coinbase transaction (since we're not mining). +// +// NOTE: the RANDOM opcode is currently not supported since it requires +// RANDAO implementation. See https://github.com/evmos/ethermint/pull/1520#pullrequestreview-1200504697 +// for more information. + func (k *Keeper) NewEVM( ctx sdk.Context, msg core.Message, @@ -89,6 +94,7 @@ func (k *Keeper) NewEVM( Time: big.NewInt(ctx.BlockHeader().Time.Unix()), Difficulty: big.NewInt(0), // unused. Only required in PoW context BaseFee: cfg.BaseFee, + Random: nil, // not supported } txCtx := core.NewEVMTxContext(msg) diff --git a/x/feemarket/spec/01_concepts.md b/x/feemarket/spec/01_concepts.md index 12071d7b..2d9c963b 100644 --- a/x/feemarket/spec/01_concepts.md +++ b/x/feemarket/spec/01_concepts.md @@ -72,4 +72,4 @@ The comparison of transaction gas price and the lower bound is implemented throu ::: tip If the base fee decreases to a value below the global `MinGasPrice`, it is set to the `MinGasPrice`. This is implemented, so that the base fee can't drop to gas prices that wouldn't allow transactions to be accepted in the mempool, because of a higher `MinGasPrice`. -::: \ No newline at end of file +:::