Skip to content

Commit

Permalink
update changelog (#636)
Browse files Browse the repository at this point in the history
* update changelog

* fix lint
  • Loading branch information
yys authored Dec 23, 2021
1 parent 5ac91e1 commit 495c0c9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## v0.5.14

This release contains wasmvm bugfix to prevent non-deterministic error messages comes out from wasmvm.

- [\#635](https://github.com/terra-money/core/pull/635) bump wasmvm to v0.16.3

## v0.5.13

This release contains oracle tally bugfix, which was not sorting cross rate ballot before computing weighted median. It makes the cross rate selected quite randomly...

This update will sort cross rate ballot before computing weighted median value.

- [b073fb1](https://github.com/terra-money/core/commit/b073fb18e5107caee077f214b5fad4de53b055f5) sort cross rate ballot and enforce sorted before computing weighted median

## v0.5.12

This release contains [IAVL bugfix](https://github.com/cosmos/iavl/pull/449)
Expand Down
2 changes: 2 additions & 0 deletions types/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
Bech32PrefixValPub = util.Bech32PrefixValPub
Bech32PrefixConsAddr = util.Bech32PrefixConsAddr
Bech32PrefixConsPub = util.Bech32PrefixConsPub
ColumbusChainID = "columbus-5"
BombayChainID = "bombay-12"
)

// functions aliases
Expand Down
8 changes: 4 additions & 4 deletions x/oracle/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) {
var exchangeRateRT sdk.Dec

// softfork
if (ctx.ChainID() == "columbus-5" && ctx.BlockHeight() < int64(5_701_000)) ||
(ctx.ChainID() == "bombay-12" && ctx.BlockHeight() < int64(7_000_000)) {
if (ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() < int64(5_701_000)) ||
(ctx.ChainID() == core.BombayChainID && ctx.BlockHeight() < int64(7_000_000)) {
exchangeRateRT = ballotRT.WeightedMedian()
} else {
exchangeRateRT = ballotRT.WeightedMedianWithAssertion()
Expand All @@ -79,8 +79,8 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) {
if denom != referenceTerra {

// softfork
if (ctx.ChainID() == "columbus-5" && ctx.BlockHeight() < int64(5_701_000)) ||
(ctx.ChainID() == "bombay-12" && ctx.BlockHeight() < int64(7_000_000)) {
if (ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() < int64(5_701_000)) ||
(ctx.ChainID() == core.BombayChainID && ctx.BlockHeight() < int64(7_000_000)) {
ballot = ballot.ToCrossRate(voteMapRT)
} else {
ballot = ballot.ToCrossRateWithSort(voteMapRT)
Expand Down
4 changes: 2 additions & 2 deletions x/oracle/keeper/reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (k Keeper) RewardBallotWinners(
ballotWinners map[string]types.Claim,
) {
// softfork for reward distribution
if (ctx.ChainID() == "columbus-5" && ctx.BlockHeight() < int64(5_100_000)) ||
(ctx.ChainID() == "bombay-12" && ctx.BlockHeight() < int64(6_200_000)) {
if (ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() < int64(5_100_000)) ||
(ctx.ChainID() == core.BombayChainID && ctx.BlockHeight() < int64(6_200_000)) {
k.RewardBallotWinnersLegacy(ctx, votePeriod, rewardDistributionWindow, ballotWinners)
return
}
Expand Down
5 changes: 3 additions & 2 deletions x/oracle/tally.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package oracle
import (
sdk "github.com/cosmos/cosmos-sdk/types"

core "github.com/terra-money/core/types"
"github.com/terra-money/core/x/oracle/keeper"
"github.com/terra-money/core/x/oracle/types"
)
Expand All @@ -12,8 +13,8 @@ import (
// CONTRACT: pb must be sorted
func Tally(ctx sdk.Context, pb types.ExchangeRateBallot, rewardBand sdk.Dec, validatorClaimMap map[string]types.Claim) (weightedMedian sdk.Dec) {
// softfork
if (ctx.ChainID() == "columbus-5" && ctx.BlockHeight() < int64(5_701_000)) ||
(ctx.ChainID() == "bombay-12" && ctx.BlockHeight() < int64(7_000_000)) {
if (ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() < int64(5_701_000)) ||
(ctx.ChainID() == core.BombayChainID && ctx.BlockHeight() < int64(7_000_000)) {
weightedMedian = pb.WeightedMedian()
} else {
weightedMedian = pb.WeightedMedianWithAssertion()
Expand Down

0 comments on commit 495c0c9

Please sign in to comment.