diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go index f9eeaa657..18db1ea69 100644 --- a/x/oracle/keeper/params.go +++ b/x/oracle/keeper/params.go @@ -73,6 +73,10 @@ func (k Keeper) RegisterNewTokenAndSetTokenFeeder(ctx sdk.Context, oInfo *types. if t.Name == oInfo.Token.Name && t.ChainID == chainID { t.AssetID = strings.Join([]string{t.AssetID, oInfo.AssetID}, ",") k.SetParams(ctx, p) + if !ctx.IsCheckTx() { + _ = GetAggregatorContext(ctx, k) + cs.AddCache(cache.ItemP(p)) + } // there should have been existing tokenFeeder running(currently we register tokens from assets-module and with infinite endBlock) return nil } diff --git a/x/oracle/keeper/single.go b/x/oracle/keeper/single.go index 8b327b622..c1f60e652 100644 --- a/x/oracle/keeper/single.go +++ b/x/oracle/keeper/single.go @@ -153,6 +153,12 @@ func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext if updated := c.GetCache(&pRet); !updated { c.AddCache(cache.ItemP(*p)) } + // TODO: these 4 lines are mainly used for hot fix + // since the latest params stored in KV for recache should be the same with the latest params, so these lines are just duplicated actions if everything is fine. + *p = k.GetParams(ctx) + agc.SetParams(p) + setCommonParams(p) + c.AddCache(cache.ItemP(*p)) return true }