node: force opening freezer

This commit is contained in:
Felix Lange 2025-05-26 14:13:02 +02:00 committed by lightclient
parent 0c1f71d3d8
commit 436aac37c4
No known key found for this signature in database
GPG key ID: 657913021EF45A6A
2 changed files with 4 additions and 7 deletions

View file

@ -57,9 +57,6 @@ func openDatabase(o internalOpenOptions) (ethdb.Database, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if len(o.AncientsDirectory) == 0 {
return kvdb, nil
}
opts := rawdb.OpenOptions{ opts := rawdb.OpenOptions{
Ancient: o.AncientsDirectory, Ancient: o.AncientsDirectory,
Era: o.EraDirectory, Era: o.EraDirectory,
@ -80,7 +77,7 @@ func openDatabase(o internalOpenOptions) (ethdb.Database, error) {
// +---------------------------------------- // +----------------------------------------
// db is non-existent | pebble default | specified type // db is non-existent | pebble default | specified type
// db is existent | from db | specified type (if compatible) // db is existent | from db | specified type (if compatible)
func openKeyValueDatabase(o internalOpenOptions) (ethdb.Database, error) { func openKeyValueDatabase(o internalOpenOptions) (ethdb.KeyValueStore, error) {
// Reject any unsupported database type // Reject any unsupported database type
if len(o.dbEngine) != 0 && o.dbEngine != rawdb.DBLeveldb && o.dbEngine != rawdb.DBPebble { if len(o.dbEngine) != 0 && o.dbEngine != rawdb.DBLeveldb && o.dbEngine != rawdb.DBPebble {
return nil, fmt.Errorf("unknown db.engine %v", o.dbEngine) return nil, fmt.Errorf("unknown db.engine %v", o.dbEngine)
@ -106,7 +103,7 @@ func openKeyValueDatabase(o internalOpenOptions) (ethdb.Database, error) {
// newLevelDBDatabase creates a persistent key-value database without a freezer // newLevelDBDatabase creates a persistent key-value database without a freezer
// moving immutable chain segments into cold storage. // moving immutable chain segments into cold storage.
func newLevelDBDatabase(file string, cache int, handles int, namespace string, readonly bool) (ethdb.Database, error) { func newLevelDBDatabase(file string, cache int, handles int, namespace string, readonly bool) (ethdb.KeyValueStore, error) {
db, err := leveldb.New(file, cache, handles, namespace, readonly) db, err := leveldb.New(file, cache, handles, namespace, readonly)
if err != nil { if err != nil {
return nil, err return nil, err
@ -117,7 +114,7 @@ func newLevelDBDatabase(file string, cache int, handles int, namespace string, r
// newPebbleDBDatabase creates a persistent key-value database without a freezer // newPebbleDBDatabase creates a persistent key-value database without a freezer
// moving immutable chain segments into cold storage. // moving immutable chain segments into cold storage.
func newPebbleDBDatabase(file string, cache int, handles int, namespace string, readonly bool) (ethdb.Database, error) { func newPebbleDBDatabase(file string, cache int, handles int, namespace string, readonly bool) (ethdb.KeyValueStore, error) {
db, err := pebble.New(file, cache, handles, namespace, readonly) db, err := pebble.New(file, cache, handles, namespace, readonly)
if err != nil { if err != nil {
return nil, err return nil, err

@ -1 +1 @@
Subproject commit 81862e4848585a438d64f911a19b3825f0f4cd95 Subproject commit faf33b471465d3c6cdc3d04fbd690895f78d33f2