Skip to content

fix(view): small upgrade fixes - #2414

Merged
mbrandenburger merged 2 commits into
hyperledger-labs:mainfrom
mbrandenburger:fix/2408-small-upgrade-fixes
Oct 30, 2026
Merged

mbrandenburger merged 2 commits into
hyperledger-labs:mainfrom
mbrandenburger:fix/2408-small-upgrade-fixes

Conversation

@mbrandenburger

@mbrandenburger mbrandenburger commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

The HTTP view API ignores unknown JSON fields, version prints the FSC version, the application and the VCS revision, and the v0.13 to v0.26 upgrade guide is in git and linked from docs/README.md.

Fixes #2408

Differences from the issue

Build info stays inside node/version. The issue proposes an exported pkg/node/buildinfo with Info and Read() behind sync.OnceValue. Its only caller is the version command, which reads the build info once per process, so this PR keeps buildInfo, fromBuildInfo and format unexported in node/version and adds no public API. They can move to an exported package when a second binary (e.g. Panurus' tokengen) needs them.
A replaced FSC module reports the replacement's version. A replace pointing at a versioned fork prints the fork's version. Only a local-directory replace or a missing build info prints (devel). A binary without build info prints Application: unknown.

Changes

  • web/service.go, client/http.go and wsproto/wsproto.go decode with protojson.UnmarshalOptions{DiscardUnknown: true}. These are the only protojson decode sites, and both stream ends go through wsproto.Read. Signatures and the replay guard work on the binary Command bytes and are unaffected. The package docs of web and wsproto and docs/platform/view/services/view-service-http.md say so.
  • docs/agents/conventions.md: a field with security meaning goes into a new command type, never into an existing view-API message, because an older server would accept the message and ignore the field.
  • node/version: GetInfo() keeps its three lines and appends FSC version, Application and Revision ((modified) for a dirty tree, unknown without VCS info). docs/reference/node-cli.md shows the six-line output.
  • docs/upgrade/v0.13-to-v0.26.md is added. Its relative links resolve, and it does not call v0.26 the latest release, so it stays correct after v0.27. docs/README.md gains an "Upgrading" section that links it and says that a node or database older than v0.26.0 is upgraded to v0.26.x first.

Tests

  • TestProcessCommandHandlerIgnoresUnknownFields, TestHTTPTransportIgnoresUnknownResponseFields and TestReadIgnoresUnknownFields fail on main with 400 / unknown field "futureField".
  • TestFromBuildInfo covers a dependency, a dependency replaced by a local directory and by a fork, FSC as the main module with and without a version, and missing build info. TestFormat checks the unchanged prefix, the new lines, (modified), and the (devel) and unknown fallbacks.
  • A binary built from this branch prints the real FSC pseudo-version and revision.
  • make checks and make unit-tests-root pass.

Panurus

Not affected. Panurus main pins FSC v0.26.0. It uses the view client's HTTP transport (viewclient.NewClient with TransportHTTP, in integration/nwo/runner/rpc), whose API is unchanged; that client now also accepts responses with unknown fields. Panurus does not import node/version or wsproto, and does not parse FSC's version output.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Hey @mbrandenburger 👋 thanks for the PR!
I'm your friendly PR Helper Bot 🤖 and I'll be riding shotgun on this one, keeping track of your PR's status to help you get it approved and merged.

This comment updates automatically as you push changes -- think of it as your PR's live scoreboard!
Here's the latest:


PR Checks

✅ DCO Sign-off -- All commits have valid sign-offs. Nice work!


❌ GPG Signature -- Heads up! The following commits don't have a verified GPG signature:

  • e03ffb1 fix(view): small upgrade fixes
  • 50e936b fixup! fix(view): small upgrade fixes

You'll need to sign your commits with GPG (e.g. git commit -S). See the Signing Guide for a step-by-step walkthrough.


✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing!


✅ Issue Link -- Linked to #2408 (assigned to you).


⏳ All checks must pass before this PR can be reviewed. You've got this!

@github-actions github-actions Bot added the status: needs revision The pull request requires changes from the author before it can be reviewed or merged label Oct 30, 2026
@mbrandenburger mbrandenburger added this to the 26Q4 milestone Oct 30, 2026
@adecaro
adecaro self-requested a review October 30, 2026 13:12

@adecaro adecaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

Though the package pkg/node/buildinfo mentioned in the Issue is not there.
You might want to double check that.

@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@mbrandenburger

Copy link
Copy Markdown
Member Author

Though the package pkg/node/buildinfo mentioned in the Issue is not there. You might want to double check that.

Thanks @adecaro ! That's on purpose; see "Differences from the issue" in the description.

@mbrandenburger
mbrandenburger enabled auto-merge (squash) October 30, 2026 13:27
The HTTP view API decodes protojson with DiscardUnknown on the server handler, the HTTP client and the WebSocket framing (wsproto), so nodes and clients of different versions interoperate when a view-API message gains a field, as on gRPC. Signatures cover the binary Command bytes and are unaffected. docs/agents/conventions.md states the rule that follows: a field with security meaning goes into a new command type, never into an existing message.

`version` also prints the FSC version, the application module and version, and the VCS revision, read from the build info Go embeds in the binary. A replaced FSC module reports the replacement's version, or (devel) for a local directory.

The v0.13 to v0.26 upgrade guide is in docs/upgrade/ and linked from docs/README.md, which says that a node or database older than v0.26.0 is upgraded to v0.26.x first.

Fixes hyperledger-labs#2408

Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
@mbrandenburger
mbrandenburger force-pushed the fix/2408-small-upgrade-fixes branch from 4e70d47 to 50e936b Compare October 30, 2026 13:27
@mbrandenburger
mbrandenburger merged commit dc30216 into hyperledger-labs:main Oct 30, 2026
43 of 45 checks passed
@mbrandenburger
mbrandenburger deleted the fix/2408-small-upgrade-fixes branch October 30, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs revision The pull request requires changes from the author before it can be reviewed or merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View API ignores unknown fields; version prints build info; upgrade guides in git

2 participants