diff --git a/docs/architecture/adr-001-state.md b/docs/architecture/adr-001-state.md index 813f1a3d6f..b138f06728 100644 --- a/docs/architecture/adr-001-state.md +++ b/docs/architecture/adr-001-state.md @@ -112,22 +112,10 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { func (k Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { // NOTE: UpdateAccounts, Commit and Reset execution steps have been removed in favor of directly // updating the state. - // Gas costs are handled within msg handler so costs should be ignored - infCtx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) - k.WithContext(ctx) - - // get the block bloom bytes from the transient store and set it to the persistent storage - bloomBig, found := k.GetBlockBloomTransient() - if !found { - bloomBig = big.NewInt(0) - } - - bloom := ethtypes.BytesToBloom(bloomBig.Bytes()) - k.SetBlockBloom(infCtx, req.Height, bloom) - k.WithContext(ctx) - - return []abci.ValidatorUpdate{} + infCtx := ctx.WithGasMeter(types.NewInfiniteGasMeter()) + k.CollectTxBloom(infCtx) + return nil } ``` diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 1fcad630c0..bf2eafca25 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -21,7 +21,6 @@ import ( corestoretypes "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" - "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -160,26 +159,6 @@ func (k Keeper) GetAuthority() sdk.AccAddress { return k.authority } -// GetBlockBloomTransient returns bloom bytes for the current block height -func (k Keeper) GetBlockBloomTransient(ctx sdk.Context) *big.Int { - store := prefix.NewStore(ctx.TransientStore(k.transientKey), types.KeyPrefixTransientBloom) - heightBz := sdk.Uint64ToBigEndian(uint64(ctx.BlockHeight())) - bz := store.Get(heightBz) - if len(bz) == 0 { - return big.NewInt(0) - } - - return new(big.Int).SetBytes(bz) -} - -// SetBlockBloomTransient sets the given bloom bytes to the transient store. This value is reset on -// every block. -func (k Keeper) SetBlockBloomTransient(ctx sdk.Context, bloom *big.Int) { - store := prefix.NewStore(ctx.TransientStore(k.transientKey), types.KeyPrefixTransientBloom) - heightBz := sdk.Uint64ToBigEndian(uint64(ctx.BlockHeight())) - store.Set(heightBz, bloom.Bytes()) -} - // ---------------------------------------------------------------------------- // Storage // ----------------------------------------------------------------------------