Skip to content

Commit

Permalink
chore(cmd/geth): enable state expiry only with PBSS
Browse files Browse the repository at this point in the history
  • Loading branch information
asyukii committed Oct 9, 2023
1 parent 3db6a59 commit 9a0723c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/scwallet"
"github.com/ethereum/go-ethereum/accounts/usbwallet"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/internal/flags"
Expand Down Expand Up @@ -272,8 +273,14 @@ func applyMetricConfig(ctx *cli.Context, cfg *gethConfig) {
}

func applyStateExpiryConfig(ctx *cli.Context, cfg *gethConfig) {

if ctx.IsSet(utils.StateExpiryEnableFlag.Name) {
cfg.Eth.StateExpiryEnable = ctx.Bool(utils.StateExpiryEnableFlag.Name)
enableStateExpiry := ctx.Bool(utils.StateExpiryEnableFlag.Name)
if enableStateExpiry && ctx.IsSet(utils.StateSchemeFlag.Name) && ctx.String(utils.StateSchemeFlag.Name) == rawdb.HashScheme {
log.Warn("State expiry is not supported with hash scheme. Disabling state expiry")
enableStateExpiry = false
}
cfg.Eth.StateExpiryEnable = enableStateExpiry
}
if ctx.IsSet(utils.StateExpiryFullStateEndpointFlag.Name) {
cfg.Eth.StateExpiryFullStateEndpoint = ctx.String(utils.StateExpiryFullStateEndpointFlag.Name)
Expand Down

0 comments on commit 9a0723c

Please sign in to comment.