Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txpool: tidy NoGossip config #13203

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,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 @@ -1985,10 +1988,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 @@ -257,8 +257,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
Loading