diff --git a/core/rawdb/chain_freezer.go b/core/rawdb/chain_freezer.go index 3a18281100..fd52437027 100644 --- a/core/rawdb/chain_freezer.go +++ b/core/rawdb/chain_freezer.go @@ -74,6 +74,9 @@ func newChainFreezer(datadir string, namespace string, readonly bool, offset uin Freezer: freezer, quit: make(chan struct{}), trigger: make(chan chan struct{}), + // After enabling pruneAncient, the ancient data is not retained. In some specific scenarios where it is + // necessary to roll back to blocks prior to the finalized block, it is mandatory to keep the most recent 90,000 blocks in the database to ensure proper functionality and rollback capability. + multiDatabase: false, } cf.threshold.Store(params.FullImmutabilityThreshold) return &cf, nil diff --git a/eth/backend.go b/eth/backend.go index 14053f1450..556af40b4a 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -210,7 +210,11 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { } // startup ancient freeze - if err = chainDb.SetupFreezerEnv(ðdb.FreezerEnv{ + freezeDb := chainDb + if stack.CheckIfMultiDataBase() { + freezeDb = chainDb.BlockStore() + } + if err = freezeDb.SetupFreezerEnv(ðdb.FreezerEnv{ ChainCfg: chainConfig, BlobExtraReserve: config.BlobExtraReserve, }); err != nil {