Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
evm: fix infinite context usage on EndBlock (#329)
Browse files Browse the repository at this point in the history
The previous code is not incorrect since the method `SetBlockBloom` use the `ctx` passed in rather than the `k.ctx`.
It's confusing that sometimes methods use ctx in parameter, sometimes use `k.ctx`, but that's another issue.

Co-authored-by: Federico Kunze Küllmer <[email protected]>
  • Loading branch information
yihuang and fedekunze authored Jul 21, 2021
1 parent 0fa75ba commit d54663c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x/evm/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.Vali

// Gas costs are handled within msg handler so costs should be ignored
infCtx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
k.WithContext(ctx)
k.WithContext(infCtx)

k.SetBlockBloom(infCtx, req.Height, ethtypes.BytesToBloom(k.GetBlockBloomTransient().Bytes()))
k.WithContext(ctx)
Expand Down

0 comments on commit d54663c

Please sign in to comment.