Skip to content

Commit 35b4183

Browse files
authored
cmd/utils: allow configurating blob pool from flags (#30203)
Currently, we have 3 flags to configure blob pool. However, we don't read these flags and set the blob pool configuration in eth config accordingly. This commit adds a function to check if these flags are provided and set blob pool configuration based on them.
1 parent 1939813 commit 35b4183

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cmd/utils/flags.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
"github.com/ethereum/go-ethereum/common/fdlimit"
4343
"github.com/ethereum/go-ethereum/core"
4444
"github.com/ethereum/go-ethereum/core/rawdb"
45+
"github.com/ethereum/go-ethereum/core/txpool/blobpool"
4546
"github.com/ethereum/go-ethereum/core/txpool/legacypool"
4647
"github.com/ethereum/go-ethereum/core/vm"
4748
"github.com/ethereum/go-ethereum/crypto"
@@ -1550,6 +1551,18 @@ func setTxPool(ctx *cli.Context, cfg *legacypool.Config) {
15501551
}
15511552
}
15521553

1554+
func setBlobPool(ctx *cli.Context, cfg *blobpool.Config) {
1555+
if ctx.IsSet(BlobPoolDataDirFlag.Name) {
1556+
cfg.Datadir = ctx.String(BlobPoolDataDirFlag.Name)
1557+
}
1558+
if ctx.IsSet(BlobPoolDataCapFlag.Name) {
1559+
cfg.Datacap = ctx.Uint64(BlobPoolDataCapFlag.Name)
1560+
}
1561+
if ctx.IsSet(BlobPoolPriceBumpFlag.Name) {
1562+
cfg.PriceBump = ctx.Uint64(BlobPoolPriceBumpFlag.Name)
1563+
}
1564+
}
1565+
15531566
func setMiner(ctx *cli.Context, cfg *miner.Config) {
15541567
if ctx.Bool(MiningEnabledFlag.Name) {
15551568
log.Warn("The flag --mine is deprecated and will be removed")
@@ -1651,6 +1664,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
16511664
setEtherbase(ctx, cfg)
16521665
setGPO(ctx, &cfg.GPO)
16531666
setTxPool(ctx, &cfg.TxPool)
1667+
setBlobPool(ctx, &cfg.BlobPool)
16541668
setMiner(ctx, &cfg.Miner)
16551669
setRequiredBlocks(ctx, cfg)
16561670
setLes(ctx, cfg)

0 commit comments

Comments
 (0)