Step 10: the release channel and the release signing tool #12
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #12"
general
weight: 0.35
b3hr4d
<!-- claude-projects-attribution: {"github_login":"b3hr4d"} -->
_Requested by Behrad · project thread_
Before: a release manifest was only a type in
candid/common.did. Nothing published releases, and nothing signed them.After: a release channel canister keeps signed wallet releases and serves them in 1 MiB chunks. A publisher stages a release's chunks, then publishes its manifest, and the channel refuses the manifest unless two of its three signer keys signed it ([decision 0004](docs/decisions/0004-release-signers.md), "2 of 3 keys") and every staged chunk matches its hash and together they are the Wasm the manifest names. Nothing of a release is served until then, and a published version never changes.
release-toolmakes a manifest from a Wasm, signs it with an Ed25519 key in PEM, checks it, and writes thepublish_chunkarguments that icp-cli sends. The README's new "Publishing a release" section is the whole flow.How:
crates/releaseholds the manifest, the hash its signers sign, and the form, signature and chunk checks, so the channel, the tool and later the wallet run the same code. A key counts once however often it signed, and a signature by another key or one that fails Ed25519's strict check counts for nothing. The channel stores its config, releases, publish order and chunks in four stable memories, listed indocs/design.md. Itsinspect_messagedrops publish messages from anyone but a publisher before they run, so a stranger's megabyte costs it no cycles, and a guard refuses the same calls from other canisters, which skip that check. An upgrade keeps the config or replaces it, so the signer keys can be rotated without touching published releases.tests/calleris a small canister that lets the PocketIC tests call as a canister. CI now lints and unit-tests every crate, builds the channel and caller Wasm next to the wallet's, and its PocketIC step includes the 100 MiB release, about 40 seconds more.Worth your review
ChannelArg(Initwith publishers, signer keys and threshold, orUpgradewith an optional new config).ChannelErrorlostNotPublisher(the guard rejects instead, as in the wallet) andUnknownVersion(a chunk of an unknown version answersnull), and gainedInvalid : text,MissingChunkandWasmMismatch.common.did: versions of 1 to 64 letters, digits and. + - _; at most 100 MiB, cut every 1 MiB so one Wasm has exactly one list of chunk hashes; at most 64tested_fromhashes; an httpsnotes_urlof at most 512 characters; at most 16 signatures and 16 signer keys.@icp-sdk/core) writes the test vector's manifest with its type table in another order, so its hash differs (73f087…against8bd9e0…). Signers must therefore sign withrelease-toolor thereleasecrate, and a test pins the bytes. OpenSSL signs the same signing hash to the same signature, byte for byte, so the keys themselves can live anywhere. A fixed byte layout instead of Candid would remove the dependence on one encoder, but it changes whatcommon.diddefines.pemfeature (pkcs8, der, spki, pem-rfc7468, base64ct, const-oid), to read keys fromopenssl genpkey. The canisters do not get it, and the wallet Wasm is byte-identical built alone or together with the channel.sha2now builds at opt-level 3 in release builds. SHA-256 drops from 127 to 75 instructions a byte, which brings publishing a 100 MiB release from 27.2 billion instructions to 16.4 billion, of the 40 billion an update may use. The wallet Wasm grows by 3.5 KB.latestis the release published last, not the highest version.releasecrate.Tests.
crates/release: 16 unit tests, with the signing hash's input bytes and output pinned, a property test that any changed byte fails the chunk check, and a check that a Wasm with bytes past its size is refused.release-tool: 6 unit tests and 8 that run the binary: two of three signers sign, a manifest for another Wasm, or for the same Wasm with bytes appended, is refused and the file left untouched, a signature by another key or over edited text counts for nothing, a 17th signature is refused, and bad input exits 2 with the usage. The channel's interface test checks all six methods and the install argument againstcandid/release_channel.did. 11 PocketIC tests send the channel the tool's own files: publishing by 2 of 3; refusing no signature, one signer, one signer twice, an unpinned key, a changed signature and a signature over another manifest; a wrong chunk, a missing one, a Wasm hash that does not match and chunks cut at another place; a published release that cannot change; out-of-form chunks and manifests; strangers dropped byinspect_messageand, calling through a canister, refused by the guard; bad install configs; upgrades that keep releases and rotate the signers; and a 100 MiB release.I injected 20 faults, one at a time, and each failed at least one test: a threshold of one, a key counted once per signature, any signature accepted, no chunk hash, size or Wasm hash check, no form check at publish, no guard, an
inspect_messagethat accepts everyone, staged chunks served, a published chunk or manifest replaced, extra chunks kept, an upgrade that ignores a new config, an install that takes a bad one, a changed interface, and in the tool, signing without the Wasm check or its size check, past 16 signatures, or with a chunk hash dropped from the text.The whole CI battery passes locally, the wallet's 106 unit and 55 PocketIC tests included, with the upgrade from
mainand regtest.By hand, on a local network with icp-cli 1.7.0, I ran the README's steps with three keys from
openssl genpkey: the channel answeredNotEnoughSignatures = record { have = 1; need = 2 }with one signature, published the wallet's own 3.7 MB Wasm with two, answeredAlreadyPublishedthe second time, refused the anonymous identity's chunk, and served four chunks whose SHA-256 is the Wasm's.🤖 Generated with Claude Code
https://claude.ai/code/session_013Vgh2De8Zarye1iDyGSRbe