Skip to content

Commit

Permalink
txpool: tidy NoGossip config (#13203)
Browse files Browse the repository at this point in the history
pretty straightforward tidy up PR

1. moves DisableTxPoolGossip from ethconfig.Config to txpoolcfg.Config
2. adds some license/doc comments to tidy up previous PR
  • Loading branch information
taratorio authored Dec 21, 2024
1 parent 0c86f24 commit 78a3f43
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 13 deletions.
7 changes: 3 additions & 4 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,9 @@ func setTxPool(ctx *cli.Context, dbDir string, fullCfg *ethconfig.Config) {
if ctx.IsSet(DbWriteMapFlag.Name) {
cfg.MdbxWriteMap = ctx.Bool(DbWriteMapFlag.Name)
}
if ctx.IsSet(TxPoolGossipDisableFlag.Name) {
cfg.NoGossip = ctx.Bool(TxPoolGossipDisableFlag.Name)
}
cfg.LogEvery = 3 * time.Minute
cfg.CommitEvery = libcommon.RandomizeDuration(ctx.Duration(TxPoolCommitEveryFlag.Name))
cfg.DBDir = dbDir
Expand Down Expand Up @@ -1992,10 +1995,6 @@ func SetEthConfig(ctx *cli.Context, nodeConfig *nodecfg.Config, cfg *ethconfig.C
if ctx.IsSet(TrustedSetupFile.Name) {
libkzg.SetTrustedSetupFilePath(ctx.String(TrustedSetupFile.Name))
}

if ctx.IsSet(TxPoolGossipDisableFlag.Name) {
cfg.DisableTxPoolGossip = ctx.Bool(TxPoolGossipDisableFlag.Name)
}
}

// SetDNSDiscoveryDefaults configures DNS discovery with the given URL if
Expand Down
1 change: 0 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
}

var txnProvider txnprovider.TxnProvider
config.TxPool.NoGossip = config.DisableTxPoolGossip
var miningRPC txpoolproto.MiningServer
stateDiffClient := direct.NewStateDiffClientDirect(kvRPC)
if config.TxPool.Disable {
Expand Down
2 changes: 0 additions & 2 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ type Config struct {
SilkwormRpcLogDumpResponse bool
SilkwormRpcNumWorkers uint32
SilkwormRpcJsonCompatibility bool

DisableTxPoolGossip bool
}

type Sync struct {
Expand Down
6 changes: 0 additions & 6 deletions eth/ethconfig/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions txnprovider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import (
)

type TxnProvider interface {
// ProvideTxns provides transactions ready to be included in a block for block building. Available request options:
// - WithParentBlockNum
// - WithAmount
// - WithGasTarget
// - WithBlobGasTarget
// - WithTxnIdsFilter
ProvideTxns(ctx context.Context, opts ...ProvideOption) ([]types.Transaction, error)
}

Expand Down
16 changes: 16 additions & 0 deletions txnprovider/shutter/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2024 The Erigon Authors
// This file is part of Erigon.
//
// Erigon is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Erigon is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Erigon. If not, see <http://www.gnu.org/licenses/>.

package shutter

import (
Expand Down
16 changes: 16 additions & 0 deletions txnprovider/shutter/pool.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2024 The Erigon Authors
// This file is part of Erigon.
//
// Erigon is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Erigon is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Erigon. If not, see <http://www.gnu.org/licenses/>.

package shutter

import (
Expand Down

0 comments on commit 78a3f43

Please sign in to comment.