diff --git a/CHANGELOG.md b/CHANGELOG.md index 0760c657a55296fa00b3c2ffb634eb25b0702c30..9621d955062c91061ed9b833d533d517a1bdb99b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v13.0.0 + ## v12.0.0 This release includes several cosmwasm-developer and appchain-ecosystem affecting upgrades: diff --git a/app/modules.go b/app/modules.go index 3f9fe96c0203bd919c84f8b2df51f7820104ab97..b46c5e78f4a898cf569d5e31ac363921eb61b84e 100644 --- a/app/modules.go +++ b/app/modules.go @@ -167,6 +167,11 @@ func orderBeginBlockers(allModuleNames []string) []string { // OrderEndBlockers returns EndBlockers (crisis, govtypes, staking) with no relative order. func OrderEndBlockers(allModuleNames []string) []string { ord := partialord.NewPartialOrdering(allModuleNames) + + // Staking must be after gov. + ord.FirstElements(govtypes.ModuleName) + ord.LastElements(stakingtypes.ModuleName) + // only Osmosis modules with endblock code are: twap, crisis, govtypes, staking // we don't care about the relative ordering between them. return ord.TotalOrdering() diff --git a/app/modules_test.go b/app/modules_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3790e3aaebf944a89432b750437d008a09567070 --- /dev/null +++ b/app/modules_test.go @@ -0,0 +1,22 @@ +package app + +import ( + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" +) + +func TestOrderEndBlockers_Determinism(t *testing.T) { + db := dbm.NewMemDB() + app := NewOsmosisApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, simapp.EmptyAppOptions{}, GetWasmEnabledProposals(), EmptyWasmOpts) + + for i := 0; i < 1000; i++ { + a := OrderEndBlockers(app.mm.ModuleNames()) + b := OrderEndBlockers(app.mm.ModuleNames()) + require.True(t, reflect.DeepEqual(a, b)) + } +} diff --git a/osmoutils/partialord/partialord.go b/osmoutils/partialord/partialord.go index 5428e70f5c65a7b791315c9816cd98d1965c7850..517d5c3831ee1fd43ebeb05ebed61e91a3cd3a65 100644 --- a/osmoutils/partialord/partialord.go +++ b/osmoutils/partialord/partialord.go @@ -21,7 +21,7 @@ func NewPartialOrdering(elements []string) PartialOrdering { copy(elementsCopy, elements) sort.Strings(elementsCopy) return PartialOrdering{ - dag: dag.NewDAG(elements), + dag: dag.NewDAG(elementsCopy), firstSealed: false, lastSealed: false, } diff --git a/osmoutils/partialord/partialord_test.go b/osmoutils/partialord/partialord_test.go index 4eed2edd08a3a5337e8c229de99661712d8afde9..8ce637f1a286df216851165301abcc218c45fb25 100644 --- a/osmoutils/partialord/partialord_test.go +++ b/osmoutils/partialord/partialord_test.go @@ -26,7 +26,7 @@ func TestAPI(t *testing.T) { totalOrd := beginBlockOrd.TotalOrdering() expTotalOrd := []string{ "upgrades", "epochs", "capabilities", - "bank", "staking", "mint", "ibc", "distribution", "ibctransfers", + "bank", "ibc", "mint", "staking", "ibctransfers", "distribution", "auth", "authz", "wasm", } require.Equal(t, expTotalOrd, totalOrd)