Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/integration_tests/aiohttp-3.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe authored Apr 24, 2024
2 parents 56faa25 + 62835e8 commit 29758f6
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* (store) [#1378](https://github.com/crypto-org-chain/cronos/pull/1378) Upgrade rocksdb to `v8.11.3`.
* (versiondb) [#1387](https://github.com/crypto-org-chain/cronos/pull/1387) Add dedicated config section for versiondb, prepare for sdk 0.50 integration.

### Bug Fixes

* (rpc) [#1397](https://github.com/crypto-org-chain/cronos/pull/1397) Avoid panic on invalid elasticity_multiplier.

*April 8, 2024*

## v1.2.0-rc1
Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func StoreKeys() (
keys := storetypes.NewKVStoreKeys(storeKeys...)
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
okeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey, evmtypes.ObjectStoreKey, feemarkettypes.ObjectStoreKey)
okeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey, evmtypes.ObjectStoreKey)

return keys, memKeys, tkeys, okeys
}
Expand Down Expand Up @@ -582,7 +582,7 @@ func New(
app.FeeMarketKeeper = feemarketkeeper.NewKeeper(
appCodec,
authtypes.NewModuleAddress(govtypes.ModuleName),
keys[feemarkettypes.StoreKey], okeys[feemarkettypes.ObjectStoreKey],
keys[feemarkettypes.StoreKey],
feeMarketS,
)
// Set authority to x/gov module account to only expect the module account to update params
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,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.20231207063621-43cf32d91c3e
// block-stm branch
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240412074628-5a7f857a8e5f
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20240419013511-775ac80b75c7
// 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 @@ -427,8 +427,8 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240415105151-0108877a3201
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240415105151-0108877a3201/go.mod h1:lfuLI1f4o+0SGtlHQS4x5qsjRcZZfYqG8bp3k8hM0M8=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240415105151-0108877a3201 h1:DbCOM19ywdL5K+bOy4h+0MppzcPgI2guHnYCfDNnAcM=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240415105151-0108877a3201/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240412074628-5a7f857a8e5f h1:Xnv4n06Xpw4sUkN4Vuf75wtJkBdrL2O4Yy05xIQhmEc=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240412074628-5a7f857a8e5f/go.mod h1:OSFT4cvzHl0g2DizYR9vIy5/xRYAvFJrnRydAmgCqyM=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240419013511-775ac80b75c7 h1:tawNK/e1F1AexRdhxC9o6M70IIrbCuvM6C8F/ujHwTY=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240419013511-775ac80b75c7/go.mod h1:OSFT4cvzHl0g2DizYR9vIy5/xRYAvFJrnRydAmgCqyM=
github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde h1:sQIHTJfVt5VTrF7po9eZiFkZiPjlHbFvnXtGCOoBjNM=
github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE=
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231207063621-43cf32d91c3e h1:vnyepPQ/m25+19xcTuBUdRxmltZ/EjVWNqEjhg7Ummk=
Expand Down
4 changes: 2 additions & 2 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ schema = 3
hash = "sha256-lDIqRLUrXYCb9mmFBY/+WW+ee69+IkxOgqjHVyo4ij0="
replaced = "github.com/crypto-org-chain/go-ethereum"
[mod."github.com/evmos/ethermint"]
version = "v0.6.1-0.20240412074628-5a7f857a8e5f"
hash = "sha256-PbdZqHZ5r2Yd3wLoJJfI3XAdYqvESH7UqsR9ow/7am4="
version = "v0.6.1-0.20240419013511-775ac80b75c7"
hash = "sha256-94bgC0Z+VD8w9j8+mwW/7PJSZlpKdtdR87C1E8hg3T4="
replaced = "github.com/crypto-org-chain/ethermint"
[mod."github.com/fatih/color"]
version = "v1.16.0"
Expand Down
29 changes: 18 additions & 11 deletions integration_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ def exec(c, tmp_path_factory):
wait_for_port(ports.evmrpc_port(c.base_port(0)))
wait_for_new_blocks(cli, 1)

height = cli.block_height()
target_height0 = height + 15
print("upgrade v1.1 height", target_height0)

def do_upgrade(plan_name, target, mode=None):
rsp = cli.gov_propose_legacy(
"community",
Expand All @@ -156,11 +152,14 @@ def do_upgrade(plan_name, target, mode=None):
wait_for_block(c.cosmos_cli(), target + 2, timeout=480)
wait_for_port(ports.rpc_port(c.base_port(0)))

do_upgrade("v1.1.0", target_height0, "block")
cli = c.cosmos_cli()

# test migrate keystore
cli.migrate_keystore()
height = cli.block_height()
target_height0 = height + 15
print("upgrade v1.1 height", target_height0)

do_upgrade("v1.1.0", target_height0, "block")
cli = c.cosmos_cli()

# check basic tx works
wait_for_port(ports.evmrpc_port(c.base_port(0)))
Expand Down Expand Up @@ -196,6 +195,7 @@ def do_upgrade(plan_name, target, mode=None):
print("old values", old_height, old_balance, old_base_fee)

do_upgrade("v1.2", target_height1)
cli = c.cosmos_cli()

# check basic tx works
wait_for_port(ports.evmrpc_port(c.base_port(0)))
Expand Down Expand Up @@ -240,10 +240,11 @@ def do_upgrade(plan_name, target, mode=None):
max_callback_gas = cli.query_params()["max_callback_gas"]
assert max_callback_gas == "50000", max_callback_gas

e = cli.query_params("evm", height=target_height0 - 1)["params"]["evm_denom"]
assert e == "basetcro", e
e = cli.query_params("evm", height=target_height1 - 1)["params"]["evm_denom"]
assert e == "basetcro", e
e0 = cli.query_params("evm", height=target_height0 - 1)["params"]
e1 = cli.query_params("evm", height=target_height1 - 1)["params"]
f0 = cli.query_params("feemarket", height=target_height0 - 1)["params"]
f1 = cli.query_params("feemarket", height=target_height1 - 1)["params"]
assert e0["evm_denom"] == e1["evm_denom"] == "basetcro"

# update the genesis time = current time + 5 secs
newtime = datetime.utcnow() + timedelta(seconds=5)
Expand All @@ -263,6 +264,12 @@ def do_upgrade(plan_name, target, mode=None):
print("upgrade v1.3 height", target_height2)
do_upgrade("v1.3", target_height2)

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"]
assert f0 == cli.query_params("feemarket", height=target_height0 - 1)["params"]
assert f1 == cli.query_params("feemarket", height=target_height1 - 1)["params"]


def test_cosmovisor_upgrade(custom_cronos: Cronos, tmp_path_factory):
exec(custom_cronos, tmp_path_factory)
6 changes: 3 additions & 3 deletions memiavl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ require (
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/tinylru v1.1.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
12 changes: 6 additions & 6 deletions memiavl/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -393,8 +393,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
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 @@ -463,8 +463,8 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
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/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
3 changes: 2 additions & 1 deletion x/cronos/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/crypto-org-chain/cronos/v2/x/cronos/types"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
evmkeeper "github.com/evmos/ethermint/x/evm/keeper"
evmtypes "github.com/evmos/ethermint/x/evm/types"
)
Expand Down Expand Up @@ -80,7 +81,7 @@ func (k Keeper) ReplayBlock(goCtx context.Context, req *types.ReplayBlockRequest
}

// populate the `From` field
if _, err := msg.GetSenderLegacy(chainID); err != nil {
if _, err := msg.GetSenderLegacy(ethtypes.LatestSignerForChainID(chainID)); err != nil {
return nil, err
}
fees, err := evmkeeper.VerifyFee(txData, evmDenom, baseFee, homestead, istanbul, shanghai, ctx.IsCheckTx())
Expand Down
5 changes: 2 additions & 3 deletions x/cronos/rpc/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ func (api *CronosAPI) GetTransactionReceiptsByBlock(blockNrOrHash rpctypes.Block
} else {
status = hexutil.Uint(ethtypes.ReceiptStatusSuccessful)
}

from, err := ethMsg.GetSenderLegacy(api.chainIDEpoch)
from, err := ethMsg.GetSenderLegacy(ethtypes.LatestSignerForChainID(api.chainIDEpoch))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -313,7 +312,7 @@ func (api *CronosAPI) ReplayBlock(blockNrOrHash rpctypes.BlockNumberOrHash, post
status = hexutil.Uint(ethtypes.ReceiptStatusSuccessful)
}

from, err := ethMsg.GetSenderLegacy(api.chainIDEpoch)
from, err := ethMsg.GetSenderLegacy(ethtypes.LatestSignerForChainID(api.chainIDEpoch))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 29758f6

Please sign in to comment.