Repository navigation
Conversation
This branch has not been deployed
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.
Motivation
linera-version/api-hashes.jsonhas not changed since #2347 (2024-08-03), even though the WIT files, the GraphQL schema and the RPC snapshot have all changed since — this branch andmainship the same three hashes despite having different WIT files. Two things kept it that way:tests/up_to_date.rscomparesVersionInfo::get()againstVersionInfo::default(). The latter is baked in bybuild.rs, which calls the sametrace_get, so in a workspace checkout both sides are computed from the live files and the file is never consulted. The test cannot fail.cargo run -p linera-version > linera-version/api-hashes.json, truncates the file before the binary starts, andtrace_getreads it eagerly, so regenerating fails withJSON error: EOF while parsing a value at line 1 column 0.The file is what a published crate reports, since
cargo metadataresolves it standalone there, without the sibling packages the hashes are computed from.VersionInfo::is_compatible_withcomparesapi_hashes()before falling back to semver, so stale values let two registry builds with different APIs consider each other compatible.Proposal
tests/up_to_date.rs.check-outdated-api-hashesCI job, in the style ofcheck-outdated-cli-md.Relationship to #6818. On
mainthe mechanism is being removed instead: the hashes becomeOption, absent when they cannot be computed, and the file is deleted — because in the only situation that reads it, the recorded hashes are a constant of the release and therefore carry nothing thatcrate_versiondoes not. That change alters the BCS encoding ofRpcMessage::VersionInfoResponseand flips the RPC hash, which is not acceptable on a deployed network in a patch release. So this branch keeps the file and only makes it correct and verified; this is the terminal state for the 0.15 line.Test Plan
cargo test -p linera-versionfails on the stale file before the refresh, reporting all three hashes, and passes after it.cargo run -p linera-version > linera-version/api-hashes.jsonnow succeeds and is idempotent; before this change it failed on the truncated file.diff linera-version/api-hashes.json <(cargo run --locked -p linera-version), exits 0 on this branch.linera-rpc's format snapshot is untouched.cargo fmt(pinned nightly-2025-04-03),cargo clippy --all-targets --all-features -p linera-versionandtaplo fmt --checkare clean under Rust 1.86.Release Plan
Links
main.🤖 Generated with Claude Code