Skip to content

Commit 99dafde

Browse files
alarso16JonathanOppenheimer
authored andcommitted
feat: Enable PathDB config (#1244)
1 parent 6aaa925 commit 99dafde

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

plugin/evm/config/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ Configuration is provided as a JSON object. All fields are optional unless other
255255

256256
## Database Configuration
257257

258-
> **WARNING**: `firewood` scheme is untested in production. To use `firewood`, you must also set the following config options:
258+
> **WARNING**: `firewood` and `path` schemes are untested in production. Using `path` is strongly discouraged. To use `firewood`, you must also set the following config options:
259259
>
260260
> - `pruning-enabled: true` (enabled by default)
261261
> - `state-sync-enabled: false`
@@ -266,7 +266,7 @@ Failing to set these options will result in errors on VM initialization. Additio
266266
| Option | Type | Description | Default |
267267
|--------|------|-------------|---------|
268268
| `inspect-database` | bool | Inspect database on startup | `false` |
269-
| `state-scheme` | string | EXPERIMENTAL: specifies the database scheme to store state data; can be one of `hash` or `firewood` | `hash` |
269+
| `state-scheme` | string | EXPERIMENTAL: specifies the database scheme to store state data; can be one of `hash`, `firewood`, or `path` | `hash` |
270270

271271
## Transaction Indexing
272272

plugin/evm/vm.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ var (
144144
errFirewoodSnapshotCacheDisabled = errors.New("snapshot cache must be disabled for Firewood")
145145
errFirewoodOfflinePruningUnsupported = errors.New("offline pruning is not supported for Firewood")
146146
errFirewoodStateSyncUnsupported = errors.New("state sync is not yet supported for Firewood")
147-
errPathStateUnsupported = errors.New("path state scheme is not supported")
148147
)
149148

150149
var originalStderr *os.File
@@ -410,8 +409,7 @@ func (vm *VM) Initialize(
410409
}
411410
}
412411
if vm.ethConfig.StateScheme == rawdb.PathScheme {
413-
log.Error("Path state scheme is not supported. Please use HashDB or Firewood state schemes instead")
414-
return errPathStateUnsupported
412+
log.Warn("Path state scheme is not supported. Please use HashDB or Firewood state schemes instead")
415413
}
416414

417415
// Create directory for offline pruning

plugin/evm/vm_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/ava-labs/avalanchego/vms/platformvm/warp/payload"
2929
"github.com/ava-labs/libevm/common"
3030
"github.com/ava-labs/libevm/common/math"
31+
"github.com/ava-labs/libevm/core/rawdb"
3132
"github.com/ava-labs/libevm/core/types"
3233
"github.com/ava-labs/libevm/crypto"
3334
"github.com/ava-labs/libevm/log"
@@ -45,6 +46,7 @@ import (
4546
"github.com/ava-labs/coreth/params"
4647
"github.com/ava-labs/coreth/params/paramstest"
4748
"github.com/ava-labs/coreth/plugin/evm/customheader"
49+
"github.com/ava-labs/coreth/plugin/evm/customrawdb"
4850
"github.com/ava-labs/coreth/plugin/evm/customtypes"
4951
"github.com/ava-labs/coreth/plugin/evm/extension"
5052
"github.com/ava-labs/coreth/plugin/evm/message"
@@ -198,7 +200,8 @@ func testVMUpgrades(t *testing.T, scheme string) {
198200
}
199201

200202
func TestBuildEthTxBlock(t *testing.T) {
201-
for _, scheme := range vmtest.Schemes {
203+
// This test is done for all schemes to ensure the VM can be started with any scheme.
204+
for _, scheme := range []string{rawdb.HashScheme, rawdb.PathScheme, customrawdb.FirewoodScheme} {
202205
t.Run(scheme, func(t *testing.T) {
203206
testBuildEthTxBlock(t, scheme)
204207
})

0 commit comments

Comments
 (0)