Skip to content

Commit

Permalink
Merge branch 'main' into iavl
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang authored Oct 4, 2024
2 parents 31f3f24 + 766af76 commit 964a337
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ jobs:
- name: test & coverage report creation
run: |
nix develop -c make test
nix develop -c make test-memiavl
nix develop -c make test-store
nix develop .#rocksdb -c make test-versiondb
if: steps.changed-files.outputs.any_changed == 'true'
- name: filter out proto files
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [#1609](https://github.com/crypto-org-chain/cronos/pull/1609) Fix query address-by-acc-num by account_id instead of id.
* [#1611](https://github.com/crypto-org-chain/cronos/pull/1611) Fix multisig account failed on threshold encode after send tx.
* [#1617](https://github.com/crypto-org-chain/cronos/pull/1617) Fix unsuppored sign mode SIGN_MODE_TEXTUAL for bank transfer.
* [#1621](https://github.com/crypto-org-chain/cronos/pull/1621) Update ethermint to the fix of broken opBlockhash and tx validation.

*Sep 13, 2024*

Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,17 @@ install: check-network print-ledger go.sum

test:
@go test -tags=objstore -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic
@cd memiavl; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..
@cd store; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..

test-memiavl:
@cd memiavl; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

test-store:
@cd store; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

test-versiondb:
@cd versiondb; go test -tags rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..
@cd versiondb; go test -tags=objstore,rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

.PHONY: clean build install test
.PHONY: clean build install test test-memiavl test-store test-versiondb

clean:
rm -rf $(BUILDDIR)/
Expand Down
6 changes: 6 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
clientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper"
evmtypes "github.com/evmos/ethermint/x/evm/types"
)

func (app *App) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper clientkeeper.Keeper) {
Expand All @@ -26,6 +27,11 @@ func (app *App) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper clie
params := app.ICAHostKeeper.GetParams(sdkCtx)
params.HostEnabled = false
app.ICAHostKeeper.SetParams(sdkCtx, params)
evmParams := app.EvmKeeper.GetParams(sdkCtx)
evmParams.HeaderHashNum = evmtypes.DefaultHeaderHashNum
if err := app.EvmKeeper.SetParams(sdkCtx, evmParams); err != nil {
return m, err
}
}
return m, nil
})
Expand Down
12 changes: 12 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3044,6 +3044,10 @@ paths:
EIP155

signed) transactions can be executed on the state machine.
header_hash_num:
type: string
format: uint64
description: header_hash_num is the number of header hash to persist.
title: Params defines the EVM module parameters
description: >-
QueryParamsResponse defines the response type for querying x/evm
Expand Down Expand Up @@ -48880,6 +48884,10 @@ definitions:
description: |-
allow_unprotected_txs defines if replay-protected (i.e non EIP155
signed) transactions can be executed on the state machine.
header_hash_num:
type: string
format: uint64
description: header_hash_num is the number of header hash to persist.
title: Params defines the EVM module parameters
ethermint.evm.v1.QueryAccountResponse:
type: object
Expand Down Expand Up @@ -49076,6 +49084,10 @@ definitions:
description: |-
allow_unprotected_txs defines if replay-protected (i.e non EIP155
signed) transactions can be executed on the state machine.
header_hash_num:
type: string
format: uint64
description: header_hash_num is the number of header hash to persist.
title: Params defines the EVM module parameters
description: >-
QueryParamsResponse defines the response type for querying x/evm
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ replace (
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a
// develop
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240927061036-33e3cc6ed365
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20241004074623-853e1e5b3475
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240930015419-f4ea363b3fdf
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240930015419-f4ea363b3fdf/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240930015419-f4ea363b3fdf h1:u6BY+dtlmhuQYfPDnpGhDBF2uiCA0HvrIk22L67nB6Q=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240930015419-f4ea363b3fdf/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240927061036-33e3cc6ed365 h1:/oVOLrFnYrKotmHfLQrh5oKK8PT/ETLAVBdXn+fWPvc=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240927061036-33e3cc6ed365/go.mod h1:ZAHySxm1OEGIWruUEoCAZaqV6eTCgQ43+mSZ9hZsLCU=
github.com/crypto-org-chain/ethermint v0.6.1-0.20241004074623-853e1e5b3475 h1:NazTUTxkx8/C7HNzhsXJ7x/lR4dHlmKaVbqtdW4i8Vw=
github.com/crypto-org-chain/ethermint v0.6.1-0.20241004074623-853e1e5b3475/go.mod h1:LUv3b8+dRjqAI9UTml5XzjExT2ANyvjtkFssi7lIRb0=
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI=
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE=
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a h1:IUPD+dg1YQl8cLocxQ/Mbx/ObTgAgcrZlcBhFjsLO40=
Expand Down
4 changes: 2 additions & 2 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ schema = 3
hash = "sha256-ozwVS2BhAoz+OOisAyMhgg+lq8FdQjf90xoOq9cxtGw="
replaced = "github.com/crypto-org-chain/go-ethereum"
[mod."github.com/evmos/ethermint"]
version = "v0.6.1-0.20240927061036-33e3cc6ed365"
hash = "sha256-BFiTOil1KNMz8z6l2E/7BL+w9x/psEHhHiKf2wenceQ="
version = "v0.6.1-0.20241004074623-853e1e5b3475"
hash = "sha256-ThAVz/yMndPH0fd0Nn8dYdnhaRC0uTf1PEd3KlEonLw="
replaced = "github.com/crypto-org-chain/ethermint"
[mod."github.com/fatih/color"]
version = "v1.16.0"
Expand Down
12 changes: 10 additions & 2 deletions integration_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,18 @@ def do_upgrade(plan_name, target, mode=None):
do_upgrade("v1.4", target_height3)

cli = c.cosmos_cli()
assert e0 == cli.query_params("evm", height=target_height0 - 1)["params"]
assert e1 == cli.query_params("evm", height=target_height1 - 1)["params"]

def assert_evm_params(cli, expected, height):
params = cli.query_params("evm", height=height)["params"]
del params["header_hash_num"]
assert expected == params

assert_evm_params(cli, e0, target_height0 - 1)
assert_evm_params(cli, e1, target_height1 - 1)

assert f0 == cli.query_params("feemarket", height=target_height0 - 1)["params"]
assert f1 == cli.query_params("feemarket", height=target_height1 - 1)["params"]
assert cli.query_params("evm")["params"]["header_hash_num"] == "10000", p

with pytest.raises(AssertionError):
cli.query_params("icaauth")
Expand Down
2 changes: 2 additions & 0 deletions third_party/proto/ethermint/evm/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ message Params {
// allow_unprotected_txs defines if replay-protected (i.e non EIP155
// signed) transactions can be executed on the state machine.
bool allow_unprotected_txs = 6;
// header_hash_num is the number of header hash to persist.
uint64 header_hash_num = 7;
}

0 comments on commit 964a337

Please sign in to comment.