Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Reset cache after csdb committed #676

Merged
merged 3 commits into from
Dec 30, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions x/evm/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ func (k Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.Valid
// Update account balances before committing other parts of state
k.UpdateAccounts(ctx)

root, err := k.Commit(ctx, true)
// Commit state objects to KV store
if _, err := k.Commit(ctx, true); err != nil {
if err != nil {
k.Logger(ctx).Error("failed to commit state objects", "error", err, "height", ctx.BlockHeight())
panic(err)
}

// Clear accounts cache after account data has been committed
KamiD marked this conversation as resolved.
Show resolved Hide resolved
k.ClearStateObjects(ctx)
k.Reset(ctx, root)
KamiD marked this conversation as resolved.
Show resolved Hide resolved

// set the block bloom filter bytes to store
bloom := ethtypes.BytesToBloom(k.Bloom.Bytes())
Expand Down