state-diff configs & kv functions (#15903)

* state-diff configs

* state diff kv functions

* potuz's comments

* Update config.go

* fix merge conflicts

* apply bazel's suggestion and fix some bugs

* preston's feedback
This commit is contained in:
Bastin
2025-11-19 20:27:56 +01:00
committed by GitHub
parent eb9feabd6f
commit 207f36065a
17 changed files with 1329 additions and 4 deletions

View File

@@ -51,6 +51,8 @@ type Flags struct {
EnableExperimentalAttestationPool bool // EnableExperimentalAttestationPool enables an experimental attestation pool design.
DisableDutiesV2 bool // DisableDutiesV2 sets validator client to use the get Duties endpoint
EnableWeb bool // EnableWeb enables the webui on the validator client
EnableStateDiff bool // EnableStateDiff enables the experimental state diff feature for the beacon node.
// Logging related toggles.
DisableGRPCConnectionLogs bool // Disables logging when a new grpc client has connected.
EnableFullSSZDataLogging bool // Enables logging for full ssz data on rejected gossip messages
@@ -284,6 +286,16 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
cfg.DisableLastEpochTargets = true
}
if ctx.IsSet(enableStateDiff.Name) {
logEnabled(enableStateDiff)
cfg.EnableStateDiff = true
if ctx.IsSet(enableHistoricalSpaceRepresentation.Name) {
log.Warn("--enable-state-diff is enabled, ignoring --enable-historical-space-representation flag.")
cfg.EnableHistoricalSpaceRepresentation = false
}
}
cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value}
Init(cfg)
return nil

View File

@@ -172,6 +172,10 @@ var (
Name: "enable-experimental-attestation-pool",
Usage: "Enables an experimental attestation pool design.",
}
enableStateDiff = &cli.BoolFlag{
Name: "enable-state-diff",
Usage: "Enables the experimental state diff feature.",
}
// forceHeadFlag is a flag to force the head of the beacon chain to a specific block.
forceHeadFlag = &cli.StringFlag{
Name: "sync-from",