Skip to content

Commit

Permalink
Merge pull request #8 from zenodeapp/cronos-v1.0.15
Browse files Browse the repository at this point in the history
Attempt to upgrade v1.0.12 to v1.0.15
  • Loading branch information
zenodeapp authored Jan 6, 2024
2 parents f063615 + 9ead82e commit 185f38b
Show file tree
Hide file tree
Showing 24 changed files with 588 additions and 93 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
integration_tests:
runs-on: ubuntu-latest
timeout-minutes: 240
strategy:
matrix:
tests: [unmarked, ibc, ibc_timeout, ibc_update_client, upgrade, slow]
env:
TESTS_TO_RUN: ${{ matrix.tests }}
steps:
- uses: actions/checkout@v3
with:
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

*Jan 05, 2024*

## v1.0.15

- [#1265](https://github.com/crypto-org-chain/cronos/pull/1265) Fix nil pointer panic when filter timeout
- [#1270](https://github.com/crypto-org-chain/cronos/pull/1270) Avoid out of bound panic from error message

*Dec 15, 2023*

## v1.0.14

- [#1259](https://github.com/crypto-org-chain/cronos/pull/1259) Use a hard-fork style upgrade to adjust feemarket parameters.

*Nov 20, 2023*

## v1.0.13

- [#1197](https://github.com/crypto-org-chain/cronos/pull/1197) tune rocksdb options to control memory consumption.
- [#1207](https://github.com/crypto-org-chain/cronos/pull/1207) Update rocksdb to `v8.6.7`.
- [#1240](https://github.com/crypto-org-chain/cronos/pull/1240) Revert rocksdb upgrade.
- [#1239](https://github.com/crypto-org-chain/cronos/pull/1239) Refactor websocket/subscription system to improve performance and stability.
- [#1246](https://github.com/crypto-org-chain/cronos/pull/1246) Update memiavl deps to include bug fixes and state sync restore performance improvement.

*Aug 11, 2023*

## v1.0.12
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ test-sim-profile:
### Integration Test ###
###############################################################################

# possible values:
# - all: run all integration tests
# - unmarked: run integration tests that are not marked
# - marker1,marker2: markers separated by comma, run integration tests that are marked with any of the markers
TESTS_TO_RUN ?= all

run-integration-tests:
@nix-shell ./integration_tests/shell.nix --run ./scripts/run-integration-tests

Expand Down
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,8 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R
panic("halt application")
}

BeginBlockForks(ctx, app)

return app.mm.BeginBlock(ctx, req)
}

Expand Down
61 changes: 61 additions & 0 deletions app/forks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package app

import sdk "github.com/cosmos/cosmos-sdk/types"

var Forks = []Fork{
ForkV1Mainnnet,
ForkV1Dryrun,
}

// Fork defines a struct containing the requisite fields for a non-software upgrade proposal
// Hard Fork at a given height to implement.
// There is one time code that can be added for the start of the Fork, in `BeginForkLogic`.
// Any other change in the code should be height-gated, if the goal is to have old and new binaries
// to be compatible prior to the upgrade height.
//
// Adapted from osmosis: https://github.com/osmosis-labs/osmosis/blob/057192c2c0949fde5673a5f314bf41816f808fd9/app/upgrades/types.go#L40
type Fork struct {
// Upgrade version name, for the upgrade handler, e.g. `v7`
UpgradeName string
// height the upgrade occurs at
UpgradeHeight int64
// chain-id the upgrade occurs at
UpgradeChainId string

// Function that runs some custom state transition code at the beginning of a fork.
BeginForkLogic func(ctx sdk.Context, app *App)
}

// BeginBlockForks is intended to be ran in a chain upgrade.
func BeginBlockForks(ctx sdk.Context, app *App) {
for _, fork := range Forks {
if ctx.BlockHeight() == fork.UpgradeHeight && ctx.ChainID() == fork.UpgradeChainId {
fork.BeginForkLogic(ctx, app)
return
}
}
}

func ForkV1Logic(ctx sdk.Context, app *App) {
params := app.FeeMarketKeeper.GetParams(ctx)
params.BaseFeeChangeDenominator = 300
params.ElasticityMultiplier = 4
params.BaseFee = sdk.NewInt(10000000000000)
params.MinGasPrice = sdk.NewDec(10000000000000)
app.FeeMarketKeeper.SetParams(ctx, params)
}

var (
ForkV1Mainnnet = Fork{
UpgradeName: "v1.0.x-base-fee",
UpgradeHeight: 11608760,
UpgradeChainId: "cronosmainnet_25-1",
BeginForkLogic: ForkV1Logic,
}
ForkV1Dryrun = Fork{
UpgradeName: "v1.0.x-base-fee",
UpgradeHeight: 5215165,
UpgradeChainId: "tempcronosmainnet_28-1",
BeginForkLogic: ForkV1Logic,
}
)
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
, nativeByteOrder ? true # nativeByteOrder mode will panic on big endian machines
}:
let
version = "v1.0.12";
version = "v1.0.15";
pname = "cronosd";
tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" ]
++ lib.optionals nativeByteOrder [ "nativebyteorder" ];
Expand Down Expand Up @@ -45,7 +45,7 @@ buildGoApplication rec {
else "-lrocksdb -pthread -lstdc++ -ldl";

postFixup = lib.optionalString stdenv.isDarwin ''
${stdenv.cc.targetPrefix}install_name_tool -change "@rpath/librocksdb.7.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/cronosd
${stdenv.cc.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/cronosd
'';

doCheck = false;
Expand Down
32 changes: 18 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ require (
github.com/armon/go-metrics v0.4.1
github.com/cosmos/cosmos-sdk v0.46.15-0.20230807104542-537257060180
github.com/cosmos/ibc-go/v5 v5.2.1
github.com/crypto-org-chain/cronos/store v0.0.4
github.com/crypto-org-chain/cronos/versiondb v0.0.0-20230809065519-af389f66015a
github.com/crypto-org-chain/cronos/store v0.0.5
github.com/crypto-org-chain/cronos/versiondb v0.0.0-20231115070216-b0af3db7b932
github.com/ethereum/go-ethereum v1.10.26
github.com/evmos/ethermint v0.0.0-00010101000000-000000000000
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/linxGnu/grocksdb v1.8.0
github.com/linxGnu/grocksdb v1.8.4
github.com/peggyjv/gravity-bridge/module/v2 v2.0.0-00010101000000-000000000000
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.3
github.com/stretchr/testify v1.8.4
github.com/tendermint/tendermint v0.34.29
github.com/tendermint/tm-db v0.6.7
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0
google.golang.org/genproto v0.0.0-20230323212658-478b75c54725
google.golang.org/grpc v1.54.0
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v2 v2.4.0
)

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.0 // indirect
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/storage v1.28.1 // indirect
cloud.google.com/go/storage v1.29.0 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand All @@ -64,7 +64,7 @@ require (
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.8.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
github.com/cockroachdb/pebble v0.0.0-20230315005856-dcb60b9212f9 // indirect
github.com/cockroachdb/pebble v0.0.0-20230807182518-7bcdd55ef1e3 // indirect
github.com/cockroachdb/redact v1.0.8 // indirect
github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect
github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect
Expand All @@ -77,7 +77,7 @@ require (
github.com/cosmos/iavl v0.19.6 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/crypto-org-chain/cronos/memiavl v0.0.4 // indirect
github.com/crypto-org-chain/cronos/memiavl v0.0.5 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
Expand All @@ -102,7 +102,7 @@ require (
github.com/go-stack/stack v1.8.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
Expand Down Expand Up @@ -196,14 +196,16 @@ require (
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.114.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -216,18 +218,20 @@ replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// the version used by cockroach v22.2.7 release
github.com/cockroachdb/pebble => github.com/cockroachdb/pebble v0.0.0-20230206180212-744ea7cc8f90
github.com/cometbft/cometbft-db => github.com/alpha-omega-labs/cometbft-db v0.0.0-20230722202700-39607195539a
github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
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.19-deepcopy-jumptable
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.20.11-cronos.0.20230809091211-3fdb18b1c2d9
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.20.11-cronos.0.20231220064956-a85daedc6ffc
// 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
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0

github.com/linxGnu/grocksdb => github.com/linxGnu/grocksdb v1.8.0

github.com/miguelmota/go-ethereum-hdwallet => github.com/crypto-org-chain/go-ethereum-hdwallet v0.1.2

// TODO: remove when gravity update dependencies
Expand Down
Loading

0 comments on commit 185f38b

Please sign in to comment.