Files
node/vms/xvm/config.go
T
zeekay 14f638c918 xvm: remove execution_root activation gate — values not gates (active, not gated)
The prior seam added a bespoke MerkleRootActivationHeight gate (default
MerkleRootNeverActivate=MaxUint64) that violated upgrade/upgrade.go's stated
philosophy ('activate-all-implicitly; the fields encode values, not gates').
Removed it entirely (grep-clean): the builder ALWAYS stamps the real xvm
execution_root, the executor ALWAYS recomputes+verifies it, an empty root is
now rejected. Root computation byte-IDENTICAL (exec_root=4f144ef7…) — only the
gating is gone. Net -92 lines. Tests converted to always-active reality
(empty-root-rejected is the new gate test); ./vms/xvm/... + ./upgrade/... green
uncached + -race. asset_root stays keccak256("") (UTXO-only executor; assets
bound via each UTXO's AssetID).
2026-06-16 12:59:21 -07:00

38 lines
942 B
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package xvm
import (
"github.com/go-json-experiment/json"
jsonv1 "github.com/go-json-experiment/json/v1"
"github.com/luxfi/node/vms/xvm/config"
"github.com/luxfi/node/vms/xvm/network"
)
var DefaultConfig = Config{
Network: network.DefaultConfig,
ChecksumsEnabled: true,
Config: config.Config{
TxFee: 1000, // 1000 nanoLux base transaction fee
CreateAssetTxFee: 10000, // 10000 nanoLux for asset creation
},
}
type Config struct {
Network network.Config `json:"network"`
ChecksumsEnabled bool `json:"checksumsEnabled"`
config.Config
}
func ParseConfig(configBytes []byte) (Config, error) {
if len(configBytes) == 0 {
return DefaultConfig, nil
}
cfg := DefaultConfig
err := json.Unmarshal(configBytes, &cfg, jsonv1.FormatDurationAsNano(true))
return cfg, err
}