This repository was archived by the owner on Nov 25, 2026. It is now read-only.
Repository navigation
fix!: make committing a proposed batch atomic - #4551
Merged
Merged
Conversation
propose_commit_batch now clears any evidence previously computed for the batch, and commit_proposed_batch clears it when it takes the proposed arguments. Since commit_proposed_batch can span several messages, a failure after the first one leaves the batch in place without its arguments; its evidence must not validate arguments proposed for it afterwards. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
commit_proposed_batch no longer awaits self-calls to extend its instruction budget. A failure after an await rolled back only the failing message, leaving the operations applied before it live and certified_data stale. Committing in one message makes the commit all-or-nothing again, as it was before 0.30.2, at the cost of bounding a proposed batch by the per-message instruction limit. commit_batch keeps the extension. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ShellCheck 0.11.0 (now on ubuntu-latest) split unused-function warnings out of SC2317 into the new SC2329, which flags the unused warn() helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
✅ No security or compliance issues detected. Reviewed 3 of 7 changed files (4 skipped) up to 26a99a7. Security Overview
Detected Code Changes
|
There was a problem hiding this comment.
🟡 Changes recommended
The regression test clears evidence before re-proposing, so it cannot detect missing proposal-time invalidation and needs a case that starts with stale computed evidence.
1 open issue
What changed in this PR
This PR restores atomic commits for proposed asset batches, preventing failed commits from leaving partial changes live or certification data inconsistent.
Changes:
- Run
commit_proposed_batchsynchronously in one message;commit_batchretains self-call extension. - Clear computed evidence when proposed arguments are replaced or taken, with regression coverage.
- Document the breaking Rust API change and per-message instruction limit.
| File | Description |
|---|---|
src/canisters/frontend/ic-certified-assets/src/tests.rs |
Adds a regression test for stale evidence after re-proposal. |
src/canisters/frontend/ic-certified-assets/src/state_machine/mod.rs |
Clears evidence when proposed arguments change or are taken. |
src/canisters/frontend/ic-certified-assets/src/lib.rs |
Makes proposed-batch commits synchronous and single-message. |
src/canisters/frontend/ic-certified-assets/CHANGELOG.md |
Records the API change and evidence invalidation fix. |
docs/design/asset-canister-interface.md |
Documents rollback guarantees and commit size constraints. |
CHANGELOG.md |
Describes user-facing behavior changes and updates the frontend module hash. |
Review effort: Balanced
raymondk
approved these changes
Nov 24, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Description
Two changes to how the asset canister commits a proposed batch.
1. Commit a proposed batch in a single message. Since #4450,
commit_proposed_batchawaits a self-call once it passes 35B instructions, and setscertified_dataonly after the last operation. If an operation fails after such an await, only the failing message rolls back: the operations applied before it stay live, and the certified tree no longer matchescertified_datauntil the next successful commit.commit_proposed_batchnow runs the state machine to completion within one message, so any failure, including running out of instructions, rolls back the whole commit, as before 0.30.2. The cost is that a proposed batch is again bounded by the per-message instruction limit.commit_batchkeeps the self-call extension.This changes
ic_certified_assets::commit_proposed_batchfromasync fntofn(breaking for direct callers of the crate); the Candid interface is unchanged.2. Discard computed evidence when a batch's arguments change.
propose_commit_batchnow clears any evidence previously computed for the batch, andcommit_proposed_batchclears it when it takes the proposed arguments, so evidence always describes the arguments the batch currently holds and new arguments need a freshcompute_evidence.How Has This Been Tested?
evidence_does_not_carry_over_to_reproposed_argumentscovers change 2 (fails without it).ic-certified-assetslib tests pass; clippy is clean.src/distributed/assetstorage.wasm.gzrebuilt with./scripts/update-frontend-canister.sh --release-build.Checklist:
🤖 Generated with Claude Code