diff --git a/CHANGELOG.md b/CHANGELOG.md index 336d22a087..1c7c6872af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Changelog -## UNRELEASED +*Aug 5, 2022* + +## v0.8.0 + +### State Machine Breaking + +- [#618](https://github.com/crypto-org-chain/cronos/pull/618) selfdestruct don't delete bytecode of smart contract. + +*Aug 5, 2022* + +## v0.7.1 ### Bug Fixes diff --git a/app/app.go b/app/app.go index 21eab4d677..caaff9c2de 100644 --- a/app/app.go +++ b/app/app.go @@ -2,7 +2,6 @@ package app import ( "io" - "math/big" "net/http" "os" "path/filepath" @@ -24,7 +23,6 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -704,52 +702,11 @@ func New( app.SetEndBlocker(app.EndBlocker) // upgrade handlers - plan0_7_0 := "v0.7.0" - app.UpgradeKeeper.SetUpgradeHandler(plan0_7_0, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - updatedVM, err := app.mm.RunMigrations(ctx, app.configurator, fromVM) - if err != nil { - return nil, err - } - // Override feemarket parameters - initialBaseFee := int64(5000000000000) - app.FeeMarketKeeper.SetParams(ctx, feemarkettypes.Params{ - NoBaseFee: false, - BaseFeeChangeDenominator: 100000000, - ElasticityMultiplier: 2, - InitialBaseFee: initialBaseFee, - EnableHeight: 0, - }) - app.FeeMarketKeeper.SetBaseFee(ctx, big.NewInt(initialBaseFee)) - evmParams := app.EvmKeeper.GetParams(ctx) - zeroInt := sdk.ZeroInt() - evmParams.ChainConfig.LondonBlock = &zeroInt - app.EvmKeeper.SetParams(ctx, evmParams) - return updatedVM, nil - }) - - // this upgrade is for breaking bug fixes on testnet - plan0_7_0Rc3HotfixTestnet := "v0.7.0-rc3-hotfix-testnet" - app.UpgradeKeeper.SetUpgradeHandler(plan0_7_0Rc3HotfixTestnet, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - cp := ctx.ConsensusParams() - cp.Block.MaxGas = 10000000 - app.StoreConsensusParams(ctx, cp) + planName := "v0.7.0-hotfix" + app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { return app.mm.RunMigrations(ctx, app.configurator, fromVM) }) - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(err) - } - - if upgradeInfo.Name == plan0_7_0 && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{"feemarket"}, - } - - // configure store loader that checks if version == upgradeHeight and applies store upgrades - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) - } - if loadLatest { if err := app.LoadLatestVersion(); err != nil { tmos.Exit(err.Error()) diff --git a/default.nix b/default.nix index 5421e64b1b..449ea19596 100644 --- a/default.nix +++ b/default.nix @@ -8,7 +8,7 @@ , rev ? "dirty" }: let - version = "v0.7.1"; + version = "v0.8.0"; pname = "cronosd"; tags = [ "ledger" "netgo" network ] ++ lib.lists.optional (db_backend == "rocksdb") "rocksdb"; diff --git a/go.mod b/go.mod index 62d590fc36..f3f3313999 100644 --- a/go.mod +++ b/go.mod @@ -164,7 +164,7 @@ replace ( github.com/tendermint/tendermint => github.com/tendermint/tendermint v0.34.20 - github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.10.0-cronos.0.20220719024136-4658529abbf5 + github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.11.0-cronos google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index a5397f257b..500852c09c 100644 --- a/go.sum +++ b/go.sum @@ -308,8 +308,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crypto-org-chain/ethermint v0.10.0-cronos.0.20220719024136-4658529abbf5 h1:2iLYA821730/uyyrY8Rn3AXxpYNPIsdelCuYcZyJSmE= -github.com/crypto-org-chain/ethermint v0.10.0-cronos.0.20220719024136-4658529abbf5/go.mod h1:T4f1p3L5kccbjBZMtJLKfOLiUXTO1OuS1I7FzQuJD+w= +github.com/crypto-org-chain/ethermint v0.11.0-cronos h1:CNqm0ZD5yuf1/ENki3hVMUAMCl74f4GSYPrGN/h38bA= +github.com/crypto-org-chain/ethermint v0.11.0-cronos/go.mod h1:T4f1p3L5kccbjBZMtJLKfOLiUXTO1OuS1I7FzQuJD+w= github.com/crypto-org-chain/ibc-go/v2 v2.2.0-hooks2 h1:elj+Tb/3O9GA3pv62zkc1B0P8hl1WHmF6vF8PInEJm4= github.com/crypto-org-chain/ibc-go/v2 v2.2.0-hooks2/go.mod h1:rAHRlBcRiHPP/JszN+08SJx3pegww9bcVncIb9QLx7I= github.com/crypto-org-chain/keyring v1.1.6-fixes h1:AUFSu56NY6XobY6XfRoDx6v3loiOrHK5MNUm32GEjwA= diff --git a/gomod2nix.toml b/gomod2nix.toml index 6c2ae5bf7a..7bdcd60245 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -375,8 +375,8 @@ schema = 3 version = "v0.6.7" hash = "sha256-hl/3RrBrpkk2zA6dmrNlIYKs1/GfqegSscDSkA5Pjlo=" [mod."github.com/tharsis/ethermint"] - version = "v0.10.0-cronos.0.20220719024136-4658529abbf5" - hash = "sha256-86PPinRIfbATES4B4FLFE02GQSCBxO39Tsj/VYYhkr8=" + version = "v0.11.0-cronos" + hash = "sha256-vSseS5bYyHAPPqwMujTLM/h/ckh3OWXZJR572Wh3KYU=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/tklauser/go-sysconf"] version = "v0.3.10" diff --git a/integration_tests/configs/cosmovisor.yaml b/integration_tests/configs/cosmovisor.yaml index 7e3701c627..7989a871ca 100644 --- a/integration_tests/configs/cosmovisor.yaml +++ b/integration_tests/configs/cosmovisor.yaml @@ -37,8 +37,6 @@ cronos_777-1: evm: params: evm_denom: basetcro - chain_config: - london_block: null cronos: params: cronos_admin: ${CRONOS_ADMIN} diff --git a/integration_tests/configs/upgrade-test-package.nix b/integration_tests/configs/upgrade-test-package.nix index 5b413c66e3..152a145c8d 100644 --- a/integration_tests/configs/upgrade-test-package.nix +++ b/integration_tests/configs/upgrade-test-package.nix @@ -1,9 +1,16 @@ let pkgs = import ../../nix { }; - released = import (builtins.fetchTarball "https://github.com/crypto-org-chain/cronos/archive/v0.6.5.tar.gz") { }; + fetchFlake = repo: rev: (pkgs.flake-compat { + src = { + outPath = builtins.fetchTarball "https://github.com/${repo}/archive/${rev}.tar.gz"; + inherit rev; + shortRev = builtins.substring 0 7 rev; + }; + }).defaultNix; + released = (fetchFlake "crypto-org-chain/cronos" "8035ebdcc3ce1ed5ee3d4887eb4ea1032c4d283c").default; current = pkgs.callPackage ../../. { }; in pkgs.linkFarm "upgrade-test-package" [ { name = "genesis"; path = released; } - { name = "v0.7.0"; path = current; } + { name = "v0.7.0-hotfix"; path = current; } ] diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index 0f3b59dbd9..60f072c962 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -6,11 +6,10 @@ import pytest from dateutil.parser import isoparse -from pystarport import ports from pystarport.cluster import SUPERVISOR_CONFIG_FILE from .network import Cronos, setup_custom_cronos -from .utils import parse_events, wait_for_block, wait_for_block_time, wait_for_port +from .utils import parse_events, wait_for_block, wait_for_block_time def init_cosmovisor(home): @@ -83,7 +82,7 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos): height = cli.block_height() target_height = height + 15 print("upgrade height", target_height) - plan_name = "v0.7.0" + plan_name = "v0.7.0-hotfix" rsp = cli.gov_propose( "community", "software-upgrade", @@ -114,15 +113,3 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos): # block should pass the target height wait_for_block(cli, target_height + 2, timeout=480) - - # check feemarket is enabled correctly - wait_for_port(ports.evmrpc_port(custom_cronos.base_port(0))) - w3 = custom_cronos.w3 - # check base fee values - fee1 = 5000000000000 - 5000000000000 // 100000000 - fee2 = fee1 - fee1 // 100000000 - assert w3.eth.get_block(target_height).baseFeePerGas == fee1 - assert w3.eth.get_block(target_height + 1).baseFeePerGas == fee2 - - # query legacy blocks before the upgrade - assert "baseFeePerGas" not in w3.eth.get_block(target_height - 1) diff --git a/nix/default.nix b/nix/default.nix index 8ac5c43770..4dbab1b686 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -20,6 +20,7 @@ import sources.nixpkgs { inherit (pkgs.darwin.apple_sdk.frameworks) IOKit; buildGoModule = pkgs.buildGo117Module; }; + flake-compat = import sources.flake-compat; }) # update to a version that supports eip-1559 (import (sources.gomod2nix + "/overlay.nix")) (_: pkgs: { diff --git a/nix/sources.json b/nix/sources.json index 56d6bca583..f5a829a85f 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -24,6 +24,18 @@ "url_template": "https://github.com/dapphub/dapptools/archive/refs/tags/hevm/0.49.0.tar.gz", "version": "hevm/0.49.0" }, + "flake-compat": { + "branch": "master", + "description": null, + "homepage": null, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "sha256": "1qc703yg0babixi6wshn5wm2kgl5y1drcswgszh4xxzbrwkk9sv7", + "type": "tarball", + "url": "https://github.com/edolstra/flake-compat/archive/b4a34015c698c7793d592d66adbab377907a2be8.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "gomod2nix": { "branch": "master", "description": "Convert applications using Go modules to Nix expressions",