Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Add back original flags with deprecation notice for backwards compati…
Browse files Browse the repository at this point in the history
…bility, rename builder.validation_blacklist to builder.blacklist
  • Loading branch information
Wazzymandias committed Jul 27, 2023
1 parent 9eb4c61 commit c862c29
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 12 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ $ geth --help
--builder.bellatrix_fork_version value (default: "0x02000000")
Bellatrix fork version. [$BUILDER_BELLATRIX_FORK_VERSION]
--builder.blacklist value
Path to file containing blacklisted addresses, json-encoded list of strings.
Builder will ignore transactions that touch mentioned addresses.
--builder.block_resubmit_interval value (default: "500ms")
Determines the interval at which builder will resubmit block submissions
[$FLASHBOTS_BUILDER_RATE_LIMIT_RESUBMIT_INTERVAL]
Expand Down Expand Up @@ -123,21 +127,19 @@ $ geth --help
blocks. For example, if a slot is 12 seconds long, and the offset is 2 seconds,
the builder will submit blocks at 10 seconds into the slot.
[$FLASHBOTS_BUILDER_SUBMISSION_OFFSET]
--builder.validation_blacklist value
Path to file containing blacklisted addresses, json-encoded list of strings
--builder.validator_checks (default: false)
Enable the validator checks
MINER
--miner.algotype value (default: "mev-geth")
Block building algorithm to use [=mev-geth] (mev-geth, greedy, greedy-buckets)
[NOTE: Deprecated, please use builder.algotype instead] Block building algorithm
to use [=mev-geth] (mev-geth, greedy, greedy-buckets)
--miner.blocklist value
flashbots - Path to JSON file with list of blocked addresses. Miner will ignore
txs that touch mentioned addresses.
--miner.blocklist value
[NOTE: Deprecated, please use builder.blacklist] flashbots - Path to JSON file with
list of blocked addresses. Miner will ignore txs that touch mentioned addresses.
--miner.extradata value
Block extra data set by the miner (default = client version)
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ var (
utils.MinerNotifyFlag,
utils.MinerGasLimitFlag,
utils.MinerGasPriceFlag,
utils.MinerAlgoTypeFlag,
utils.MinerEtherbaseFlag,
utils.MinerExtraDataFlag,
utils.MinerRecommitIntervalFlag,
Expand Down
45 changes: 41 additions & 4 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,12 @@ var (
Value: ethconfig.Defaults.Miner.GasPrice,
Category: flags.MinerCategory,
}
MinerAlgoTypeFlag = &cli.StringFlag{
Name: "miner.algotype",
Usage: "[NOTE: Deprecated, please use builder.algotype instead] Block building algorithm to use [=mev-geth] (mev-geth, greedy, greedy-buckets)",
Value: "mev-geth",
Category: flags.MinerCategory,
}
MinerEtherbaseFlag = &cli.StringFlag{
Name: "miner.etherbase",
Usage: "0x prefixed public address for block mining rewards",
Expand Down Expand Up @@ -575,7 +581,7 @@ var (
}
MinerBlocklistFileFlag = &cli.StringFlag{
Name: "miner.blocklist",
Usage: "flashbots - Path to JSON file with list of blocked addresses. Miner will ignore txs that touch mentioned addresses.",
Usage: "[NOTE: Deprecated, please use builder.blacklist] flashbots - Path to JSON file with list of blocked addresses. Miner will ignore txs that touch mentioned addresses.",
Value: "",
Category: flags.MinerCategory,
}
Expand Down Expand Up @@ -724,8 +730,9 @@ var (
Category: flags.BuilderCategory,
}
BuilderBlockValidationBlacklistSourceFilePath = &cli.StringFlag{
Name: "builder.validation_blacklist",
Usage: "Path to file containing blacklisted addresses, json-encoded list of strings",
Name: "builder.blacklist",
Usage: "Path to file containing blacklisted addresses, json-encoded list of strings. " +
"Builder will ignore transactions that touch mentioned addresses.",
Value: "",
Category: flags.BuilderCategory,
}
Expand Down Expand Up @@ -1684,7 +1691,15 @@ func SetBuilderConfig(ctx *cli.Context, cfg *builder.Config) {
cfg.BeaconEndpoints = strings.Split(ctx.String(BuilderBeaconEndpoints.Name), ",")
cfg.RemoteRelayEndpoint = ctx.String(BuilderRemoteRelayEndpoint.Name)
cfg.SecondaryRemoteRelayEndpoints = strings.Split(ctx.String(BuilderSecondaryRemoteRelayEndpoints.Name), ",")
cfg.ValidationBlocklist = ctx.String(BuilderBlockValidationBlacklistSourceFilePath.Name)
// NOTE: This flag is deprecated and will be removed in the future in favor of BuilderBlockValidationBlacklistSourceFilePath
if ctx.IsSet(MinerBlocklistFileFlag.Name) {
cfg.ValidationBlocklist = ctx.String(MinerBlocklistFileFlag.Name)
}

// NOTE: This flag takes precedence and will overwrite value set by MinerBlocklistFileFlag
if ctx.IsSet(BuilderBlockValidationBlacklistSourceFilePath.Name) {
cfg.ValidationBlocklist = ctx.String(BuilderBlockValidationBlacklistSourceFilePath.Name)
}
cfg.BuilderRateLimitDuration = ctx.String(BuilderRateLimitDuration.Name)
cfg.BuilderRateLimitMaxBurst = ctx.Int(BuilderRateLimitMaxBurst.Name)
cfg.BuilderSubmissionOffset = ctx.Duration(BuilderSubmissionOffset.Name)
Expand Down Expand Up @@ -1885,6 +1900,15 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
if ctx.IsSet(MinerGasPriceFlag.Name) {
cfg.GasPrice = flags.GlobalBig(ctx, MinerGasPriceFlag.Name)
}
// NOTE: This flag is deprecated and will be removed in the future.
if ctx.IsSet(MinerAlgoTypeFlag.Name) {
algoType, err := miner.AlgoTypeFlagToEnum(ctx.String(BuilderAlgoTypeFlag.Name))
if err != nil {
Fatalf("Invalid algo in --builder.algotype: %s", ctx.String(BuilderAlgoTypeFlag.Name))
}
cfg.AlgoType = algoType
}
// NOTE: BuilderAlgoTypeFlag takes precedence and will overwrite value set by MinerAlgoTypeFlag.
if ctx.IsSet(BuilderAlgoTypeFlag.Name) {
algoType, err := miner.AlgoTypeFlagToEnum(ctx.String(BuilderAlgoTypeFlag.Name))
if err != nil {
Expand All @@ -1904,6 +1928,7 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {

cfg.MaxMergedBundles = ctx.Int(MinerMaxMergedBundlesFlag.Name)

// NOTE: This flag is deprecated and will be removed in the future in favor of BuilderBlockValidationBlacklistSourceFilePath
if ctx.IsSet(MinerBlocklistFileFlag.Name) {
bytes, err := os.ReadFile(ctx.String(MinerBlocklistFileFlag.Name))
if err != nil {
Expand All @@ -1915,6 +1940,18 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
}
}

// NOTE: This flag takes precedence and will overwrite value set by MinerBlocklistFileFlag
if ctx.IsSet(BuilderBlockValidationBlacklistSourceFilePath.Name) {
bytes, err := os.ReadFile(ctx.String(MinerBlocklistFileFlag.Name))
if err != nil {
Fatalf("Failed to read blocklist file: %s", err)
}

if err := json.Unmarshal(bytes, &cfg.Blocklist); err != nil {
Fatalf("Failed to parse blocklist: %s", err)
}
}

cfg.PriceCutoffPercent = ctx.Int(BuilderPriceCutoffPercentFlag.Name)
}

Expand Down

0 comments on commit c862c29

Please sign in to comment.