Skip to content

bug: inspect databases #1137

@RodrigoVillar

Description

@RodrigoVillar

Currently, enabling the inspect-database option in Coreth results in VM initialization erroring. I first noticed this bug here: https://github.com/ava-labs/avalanchego/actions/runs/17109691592/job/48527748332?pr=4190#step:4:1158

Code Path/Steps To Reproduce:

  1. Prior to starting up the VM, make sure that the inspect-database option in the EVM config is set to true [ref]
  2. In Initialize() [ref], we create the VM databases including chainDB which is instantiated as follows: vm.chaindb = rawdb.NewDatabase(database.WrapDatabase(prefixdb.NewNested(ethDBPrefix, db))) [ref]. Note that vm.chainDB is wrapped in the nofreezedb type
  3. Since we specified inspect-database to true, we call inspectDatabases()[ref]
  4. In inspectDatabases(), we call rawdb.InspectDatabases() on vm.chainDB which eventually inspects the DB freezers [ref].
  5. The freezer inspection code eventually calls one of the methods of chainDB, which results in the error errNotSupported being returned [ref].

This error occurs because in Coreth, we do not utilize a freezer database while geth does.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions