Skip to content

Commit

Permalink
Address CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Jan 24, 2025
1 parent be8806a commit 13b3a8f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/cli/example_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ verbosity = 3 # Logging verbosity for the server (5=trace|4=de
vmdebug = false # Record information useful for VM and contract debugging
datadir = "var/lib/bor" # Path of the data directory to store information
ancient = "" # Data directory for ancient chain segments (default = inside chaindata)
"db.engine" = "pebble" # Used to select leveldb or pebble as database (default = leveldb)
"db.engine" = "pebble" # Used to select leveldb or pebble as database (default = pebble)
"state.scheme" = "path" # Used to select the state scheme (default = path)
keystore = "" # Path of the directory where keystores are located
"rpc.batchlimit" = 100 # Maximum number of messages in a batch (default=100, use 0 for no limits)
"rpc.returndatalimit" = 100000 # Maximum size (in bytes) a result of an rpc request could have (default=100000, use 0 for no limits)
Expand Down
3 changes: 3 additions & 0 deletions internal/cli/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,9 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*

log.Info("Enabling recording of key preimages since archive mode is used")
}
if c.StateScheme == "path" {
return nil, fmt.Errorf("path storage scheme is not supported in archive mode, please use hash instead")
}
default:
return nil, fmt.Errorf("gcmode '%s' not found", c.GcMode)
}
Expand Down
14 changes: 14 additions & 0 deletions internal/cli/server/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,17 @@ func TestMakePasswordListFromFile(t *testing.T) {
assert.Equal(t, []string{"test1", "test2"}, result)
})
}

func TestConfigStateScheme(t *testing.T) {
config := DefaultConfig()
config.StateScheme = "path"
config.GcMode = "archive"

assert.NoError(t, config.loadChain())

_, err := config.buildNode()
assert.NoError(t, err)

_, err = config.buildEth(nil, nil)
assert.Error(t, err)
}

0 comments on commit 13b3a8f

Please sign in to comment.