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

Commit

Permalink
feat(blob): set min blob fee (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Mar 14, 2024
1 parent 5983828 commit 1727fc5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/rpc/tx_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto/kzg4844"
"github.com/ethereum/go-ethereum/params"
"github.com/holiman/uint256"
)

Expand Down Expand Up @@ -94,6 +95,11 @@ func (c *EthClient) CreateBlobTx(
return nil, err
}

blobFeeCap := rawTx.BlobGasFeeCap()
if blobFeeCap == nil || blobFeeCap.Uint64() < params.BlobTxMinBlobGasprice {
blobFeeCap = new(big.Int).SetUint64(uint64(params.BlobTxMinBlobGasprice))
}

return &types.BlobTx{
ChainID: uint256.MustFromBig(rawTx.ChainId()),
Nonce: rawTx.Nonce(),
Expand All @@ -104,7 +110,7 @@ func (c *EthClient) CreateBlobTx(
Value: uint256.MustFromBig(rawTx.Value()),
Data: rawTx.Data(),
AccessList: rawTx.AccessList(),
BlobFeeCap: uint256.MustFromBig(rawTx.BlobGasFeeCap()),
BlobFeeCap: uint256.MustFromBig(blobFeeCap),
BlobHashes: sidecar.BlobHashes(),
Sidecar: sidecar,
}, nil
Expand Down

0 comments on commit 1727fc5

Please sign in to comment.