Skip to content

Commit

Permalink
Increase the number of blocks to keep stale messages (#945)
Browse files Browse the repository at this point in the history
We just increase our block speed drastically.  As such, we need to
increase the amount of blocks to allow messages to remain stale.
This is because we have more blocks per minute.

We also don't need to check quite as often for the same reason.

Co-authored-by: Tyler Ruppert <{ID}+{username}@users.noreply.github.com>
  • Loading branch information
MechanicalTyler and Tyler Ruppert authored Aug 11, 2023
1 parent 68c692e commit 8ef8bd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/consensus/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val
am.keeper.Logger(ctx).Error("error while attesting to messages", "err", err)
}

if ctx.BlockHeight()%10 == 0 {
err := am.keeper.DeleteOldMessages(ctx, 300)
if ctx.BlockHeight()%50 == 0 {
err := am.keeper.DeleteOldMessages(ctx, 1200)
if err != nil {
am.keeper.Logger(ctx).Error("error while deleting old messages", "err", err)
}
Expand Down

0 comments on commit 8ef8bd1

Please sign in to comment.