diff --git a/x/blob/keeper/gas_test.go b/x/blob/keeper/gas_test.go index 2f7958dac0..32e6c50e47 100644 --- a/x/blob/keeper/gas_test.go +++ b/x/blob/keeper/gas_test.go @@ -68,7 +68,7 @@ func TestPayForBlobGas(t *testing.T) { { name: "1024 byte blob", // occupies 3 shares because share prefix (e.g. namespace, info byte) msg: types.MsgPayForBlob{BlobSize: 1024}, - wantGasConsumed: uint64(13348), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 12288 gas + wantGasConsumed: uint64(13348), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 13348 gas }, } diff --git a/x/blob/keeper/keeper.go b/x/blob/keeper/keeper.go index 073383bd39..c47a6e9973 100644 --- a/x/blob/keeper/keeper.go +++ b/x/blob/keeper/keeper.go @@ -52,9 +52,9 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) PayForBlob(goCtx context.Context, msg *types.MsgPayForBlob) (*types.MsgPayForBlobResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // calculate gas per message share by fetching the constant share size and the gas cost per byte from the KV store - gasPerMsgShare := appconsts.ShareSize * k.GasPerBlobByte(ctx) - gasToConsume := uint64(shares.BlobSharesUsed(int(msg.BlobSize)) * int(gasPerMsgShare)) + // calculate gas per blob share by fetching the constant share size and the gas cost per byte from the KV store + gasPerBlobShare := appconsts.ShareSize * k.GasPerBlobByte(ctx) + gasToConsume := uint64(shares.BlobSharesUsed(int(msg.BlobSize)) * int(gasPerBlobShare)) ctx.GasMeter().ConsumeGas(gasToConsume, payForBlobGasDescriptor) err := ctx.EventManager().EmitTypedEvent(