Skip to content

[#1057] Pipe zainod's binary version into LightdInfo#1061

Merged
zancas merged 4 commits intodevfrom
fix-version-reported
Apr 28, 2026
Merged

[#1057] Pipe zainod's binary version into LightdInfo#1061
zancas merged 4 commits intodevfrom
fix-version-reported

Conversation

@pacu
Copy link
Copy Markdown
Contributor

@pacu pacu commented Apr 26, 2026

Problem

LightdInfo.version reports v0.1.0 even when running zainod 0.2.0.

The field was sourced from zaino-state's CARGO_PKG_VERSION (via build.rs → env!("VERSION")). #939
decoupled library versions from zainod's, and #1024 removed workspace.package.version entirely — so
the wire kept reporting the library version.

Re-coupling isn't an option: the release ADR mandates per-crate independent versioning. The wire
must follow the deployed binary.

Fix

Thread the binary version through at the config boundary:

  • StateServiceConfig / FetchServiceConfig gain indexer_version: String, defaulting to the library's
    own CARGO_PKG_VERSION for direct callers and tests.
  • zainod's TryFrom impls overwrite it with env!("CARGO_PKG_VERSION").
  • get_build_info takes the version as a parameter; both spawn sites pass config.indexer_version.

Future zainod bumps now flow onto the wire automatically.

Fixes #1057

  PR description (wrapped at 80 cols):

  ## Problem

  `LightdInfo.version` reports `v0.1.0` even when running `zainod 0.2.0`.

  The field was sourced from `zaino-state`'s `CARGO_PKG_VERSION` (via
  `build.rs` -> `env!("VERSION")`). #939 decoupled library versions from
  `zainod`'s, and #1024 removed `workspace.package.version` entirely -- so
  the wire kept reporting the library version.

  Re-coupling isn't an option: the release ADR mandates per-crate
  independent versioning. The wire must follow the deployed binary.

  ## Fix

  Thread the binary version through at the config boundary:

  - `StateServiceConfig` / `FetchServiceConfig` gain `indexer_version:
    String`, defaulting to the library's own `CARGO_PKG_VERSION` for
    direct callers and tests.
  - `zainod`'s `TryFrom<ZainodConfig>` impls overwrite it with
    `env!("CARGO_PKG_VERSION")`.
  - `get_build_info` takes the version as a parameter; both `spawn` sites
    pass `config.indexer_version`.

  Future `zainod` bumps now flow onto the wire automatically.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@pacu pacu force-pushed the fix-version-reported branch from 260cf42 to ef886d8 Compare April 26, 2026 23:59
idky137
idky137 previously approved these changes Apr 27, 2026
Copy link
Copy Markdown
Contributor

@idky137 idky137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

zancas added 3 commits April 27, 2026 08:22
  StateServiceConfig and FetchServiceConfig duplicated 9 of their fields
  (rpc address, cookie path, user/password, service, storage, network,
  donation address, indexer_version) and the duplication had already bred
  copy-paste drift, including the indexer_version doc block this branch
  exists to address.

  Introduces CommonBackendConfig holding the shared bits; both Service
  configs now compose it via a `common` field plus their backend-specific
  extras. Knock-on cleanups that fall out:

  - The two `From<*ServiceConfig> for BlockCacheConfig` impls collapse
    into one `From<CommonBackendConfig>` plus trivial delegators.
  - zainod's `TryFrom<ZainodConfig>` impls share a new `build_common`
    helper, so the "xxxxxx" missing-credentials sentinel and
    `env!("CARGO_PKG_VERSION")` are written once instead of twice.
  - The "authentification" doc-comment typo is fixed in passing on the
    new shared struct.

  Both `new()` constructor signatures are preserved, so the integration
  tests that call them positionally keep compiling without churn.

  Adds `state_and_fetch_common_payloads_agree` next to
  `indexer_version_is_zainod_pkg_version` to lock in the property the
  refactor establishes: both `TryFrom<ZainodConfig>` paths must produce
  the same `CommonBackendConfig`. Pretty-Debug equality is used so the
  assertion auto-covers any field added to the struct later.

  Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@idky137
Copy link
Copy Markdown
Contributor

idky137 commented Apr 28, 2026

utACK (I cant test locally at the moment #1073 )

@zancas zancas merged commit f931535 into dev Apr 28, 2026
28 checks passed
@zancas zancas deleted the fix-version-reported branch April 28, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zaino reports wrong (old) version

3 participants