Skip to content

Commit

Permalink
Merge pull request #4588 from oasisprotocol/pro-wh/feature/preserve
Browse files Browse the repository at this point in the history
go/oasis-node/cmd: unsafe-reset preserve mkvs by default
  • Loading branch information
pro-wh authored Mar 22, 2022
2 parents aa52c4d + 423b989 commit f515995
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changelog/4588.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
go/oasis-node/cmd: Preserve MKVS database by default in unsafe-reset

Preserving the MKVS database is becoming the more common workflow, so we're
making that the default for `oasis-node unsafe-reset`.

Use `--preserve.mkvs_database=false` to wipe the mkvs database as the
previous default did.
2 changes: 1 addition & 1 deletion go/oasis-node/cmd/node/unsafe_reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ func doUnsafeReset(cmd *cobra.Command, args []string) {

func init() {
unsafeResetFlags.Bool(CfgPreserveLocalStorage, false, "preserve per-runtime untrusted local storage")
unsafeResetFlags.Bool(CfgPreserveMKVSDatabase, false, "preserve per-runtime MKVS database")
unsafeResetFlags.Bool(CfgPreserveMKVSDatabase, true, "preserve per-runtime MKVS database")
_ = viper.BindPFlags(unsafeResetFlags)
}
4 changes: 2 additions & 2 deletions go/oasis-test-runner/oasis/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func New(env *env.Env, factory Factory, logger *logging.Logger) *Helpers {
// runtime state.
func (h *Helpers) UnsafeReset(dataDir string, preserveRuntimeStorage, preserveLocalStorage bool) error {
args := []string{"unsafe-reset", "--" + cmdCommon.CfgDataDir, dataDir}
if preserveRuntimeStorage {
args = append(args, "--"+cmdNode.CfgPreserveMKVSDatabase)
if !preserveRuntimeStorage {
args = append(args, "--"+cmdNode.CfgPreserveMKVSDatabase+"=false")
}
if preserveLocalStorage {
args = append(args, "--"+cmdNode.CfgPreserveLocalStorage)
Expand Down

0 comments on commit f515995

Please sign in to comment.