Skip to content

Commit

Permalink
hot fix for testnet upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed May 14, 2024
1 parent 7e9683d commit 364efec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 10 additions & 6 deletions x/oracle/keeper/cache/caches.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,22 @@ func (c *cacheParams) commit(ctx sdk.Context, k common.KeeperOracle) {
index.Index = index.Index[i:]
break
}
k.RemoveRecentParams(ctx, b)
if block != 4287294 {
k.RemoveRecentParams(ctx, b)
}
}
index.Index = index.Index[i:]
// remove and append for KVStore
index.Index = append(index.Index, block)
k.SetIndexRecentParams(ctx, index)

p := types.Params(*c.params)
k.SetRecentParams(ctx, types.RecentParams{
Block: block,
Params: &p,
})
if block >= 4287294 {
p := types.Params(*c.params)
k.SetRecentParams(ctx, types.RecentParams{
Block: block,
Params: &p,
})
}
}

// memory cache
Expand Down
4 changes: 3 additions & 1 deletion x/oracle/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val
logger.Info("prepare for next oracle round of each tokenFeeder")
agc.PrepareRound(ctx, 0)

cs.CommitCache(ctx, false, am.keeper)
if ctx.BlockHeight() >= 4287294 {
cs.CommitCache(ctx, false, am.keeper)
}
return []abci.ValidatorUpdate{}
}

0 comments on commit 364efec

Please sign in to comment.