mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
eth, cmd: change flag from pointer to value
This commit is contained in:
parent
cfcd8aa797
commit
91b643be83
4 changed files with 7 additions and 12 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue