Skip to content

chore(ckbtc/ckdoge): DEFI-3048: use the shared ICRC-21 consent message argument helpers - #12103

Open
mbjorkqvist wants to merge 1 commit into
masterfrom
mathias/DEFI-3048-minters-shared-consent-decoding
Open

mbjorkqvist wants to merge 1 commit into
masterfrom
mathias/DEFI-3048-minters-shared-consent-decoding

Conversation

@mbjorkqvist

Copy link
Copy Markdown
Contributor

Why

#12072 bounded Candid decoding in the ICRC-21 consent message endpoints of the ckBTC and ckDOGE minters with minter-local copies of the argument size check and decoder configuration. #12078 has since added shared helpers for this to icrc-ledger-types, which the ICP and ICRC ledgers use.

What

  • Switch both minters to validate_consent_message_arg_size and decode_consent_message_arg, so the size limit and the skipping quota are defined in one place. The behavior is unchanged.
  • Adapt the existing tests to the shared helpers.

🤖 Generated with Claude Code

…e argument helpers

Replace the minters' own size check and Candid decoder configuration for
the ICRC-21 consent message argument with validate_consent_message_arg_size
and decode_consent_message_arg from icrc-ledger-types, so the limits live
in one place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the ckBTC and ckDOGE consent-message helper consolidation.

No open issues 🎉

What changed in this PR

This PR consolidates ICRC-21 consent-message argument handling in the ckBTC and ckDOGE minters using the shared icrc-ledger-types helpers introduced in #12078, preserving the decoding protections added in #12072.

Changes:

  • Replace duplicated argument-size checks and decoder configuration with shared helpers.
  • Update both minters’ skipping-quota regression tests to use the shared decoder.
File Description
rs/​dogecoin/​ckdoge/​minter/​src/​updates/​tests.rs Update ckDOGE quota tests to use the shared decoder.
rs/​dogecoin/​ckdoge/​minter/​src/​updates/​icrc21.rs Use shared size-validation and decoding helpers in ckDOGE.
rs/​bitcoin/​ckbtc/​minter/​src/​updates/​tests.rs Update ckBTC quota tests to use the shared decoder.
rs/​bitcoin/​ckbtc/​minter/​src/​updates/​icrc21.rs Use shared size-validation and decoding helpers in ckBTC.

Review effort: Balanced

@mbjorkqvist
mbjorkqvist marked this pull request as ready for review November 14, 2026 09:39
@mbjorkqvist
mbjorkqvist requested a review from a team as a code owner November 14, 2026 09:39
@github-actions github-actions Bot added the @defi label Nov 14, 2026
@zeropath-ai

zeropath-ai Bot commented Nov 14, 2026

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to f4e3c09.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/bitcoin/ckbtc/minter/src/updates/icrc21.rs
    Replace manual argument size check with validate_consent_message_arg_size; use decode_consent_message_arg for decoding RetrieveBtcWithApprovalArgs; remove decoder_config usage
Enhancement ► rs/bitcoin/ckbtc/minter/src/updates/tests.rs
    Update tests to use decode_consent_message_arg and remove decoder_config import; include decode_consent_message_arg in imports
Enhancement ► rs/dogecoin/ckdoge/minter/src/updates/icrc21.rs
    Replace manual argument size check with validate_consent_message_arg_size; use decode_consent_message_arg for decoding RetrieveDogeWithApprovalArgs; remove decoder_config usage
Enhancement ► rs/dogecoin/ckdoge/minter/src/updates/tests.rs
    Update tests to use decode_consent_message_arg and remove decoder_config import; include decode_consent_message_arg in imports

@zeropath-ai

zeropath-ai Bot commented Nov 14, 2026

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to f4e3c09.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/bitcoin/ckbtc/minter/src/updates/icrc21.rs
    Replace manual argument size check with validate_consent_message_arg_size; use decode_consent_message_arg for decoding RetrieveBtcWithApprovalArgs; remove decoder_config usage
Enhancement ► rs/bitcoin/ckbtc/minter/src/updates/tests.rs
    Update tests to use decode_consent_message_arg and remove decoder_config import; include decode_consent_message_arg in imports
Enhancement ► rs/dogecoin/ckdoge/minter/src/updates/icrc21.rs
    Replace manual argument size check with validate_consent_message_arg_size; use decode_consent_message_arg for decoding RetrieveDogeWithApprovalArgs; remove decoder_config usage
Enhancement ► rs/dogecoin/ckdoge/minter/src/updates/tests.rs
    Update tests to use decode_consent_message_arg and remove decoder_config import; include decode_consent_message_arg in imports

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants