Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: fix of broken opBlockhash and tx validation are not included #1621

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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*
mmsqe marked this conversation as resolved.
Show resolved Hide resolved

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 @@
"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 @@
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

Check warning on line 33 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L30-L33

Added lines #L30 - L33 were not covered by tests
}
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
}
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 @@ -275,7 +275,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 @@ -263,8 +263,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;
}
Loading