Skip to content

feat: canister logs extensions - #252

Open
mraszyk wants to merge 20 commits into
mainfrom
mraszyk/canister-logs
Open

feat: canister logs extensions#252
mraszyk wants to merge 20 commits into
mainfrom
mraszyk/canister-logs

Conversation

@mraszyk

@mraszyk mraszyk commented May 13, 2026

Copy link
Copy Markdown
Contributor

Canister logs extensions:

  • New canister setting log_memory_limit bounding the memory used for canister logs: it must be either 0
    or a number between 4096 and 2097152 (2 MiB), inclusively, with the default value 4096.
    The oldest canister logs are purged if the total memory used for canister logs exceeds this value.
    The memory used by the store holding the canister logs is determined by this setting
    (it does not depend on the canister logs actually stored) and counted in the canister's memory usage.
    Hence, raising this setting might require reserving cycles. Changing this setting also resizes
    the store holding the canister logs, which consumes cycles.
    The setting is reset if the canister runs out of cycles.
  • canister_status returns the setting log_memory_limit and the memory used by the store holding
    the canister logs in the new field log_memory_store_size of memory_metrics.
  • fetch_canister_logs can also be called by canisters via replicated (update) calls.
    It still cannot be called by external users via replicated calls.
  • New optional filter argument of fetch_canister_logs restricting the returned logs to a range of
    log indices (by_idx) or timestamps (by_timestamp_nanos).
  • The total size of all logs returned by fetch_canister_logs is bounded by an implementation-defined
    constant chosen so as not to exceed the maximum response size (instead of the previous bound of 4KiB).
    If the selected logs do not all fit, an unfiltered read trims the oldest logs (so the response ends
    with the newest log) and a filtered read trims the newest logs (so the response starts with the oldest
    log satisfying the filter).

@github-actions github-actions Bot added the interface-spec Changes to the IC interface specification label May 13, 2026
@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown

🤖 Here's your preview: https://kwnd6-zaaaa-aaaam-ai7va-cai.icp0.io

marc0olo added a commit that referenced this pull request Jun 18, 2026
## Summary

Bumps pinned source submodules and updates docs to match. Driven by the
icp-cli v1.0.0 release.

### Submodule bumps
- `icp-cli` v0.3.1 → **v1.0.0** (`.sources/VERSIONS` updated)
- `icp-cli-recipes`, `icp-cli-templates`, `icskills` → latest `main`
- `icp-js-sdk-docs` already at tip

### icp-cli v1.0.0
- `--set-controller` was removed; `settings.mdx` now uses
`--remove-all-controllers` combined with `--add-controller`.

### Motoko recipe v5.0.0
The recipe now compiles via `mops build`, so the source file, Candid
file, and compiler args move from the recipe `configuration:` block into
`mops.toml`. Updated in `project-structure.mdx`, `candid.mdx`,
`optimization.md`, and `ethereum.mdx`. The GC-options example now shows
a real legacy-persistence alternative (`--legacy-persistence` +
`--compacting-gc`) rather than the now-default `--incremental-gc`.

### Latest recipes
- Rust recipe pins → **v3.3.0**; redundant `package` dropped where it
equals the canister name (v3.3.0 defaults it), with an explanatory note
kept in the getting-started page.
- asset-canister `v2.2.1` and prebuilt `v2.0.0` already current.

### Mainnet domain → `icp.net` / `id.ai`
The icp-cli mainnet **HTTP gateway** domain is now `icp.net` (was
`icp0.io`). Browser/canister-access URLs, `raw.*` domains, the
`custom-domains/v1/` API, live canister links, and the NNS app
(`nns.ic0.app` → `nns.icp.net`) were updated across the docs (all
verified resolving). The Internet Identity service link now points to
its canonical `https://id.ai`.

Deliberately left unchanged (these are not the gateway):
- JS `HttpAgent` / agent API hosts — the **API** endpoint is
`icp-api.io`/`icp0.io`, separate from the gateway.
- The Internet Identity `icp0.io` ↔ `ic0.app` delegation-rewriting
behavior.
- The verifiable-credentials `iss` (issuer) claim — a protocol
identifier that must match what II signs (already flagged for human
verification).

Reconciling the icskills to `icp.net` is tracked in
dfinity/icskills#224.

### Other
- Fixed a pre-existing broken link in `edge-infrastructure.md`
(`http-gateway-spec.md` → `http-gateway-protocol-spec.md`) surfaced by
validation, plus minor lint cleanup (em-dash, `mo:base` reference) in
files touched here.

## Notes
- `npm run build` and `scripts/validate.js` both pass (209 pages).
- Changes were reviewed by a subagent against `.sources/` with no
must-fix findings.
- ⚠️ Possible merge conflict with #252 (also edits `settings.mdx`, in a
different section).
mraszyk and others added 14 commits July 17, 2026 08:45
Emphasize that an unfiltered fetch_canister_logs read trims the oldest
records (response ends with the newest record) while a filtered read
trims the newest records (response starts with the oldest matching
record). Bound the trimming by an unspecified max response size.

Also drop the stale duplicate "Canister logs (query call)" section
re-introduced by the merge from main, which carried a duplicate anchor
and pre-filter semantics.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Values between 1 and 4095 (inclusive) are not allowed.
…act model

definite_canister_settings in ic.did declares log_memory_limit, so the
record produced by canister_status must provide it.
…stract model

The record produced by canister_status omitted log_visibility,
snapshot_visibility, and status_visibility although
definite_canister_settings in ic.did declares all three.
# Conflicts:
#	docs/references/ic-interface-spec/abstract-behavior.md
#	docs/references/ic-interface-spec/management-canister.md
@mraszyk
mraszyk marked this pull request as ready for review August 31, 2026 20:16
@mraszyk
mraszyk requested review from a team as code owners August 31, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interface-spec Changes to the IC interface specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant