From bcc0b999a42de669811bdca7f7a03505519b3382 Mon Sep 17 00:00:00 2001 From: Yun Date: Mon, 24 Jun 2019 12:50:09 +0900 Subject: [PATCH 1/3] add chain id check to update endblocker only for columbus-2 --- app/app.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 593306c89..1675c09cd 100755 --- a/app/app.go +++ b/app/app.go @@ -336,8 +336,10 @@ func (app *TerraApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci. treasuryTags := treasury.EndBlocker(ctx, app.treasuryKeeper) tags = append(tags, treasuryTags...) - updateTags := update.EndBlocker(ctx, app.accountKeeper, app.oracleKeeper, app.marketKeeper) - tags = append(tags, updateTags...) + if ctx.ChainID() == "columbus-2" { + updateTags := update.EndBlocker(ctx, app.accountKeeper, app.oracleKeeper, app.marketKeeper) + tags = append(tags, updateTags...) + } if app.assertInvariantsBlockly { app.assertRuntimeInvariants() From 490acea6446d8d663a5e9d0aaf05298495a0766d Mon Sep 17 00:00:00 2001 From: Yun Date: Tue, 25 Jun 2019 16:31:24 +0900 Subject: [PATCH 2/3] move chain-id check to update module --- app/app.go | 6 ++---- update/end_blocker.go | 9 +++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/app.go b/app/app.go index 1675c09cd..593306c89 100755 --- a/app/app.go +++ b/app/app.go @@ -336,10 +336,8 @@ func (app *TerraApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci. treasuryTags := treasury.EndBlocker(ctx, app.treasuryKeeper) tags = append(tags, treasuryTags...) - if ctx.ChainID() == "columbus-2" { - updateTags := update.EndBlocker(ctx, app.accountKeeper, app.oracleKeeper, app.marketKeeper) - tags = append(tags, updateTags...) - } + updateTags := update.EndBlocker(ctx, app.accountKeeper, app.oracleKeeper, app.marketKeeper) + tags = append(tags, updateTags...) if app.assertInvariantsBlockly { app.assertRuntimeInvariants() diff --git a/update/end_blocker.go b/update/end_blocker.go index d3248018b..cf7569033 100644 --- a/update/end_blocker.go +++ b/update/end_blocker.go @@ -16,10 +16,11 @@ func EndBlocker( oracleKeeper oracle.Keeper, marketKeeper market.Keeper) (resTags sdk.Tags) { - updated := plan.Update230000(ctx, accountKeeper, oracleKeeper, marketKeeper) - - if updated { - resTags.AppendTag(plan.TagUpdate230000, "updated") + if ctx.ChainID() == "columbus-2" { + updated := plan.Update230000(ctx, accountKeeper, oracleKeeper, marketKeeper) + if updated { + resTags.AppendTag(plan.TagUpdate230000, "updated") + } } return From 8665c2b49ae953d8a0bae19da73650022c2fb98b Mon Sep 17 00:00:00 2001 From: Yun Date: Fri, 5 Jul 2019 20:17:41 +0900 Subject: [PATCH 3/3] change treasury endblocker upate target to next epoch --- x/treasury/policy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/treasury/policy.go b/x/treasury/policy.go index 9be0a6e72..229a6924c 100644 --- a/x/treasury/policy.go +++ b/x/treasury/policy.go @@ -25,7 +25,7 @@ func updateTaxPolicy(ctx sdk.Context, k Keeper) (newTaxRate sdk.Dec) { newTaxRate = params.TaxPolicy.Clamp(oldTaxRate, newTaxRate) // Set the new tax rate to the store - k.SetTaxRate(ctx, newTaxRate) + k.SetTaxRate(ctx.WithBlockHeight(ctx.BlockHeight()+1), newTaxRate) return } @@ -52,6 +52,6 @@ func updateRewardPolicy(ctx sdk.Context, k Keeper) (newRewardWeight sdk.Dec) { newRewardWeight = params.RewardPolicy.Clamp(oldWeight, newRewardWeight) // Set the new reward weight - k.SetRewardWeight(ctx, newRewardWeight) + k.SetRewardWeight(ctx.WithBlockHeight(ctx.BlockHeight()+1), newRewardWeight) return }