Integrate state-diff into State() (#16033)

**What type of PR is this?**
Feature

**What does this PR do? Why is it needed?**
This PR integrates the state diff path into the `State()` function from
`db/kv`, which allows reading of states using the state diff db, when
the `EnableStateDiff` flag is enabled.

**Notes for reviewers:**
Files `kv/state_diff_test.go` and `config/features/config.go` only
contain renamings:
- `kv/state_diff_test.go`: rename `setDefaultExponents()` to
`setDefaultStateDiffExponents()` to be less vague.
- `config/features/config.go`: rename `enableStateDiff` to
`EnableStateDiff` to make it public.
This commit is contained in:
Bastin
2025-11-24 13:42:43 +01:00
committed by GitHub
parent b78c2c354b
commit 11bb8542a4
6 changed files with 303 additions and 14 deletions

View File

@@ -286,8 +286,8 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
cfg.DisableLastEpochTargets = true
}
if ctx.IsSet(enableStateDiff.Name) {
logEnabled(enableStateDiff)
if ctx.IsSet(EnableStateDiff.Name) {
logEnabled(EnableStateDiff)
cfg.EnableStateDiff = true
if ctx.IsSet(enableHistoricalSpaceRepresentation.Name) {

View File

@@ -172,7 +172,7 @@ var (
Name: "enable-experimental-attestation-pool",
Usage: "Enables an experimental attestation pool design.",
}
enableStateDiff = &cli.BoolFlag{
EnableStateDiff = &cli.BoolFlag{
Name: "enable-state-diff",
Usage: "Enables the experimental state diff feature.",
}