Repository navigation
fix(view): small upgrade fixes - #2414
mbrandenburger merged 2 commits into
Conversation
|
Hey @mbrandenburger 👋 thanks for the PR! This comment updates automatically as you push changes -- think of it as your PR's live scoreboard! 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:
You'll need to sign your commits with GPG (e.g. ✅ 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! |
adecaro
left a comment
There was a problem hiding this comment.
LGTM.
Though the package pkg/node/buildinfo mentioned in the Issue is not there.
You might want to double check that.
|
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. |
Thanks @adecaro ! That's on purpose; see "Differences from the issue" in the description. |
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>
4e70d47 to
50e936b
Compare
Summary
The HTTP view API ignores unknown JSON fields,
versionprints the FSC version, the application and the VCS revision, and the v0.13 to v0.26 upgrade guide is in git and linked fromdocs/README.md.Fixes #2408
Differences from the issue
Build info stays inside
node/version. The issue proposes an exportedpkg/node/buildinfowithInfoandRead()behindsync.OnceValue. Its only caller is theversioncommand, which reads the build info once per process, so this PR keepsbuildInfo,fromBuildInfoandformatunexported innode/versionand 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
replacepointing 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 printsApplication: unknown.Changes
web/service.go,client/http.goandwsproto/wsproto.godecode withprotojson.UnmarshalOptions{DiscardUnknown: true}. These are the only protojson decode sites, and both stream ends go throughwsproto.Read. Signatures and the replay guard work on the binaryCommandbytes and are unaffected. The package docs ofwebandwsprotoanddocs/platform/view/services/view-service-http.mdsay 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 appendsFSC version,ApplicationandRevision((modified)for a dirty tree,unknownwithout VCS info).docs/reference/node-cli.mdshows the six-line output.docs/upgrade/v0.13-to-v0.26.mdis added. Its relative links resolve, and it does not call v0.26 the latest release, so it stays correct after v0.27.docs/README.mdgains 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,TestHTTPTransportIgnoresUnknownResponseFieldsandTestReadIgnoresUnknownFieldsfail onmainwith 400 /unknown field "futureField".TestFromBuildInfocovers 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.TestFormatchecks the unchanged prefix, the new lines,(modified), and the(devel)andunknownfallbacks.make checksandmake unit-tests-rootpass.Panurus
Not affected. Panurus
mainpins FSC v0.26.0. It uses the view client's HTTP transport (viewclient.NewClientwithTransportHTTP, inintegration/nwo/runner/rpc), whose API is unchanged; that client now also accepts responses with unknown fields. Panurus does not importnode/versionorwsproto, and does not parse FSC'sversionoutput.