Skip to content

chore: sync static-site docs to dfinity/certified-assets 853c291 - #409

Merged
marc0olo merged 1 commit into
mainfrom
infra/sync-static-site-853c291
Sep 25, 2026
Merged

marc0olo merged 1 commit into
mainfrom
infra/sync-static-site-853c291

Conversation

@pr-automation-bot-public

Copy link
Copy Markdown
Contributor

Summary

Automated sync of the certified-assets user docs.

Ref: 853c291 (pinned from v0.4.0), dispatched by hand as 853c291.
A ref is synced by hand when a docs fix has shipped upstream but not
been released; the next release moves the pin back onto a tag.

Changed upstream files:

  • docs/how-it-works.md

  • Ran npm run sync:static-site, regenerating docs/guides/frontends/static-site/

  • Validator and build passed

Checklist

  • Review the page diffs for content changes
  • Check whether a behavior change contradicts our own Frontends pages (certification.md, asset-canister.md)
  • Check whether the recipe version named in icp.yaml examples needs bumping with it

@pr-automation-bot-public
pr-automation-bot-public Bot requested a review from a team as a code owner September 25, 2026 14:13
@marc0olo
marc0olo merged commit ae027cf into main Sep 25, 2026
8 checks passed
@marc0olo
marc0olo deleted the infra/sync-static-site-853c291 branch September 25, 2026 14:20
marc0olo added a commit that referenced this pull request Sep 28, 2026
## Summary

Both certification guides had claims that are wrong on current releases.
Every claim was checked against primary sources (the crates,
`@icp-sdk/core` 6.1.0, ic-gateway, the interface spec, icp-cli v1.5.0
`cli.md`), and every code block was compiled and run against a local
network. The skill side of the same fixes is dfinity/icskills#407.

**Wrong, now fixed:**
- **"Certified data is cleared on upgrade"** (5 places): it survives
upgrades (`abstract-behavior.md`, confirmed locally). What is lost is a
heap tree, so Rust rebuilds it in `post_upgrade`, and Motoko's
`CertTree.Store` needs no hook.
- **Header name:** `IC-Certificate-Expression` is really
`IC-CertificateExpression` (gateway spec, crate constant, served
headers).
- **`icp canister call … get` without `--query`:** icp-cli sends an
update call by default, so no certificate comes back.
- **Client verification code:** it did not type-check against
`@dfinity/certificate-verification` 4 (`Uint8Array`, not `ArrayBuffer`).
`lookupResultToBuffer` treated `Unknown` as absent; it now switches on
the `lookup_path` status. It also accepts bindgen's `undefined` for an
empty `opt` field, which it rejected as a false "key is absent" failure.
- **The "custom HTTP client" case** needs
`@dfinity/response-verification`, not `certificate-verification`. This
is now a "who verifies what" table (HTTP gateway, update calls, Candid
queries, raw hosts).
- **The `ic-asset-certification` example did not compile** (missing
`candid`, `404` needs `StatusCode`). Its uncertified 404 was rejected by
the gateway; it now uses a certified `404.html` fallback.
- **Rust example:** it lacked `export_candid!()`, so `icp deploy`
failed. It now uses `ic-certification` 4 / `ic-cdk` 0.20.
- **The single-value Motoko example never certified its initial value**,
so a query before the first write failed verification (certified data
starts empty).
- **Motoko `CertTree` example did not compile** (`CertTree.Ops` must be
`transient`). The deprecated `postupgrade` hook is removed, and `remove`
becomes `delete` to match the test commands.
- **`allow_raw_access: false`:** redirects with `308`, but `raw.icp.net`
lands on `<id>.icp0.io`, and only mainnet raw hosts are recognized.
- **Asset canister certified headers:** also `Cache-Control` (with
`max_age`) and `Content-Encoding`.
- **"Boundary node" wording:** the intro linked the API boundary nodes,
which verify nothing; both pages now say the HTTP gateway.
- **Root key:** `shouldFetchRootKey` is replaced by the `ic_env` cookie
/ `icp network status --json`.
- **Links:** the `js.icp.build` link is dropped (that site does not
document this package), and `certified-counter` (dfx, `fetchRootKey`) is
replaced by `motoko/cert-var`.

**After review:**
- The gateway guarantee is scoped to verifying hostnames.
- The two certification headers are described accurately (certificate
and witness vs CEL expression).
- `certified_data_set` is described as allowed in every replicated
context, per the spec.
- The raw-host row now says the gateway forwards the certificate without
checking it. The synced `static-site/how-it-works.md` has the same
wording; it is fixed upstream in dfinity/certified-assets#139 and
already synced to `main` in #409.

**Structural note:** the asset and Rust examples stay inline even though
they exceed the 30-line guideline, as before. They could move to
`dfinity/examples` with `#region` markers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant