Skip to content

feat(icrc1): add ICRC-154 pause/unpause/deactivate ledger endpoints#9510

Draft
bogwar wants to merge 3 commits intoicrc-124-3-rosettafrom
icrc-124-4-endpoints
Draft

feat(icrc1): add ICRC-154 pause/unpause/deactivate ledger endpoints#9510
bogwar wants to merge 3 commits intoicrc-124-3-rosettafrom
icrc-124-4-endpoints

Conversation

@bogwar
Copy link
Contributor

@bogwar bogwar commented Mar 20, 2026

Summary

  • Add ICRC-154 Candid arg/error types (PauseArgs, UnpauseArgs, DeactivateArgs and corresponding error enums) in icrc-ledger-types
  • Add paused/deactivated persistent state to the Ledger struct with accessor/setter methods
  • Add 3 update endpoints (icrc154_pause, icrc154_unpause, icrc154_deactivate) that create ICRC-124 blocks and update ledger state, authorized via is_controller()
  • Add 2 query endpoints (icrc154_is_paused, icrc154_is_deactivated) for state inspection
  • Add pause guard to icrc1_transfer, icrc2_approve, and icrc2_transfer_from that returns GenericError when the ledger is paused or deactivated
  • Register ICRC-154 in supported standards and 124pause/124unpause/124deactivate in supported block types
  • Update .did file with new types and service methods
  • Update state machine test assertions for new standards and block types

Stacked on #9488 (PR 3: Rosetta support)

Test plan

  • cargo clippy passes for icrc-ledger-types and ic-icrc1-ledger
  • Candid interface compatibility test passes (check_candid_interface)
  • ledger_unit_test passes
  • ledger_canister_test passes
  • ledger_test and ledger_test_u256 pass (including updated supported standards/block types assertions)
  • upgrade_downgrade and upgrade_downgrade_u256 pass (serde defaults ensure backward compatibility)
  • icrc1_unit_test passes
  • icrc-ledger-types tests pass

🤖 Generated with Claude Code

Add the actual ICRC-154 endpoints so the ledger can create pause,
unpause, and deactivate blocks in response to controller calls.
Includes query methods for state inspection and a pause guard that
blocks transfers and approvals when the ledger is paused or deactivated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ICRC-154 pause/unpause/deactivate management endpoints to the ICRC-1 ledger canister, including persisted paused/deactivated state and corresponding type/interface updates, and updates state-machine assertions for supported standards and block types.

Changes:

  • Introduces icrc154_pause, icrc154_unpause, icrc154_deactivate update calls (controller-only) plus icrc154_is_paused / icrc154_is_deactivated query calls, and records these actions as ICRC-124 block types.
  • Persists paused and deactivated flags in Ledger state and gates icrc1_transfer, icrc2_approve, and icrc2_transfer_from when paused/deactivated.
  • Extends icrc-ledger-types with ICRC-154 Candid args/errors and updates the .did interface + SM tests for new supported standard and block types.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rs/ledger_suite/tests/sm-tests/src/lib.rs Updates expected supported standards and ICRC-3 supported block types to include ICRC-154 / 124pause/124unpause/124deactivate.
rs/ledger_suite/icrc1/ledger/src/main.rs Adds pause/deactivate guard to transfers/approvals, registers ICRC-154 + block types, and implements new ICRC-154 endpoints.
rs/ledger_suite/icrc1/ledger/src/lib.rs Adds persisted paused/deactivated flags with accessors/mutators and initializes defaults for upgrade compatibility.
rs/ledger_suite/icrc1/ledger/ledger.did Adds ICRC-154 types and service methods to the public Candid interface.
packages/icrc-ledger-types/src/lib.rs Exposes a new icrc154 module.
packages/icrc-ledger-types/src/icrc154/mod.rs Defines ICRC-154 args and error enums for Candid/serde.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bogwar and others added 2 commits March 20, 2026 13:58
The archive canister doesn't advertise 124 block types, only the ledger
does. Split the check so archive tests can opt out of expecting them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…fields

The new fields on the Ledger struct slightly increase serialization
cost during upgrades.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants