From 58fbc6bab4413b2339dac444e938e03555bc021f Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Mon, 27 Oct 2025 18:46:19 -0400 Subject: [PATCH] fix: align struct fields for smallest memory use Signed-off-by: Chris Gianelloni --- internal/api/chainsync.go | 2 +- internal/api/localstatequery.go | 4 ++-- internal/config/config.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/api/chainsync.go b/internal/api/chainsync.go index 80d98e8..ea81b82 100644 --- a/internal/api/chainsync.go +++ b/internal/api/chainsync.go @@ -36,8 +36,8 @@ func configureChainSyncRoutes(apiGroup *gin.RouterGroup) { } type requestChainSyncSync struct { - Slot uint64 `form:"slot"` Hash string `form:"hash"` + Slot uint64 `form:"slot"` Tip bool `form:"tip"` } diff --git a/internal/api/localstatequery.go b/internal/api/localstatequery.go index 116f2cc..39c8aa2 100644 --- a/internal/api/localstatequery.go +++ b/internal/api/localstatequery.go @@ -36,8 +36,8 @@ func configureLocalStateQueryRoutes(apiGroup *gin.RouterGroup) { } type responseLocalStateQueryCurrentEra struct { - Id uint8 `json:"id"` Name string `json:"name"` + Id uint8 `json:"id"` } // handleLocalStateQueryCurrentEra godoc @@ -149,10 +149,10 @@ func handleLocalStateQuerySystemStart(c *gin.Context) { type responseLocalStateQueryTip struct { Era string `json:"era"` + Hash string `json:"hash"` EpochNo int `json:"epoch_no"` BlockNo int64 `json:"block_no"` Slot uint64 `json:"slot_no"` - Hash string `json:"hash"` } // handleLocalStateQueryTip godoc diff --git a/internal/config/config.go b/internal/config/config.go index 914f4a2..919901b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -34,8 +34,8 @@ type Config struct { } type LoggingConfig struct { - Healthchecks bool `yaml:"healthchecks" envconfig:"LOGGING_HEALTHCHECKS"` Level string `yaml:"level" envconfig:"LOGGING_LEVEL"` + Healthchecks bool `yaml:"healthchecks" envconfig:"LOGGING_HEALTHCHECKS"` } type ApiConfig struct { @@ -55,13 +55,13 @@ type MetricsConfig struct { type NodeConfig struct { Network string `yaml:"network" envconfig:"CARDANO_NETWORK"` - NetworkMagic uint32 `yaml:"networkMagic" envconfig:"CARDANO_NODE_NETWORK_MAGIC"` Address string `yaml:"address" envconfig:"CARDANO_NODE_SOCKET_TCP_HOST"` + SocketPath string `yaml:"socketPath" envconfig:"CARDANO_NODE_SOCKET_PATH"` Port uint `yaml:"port" envconfig:"CARDANO_NODE_SOCKET_TCP_PORT"` QueryTimeout uint `yaml:"queryTimeout" envconfig:"CARDANO_NODE_SOCKET_QUERY_TIMEOUT"` - SkipCheck bool `yaml:"skipCheck" envconfig:"CARDANO_NODE_SKIP_CHECK"` - SocketPath string `yaml:"socketPath" envconfig:"CARDANO_NODE_SOCKET_PATH"` Timeout uint `yaml:"timeout" envconfig:"CARDANO_NODE_SOCKET_TIMEOUT"` + NetworkMagic uint32 `yaml:"networkMagic" envconfig:"CARDANO_NODE_NETWORK_MAGIC"` + SkipCheck bool `yaml:"skipCheck" envconfig:"CARDANO_NODE_SKIP_CHECK"` } type UtxorpcConfig struct {