diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 136e0945c9..d2c6c217c7 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -500,7 +500,7 @@ var ( } BlobPoolFetchProbabilityFlag = &cli.Uint64Flag{ Name: "blobpool.fetchprobability", - Usage: "Probability of fetching the full blob payload for sparse blobpool", + Usage: "Probability of fetching the full blob payload for sparse blobpool (min=15, max=100)", Value: fetcher.DefaultFetchProbability, Category: flags.BlobPoolCategory, } @@ -1677,8 +1677,7 @@ func setBlobPool(ctx *cli.Context, cfg *blobpool.Config) { cfg.PriceBump = ctx.Uint64(BlobPoolPriceBumpFlag.Name) } if ctx.IsSet(BlobPoolFetchProbabilityFlag.Name) { - v := ctx.Uint64(BlobPoolFetchProbabilityFlag.Name) - cfg.FetchProbability = &v + cfg.FetchProbability = ctx.Uint64(BlobPoolFetchProbabilityFlag.Name) } } diff --git a/core/txpool/blobpool/config.go b/core/txpool/blobpool/config.go index ed782c2be7..d4c7d1c0f6 100644 --- a/core/txpool/blobpool/config.go +++ b/core/txpool/blobpool/config.go @@ -26,7 +26,7 @@ type Config struct { Datacap uint64 // Soft-cap of database storage (hard cap is larger due to overhead) PriceBump uint64 // Minimum price bump percentage to replace an already existing nonce - FetchProbability *uint64 // EIP-8070: full blob fetch probability for sparse blobpool + FetchProbability uint64 // EIP-8070: full blob fetch probability for sparse blobpool } // DefaultConfig contains the default configurations for the transaction pool. diff --git a/eth/backend.go b/eth/backend.go index 91b937fe84..ef4f593e6a 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -344,13 +344,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { stack.RegisterLifecycle(eth.localTxTracker) } - var fetchProb uint64 - if config.BlobPool.FetchProbability != nil { - fetchProb = *config.BlobPool.FetchProbability - } else { - fetchProb = fetcher.DefaultFetchProbability - } - // Permit the downloader to use the trie cache allowance during fast sync cacheLimit := options.TrieCleanLimit + options.TrieDirtyLimit + options.SnapshotLimit if eth.handler, err = newHandler(&handlerConfig{ @@ -364,7 +357,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { BloomCache: uint64(cacheLimit), RequiredBlocks: config.RequiredBlocks, SnapV2: config.SnapV2, - FetchProbability: fetchProb, + FetchProbability: config.BlobPool.FetchProbability, }); err != nil { return nil, err } diff --git a/eth/fetcher/blob_fetcher.go b/eth/fetcher/blob_fetcher.go index 7b96e9cdd0..fa3d84b820 100644 --- a/eth/fetcher/blob_fetcher.go +++ b/eth/fetcher/blob_fetcher.go @@ -161,6 +161,9 @@ type token struct { } func NewBlobFetcher(fn BlobFetcherFunctions, custody types.CustodyBitmap, rand random, fetchProbability uint64) *BlobFetcher { + if fetchProbability < DefaultFetchProbability { + fetchProbability = DefaultFetchProbability + } return &BlobFetcher{ notify: make(chan *blobTxAnnounce), cleanup: make(chan *payloadDelivery),