Files
coreth/plugin/evm/database_pebble.go
zeekay 718399b2a7 refactor(evm): codec-free sort, drop legacy config aliases, pebble-only
- Atomic export tx + GetUTXOs API: drop Codec argument from
  SortTransferableOutputs / IsSortedTransferableOutputs / GetAtomicUTXOs.
  Tracks proto-side simplification (Bytes()+assetID sort key).
- config.Config: remove CorethAdminAPIEnabled / CorethAdminAPIDir
  deprecated aliases and the Deprecate() warning shim in VM.Initialize.
  Net: AdminAPIEnabled / AdminAPIDir is the only canonical surface,
  config.md updated.
- database_pebble.go: drop `pebble` build-tag — pebble is the only
  backend, the stub file is removed.
- Test helpers (export_tx_test, vm_warp_test, syncervm_test, warp
  aggregator signature_getter): mirror the codec-free sort signature.
2026-06-04 17:05:36 -07:00

36 lines
886 B
Go

package evm
import (
"path/filepath"
"github.com/luxfi/database/manager"
"github.com/luxfi/geth/core/rawdb"
"github.com/luxfi/geth/ethdb"
)
// openSourceDatabase opens a source database for import operations
func openSourceDatabase(dataPath string) (ethdb.Database, error) {
// Open the source database using luxfi/database (pebbledb build tag).
db, err := manager.NewManager("", nil).New(&manager.Config{
Type: "pebbledb",
Path: dataPath,
ReadOnly: true,
})
if err != nil {
return nil, err
}
// Wrap with rawdb for higher-level access
// The ancient data is stored in a subdirectory of the chaindata directory
ancientPath := filepath.Join(dataPath, "ancient")
sourceDB, err := rawdb.Open(&ethdbAdapter{db: db}, rawdb.OpenOptions{
ReadOnly: true,
Ancient: ancientPath,
})
if err != nil {
db.Close()
return nil, err
}
return sourceDB, nil
}