From 7f5474ef8274a5f1f489132fe286239c0961e5f7 Mon Sep 17 00:00:00 2001 From: DragonX Developers Date: Wed, 26 Aug 2026 10:33:51 -0500 Subject: [PATCH] version: 0.1.2, from a single constant Bump for the GetTransaction crash fix, and make the version one value instead of two literals that could drift. It was duplicated: cmd/server/main.go had `var version = "0.1.1"` for --version, and frontend/service.go had "0.1.1-dragonxlightd" inline in the LightdInfo reply. The gRPC one is the load-bearing copy -- it is walletrpc/service.proto:48, so every client reads it, and it is the only way to tell from off-box which build a node is running. That property is the point of bumping now rather than later. With it, a rollout can be verified by probing each endpoint over TLS and reading the advertised version, instead of shelling in to compare binary checksums, and instead of the only alternative positive test -- calling GetTransaction on a mempool txid, which proves the fix by crashing any node that does not have it. Verified: --version prints 0.1.2, and a GetLightdInfo probe against a test instance returns 0.1.2-dragonxlightd where production still returns 0.1.1-dragonxlightd. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FU87LdsJZiZkfq1eXubpeo --- cmd/server/main.go | 2 +- common/version.go | 14 ++++++++++++++ frontend/service.go | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 common/version.go diff --git a/cmd/server/main.go b/cmd/server/main.go index f766938..8077751 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -93,7 +93,7 @@ type Options struct { } func main() { - var version = "0.1.1" // set version number + var version = common.Version opts := &Options{} flag.StringVar(&opts.bindAddr, "bind-addr", "127.0.0.1:9069", "the address to listen on") diff --git a/common/version.go b/common/version.go new file mode 100644 index 0000000..4b979c6 --- /dev/null +++ b/common/version.go @@ -0,0 +1,14 @@ +package common + +// Version is the single source of truth for this daemon's version. +// +// It was previously duplicated as a literal in two places that could drift: +// cmd/server/main.go's --version output and the Version field of the LightdInfo +// gRPC reply in frontend/service.go. The gRPC one is the load-bearing copy -- +// it is walletrpc/service.proto:48, so every client and every operator probe +// reads it, and it is the only way to tell from off-box which build a node is +// running. +const Version = "0.1.2" + +// VersionString is what GetLightdInfo advertises to clients. +const VersionString = Version + "-dragonxlightd" diff --git a/frontend/service.go b/frontend/service.go index 10f932c..608cf60 100644 --- a/frontend/service.go +++ b/frontend/service.go @@ -353,7 +353,7 @@ func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (* // TODO these are called Error but they aren't at the moment. // A success will return code 0 and message txhash. return &walletrpc.LightdInfo{ - Version: "0.1.1-dragonxlightd", + Version: common.VersionString, Vendor: "DragonX LightWalletD", TaddrSupport: true, ChainName: chainName,