Skip to content

fix(ckbtc/ckdoge): destructure init args#9108

Merged
mducroux merged 6 commits intomasterfrom
mducroux/fix-ckdoge-minter-init-args
Mar 3, 2026
Merged

fix(ckbtc/ckdoge): destructure init args#9108
mducroux merged 6 commits intomasterfrom
mducroux/fix-ckdoge-minter-init-args

Conversation

@mducroux
Copy link
Copy Markdown
Contributor

@mducroux mducroux commented Mar 2, 2026

Previously, the field max_num_inputs_in_transaction in the ckBTC / ckDOGE minter state would always be set to DEFAULT_MAX_NUM_INPUTS_IN_TRANSACTION and the value in the init arg would be ignored. This PR fixes this issue and destructures the init args to ensure that all fields are explicitly handled, preventing future fields from being silently ignored.

Changes in this PR include:

  • utxo_consolidation_threshold and max_num_inputs_in_transaction now read from InitArgs. Before these fields were always hardcoded to DEFAULT_UTXO_CONSOLIDATION_THRESHOLD / DEFAULT_MAX_NUM_INPUTS_IN_TRANSACTION, ignoring the InitArgs values entirely.
  • check_fee now falls back to kyt_fee. Before only check_fee was considered. Now: check_fee falls back to kyt_fee before the default. This is consistent with the upgrade and reinit methods.
  • Add const DOGECOIN_MAX_NUM_INPUTS_IN_TRANSACTION set to 500.

The behaviour of init is now similar to upgrade / reinit. The only difference is that the upgrade and reinit paths enforce that utxo_consolidation_threshold > max_num_inputs_in_transaction, rejecting invalid values with a log message. The init path does not enforce this constraint (it is unclear why this contraint is here in the first place).

@github-actions github-actions Bot added the fix label Mar 2, 2026
@mducroux mducroux requested review from gregorydemay and ninegua March 2, 2026 13:31
@mducroux mducroux marked this pull request as ready for review March 2, 2026 13:31
@mducroux mducroux requested a review from a team as a code owner March 2, 2026 13:31
@github-actions github-actions Bot added the @defi label Mar 2, 2026
Copy link
Copy Markdown
Contributor

@gregorydemay gregorydemay left a comment

Choose a reason for hiding this comment

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

Thanks @mducroux for the quick fix!

Comment thread rs/bitcoin/ckbtc/minter/src/state.rs Outdated
@mducroux mducroux enabled auto-merge March 3, 2026 14:58
@mducroux mducroux changed the title fix(ckdoge): destructure init args to ensure all args are taken into account fix(ckbtc/ckdoge): destructure init args Mar 3, 2026
@mducroux mducroux disabled auto-merge March 3, 2026 14:59
@mducroux mducroux enabled auto-merge March 3, 2026 14:59
@mducroux mducroux added this pull request to the merge queue Mar 3, 2026
Merged via the queue into master with commit 042becb Mar 3, 2026
40 checks passed
@mducroux mducroux deleted the mducroux/fix-ckdoge-minter-init-args branch March 3, 2026 15:32
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