[#1057] Pipe zainod's binary version into LightdInfo#1061
Merged
Conversation
a7af7b5 to
260cf42
Compare
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>
260cf42 to
ef886d8
Compare
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>
Contributor
|
utACK (I cant test locally at the moment #1073 ) |
zancas
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
own CARGO_PKG_VERSION for direct callers and tests.
Future zainod bumps now flow onto the wire automatically.
Fixes #1057