Skip to content

Commit

Permalink
Update to 9a2466b1fd0da6a5187504613aeac02677b2f114
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Dec 10, 2024
1 parent 077696f commit a440514
Show file tree
Hide file tree
Showing 17 changed files with 9,662 additions and 3,056 deletions.
10,890 changes: 8,120 additions & 2,770 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ license = "Apache-2.0"
# ./scripts/point-to-ic-repo-commit-id.sh be used. That also updates the files
# in the candid directory. (This core would be unnecessary if this code also
# lived in the ic repo.)
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-management-canister-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ledger-canister = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-management-canister-types = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }
ledger-canister = { git = "https://github.com/dfinity/ic", rev = "9a2466b1fd0da6a5187504613aeac02677b2f114" }

candid = "0.10.2"
candid_parser = "0.1.2"
Expand Down
71 changes: 57 additions & 14 deletions candid/ckbtc_minter.did
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ type DefiniteCanisterSettings = record {
memory_allocation : nat;
compute_allocation : nat;
reserved_cycles_limit : nat;
log_visibility: LogVisibility;
wasm_memory_limit : nat;
};

type LogVisibility = variant {
controllers;
public;
};

type RetrieveBtcArgs = record {
Expand Down Expand Up @@ -92,17 +99,15 @@ type RetrieveBtcOk = record {
// The result of an [update_balance] call.
type UtxoStatus = variant {
// The minter ignored this UTXO because UTXO's value is too small to pay
// the KYT fees. This state is final, retrying [update_balance] call will
// have no effect on this UTXO.
// the check fees.
ValueTooSmall : Utxo;
// The KYT provider considered this UTXO to be tainted. This UTXO state is
// final, retrying [update_balance] call will have no effect on this UTXO.
// The Bitcoin checker considered this UTXO to be tainted.
Tainted : Utxo;
// The UTXO passed the KYT check, but the minter failed to mint ckBTC
// The UTXO passed the Bitcoin check, but the minter failed to mint ckBTC
// because the Ledger was unavailable. Retrying the [update_balance] call
// should eventually advance the UTXO to the [Minted] state.
Checked : Utxo;
// The UTXO passed the KYT check, and ckBTC has been minted.
// The UTXO passed the Bitcoin check, and ckBTC has been minted.
Minted : record {
block_index : nat64;
minted_amount : nat64;
Expand All @@ -117,12 +122,22 @@ type PendingUtxo = record {
confirmations: nat32;
};

// Number of nanoseconds since the Unix Epoch
type Timestamp = nat64;

type SuspendedUtxo = record {
utxo : Utxo;
reason : SuspendedReason;
earliest_retry: Timestamp;
};

type UpdateBalanceError = variant {
// There are no new UTXOs to process.
NoNewUtxos : record {
current_confirmations: opt nat32;
required_confirmations: nat32;
pending_utxos: opt vec PendingUtxo;
suspended_utxos: opt vec SuspendedUtxo;
};
// The minter is already processing another update balance request for the caller.
AlreadyProcessing;
Expand Down Expand Up @@ -181,10 +196,16 @@ type InitArgs = record {
/// The minter's operation mode.
mode : Mode;

/// The fee paid per check by the KYT canister.
/// The fee paid per Bitcoin check.
check_fee : opt nat64;

/// The fee paid per check by the KYT canister (deprecated, use check_fee instead).
kyt_fee : opt nat64;

/// The canister id of the KYT canister.
/// The canister id of the Bitcoin checker canister.
btc_checker_principal: opt principal;

/// The canister id of the KYT canister (deprecated, use btc_checker_principal instead).
kyt_principal: opt principal;
};

Expand All @@ -204,11 +225,17 @@ type UpgradeArgs = record {
/// If set, overrides the current minter's operation mode.
mode : opt Mode;

/// The fee per check by the KYT canister.
/// The fee per Bitcoin check.
check_fee : opt nat64;

/// The fee paid per check by the KYT canister (deprecated, use check_fee instead).
kyt_fee : opt nat64;

/// The principal of the KYT canister.
kyt_principal : opt principal;
/// The principal of the Bitcoin checker canister.
btc_checker_principal : opt principal;

/// The canister id of the KYT canister (deprecated, use btc_checker_principal instead).
kyt_principal: opt principal;
};

type RetrieveBtcStatus = variant {
Expand Down Expand Up @@ -278,7 +305,7 @@ type RetrieveBtcStatusV2 = variant {
// transaction for this request. The payload contains the
// identifier of the transaction on the Bitcoin network.
Confirmed : record { txid : blob };
/// The retrieve bitcoin request has been reimbursed.
/// The retrieve Bitcoin request has been reimbursed.
Reimbursed : ReimbursedDeposit;
/// The minter will try to reimburse this transaction.
WillReimburse : ReimbursementRequest;
Expand All @@ -300,7 +327,10 @@ type BitcoinAddress = variant {

type MinterInfo = record {
min_confirmations : nat32;
// This amount is based on the `retrieve_btc_min_amount` setting during canister
// initialization or upgrades, but may vary according to current network fees.
retrieve_btc_min_amount : nat64;
// The same as `check_fee`, but the old name is kept here to be backward compatible.
kyt_fee : nat64;
};

Expand All @@ -312,6 +342,14 @@ type ReimbursementReason = variant {
};
};

type SuspendedReason = variant {
// The minter ignored this UTXO because UTXO's value is too small to pay
// the check fees.
ValueTooSmall;
// The Bitcoin checker considered this UTXO to be tainted.
Quarantined;
};

type Event = variant {
init : InitArgs;
upgrade : UpgradeArgs;
Expand Down Expand Up @@ -352,7 +390,12 @@ type Event = variant {
clean : bool;
kyt_provider : opt principal;
};
checked_utxo_v2 : record {
utxo : Utxo;
account : Account;
};
ignored_utxo : record { utxo: Utxo; };
suspended_utxo : record { utxo: Utxo; account: Account; reason: SuspendedReason };
retrieve_btc_kyt_failed : record {
address : text;
amount : nat64;
Expand All @@ -378,7 +421,7 @@ type MinterArg = variant {
service : (minter_arg : MinterArg) -> {
// Section "Convert BTC to ckBTC" {{{

// Returns the bitcoin address to which the owner should send BTC
// Returns the Bitcoin address to which the owner should send BTC
// before converting the amount to ckBTC using the [update_balance]
// endpoint.
//
Expand Down Expand Up @@ -453,7 +496,7 @@ service : (minter_arg : MinterArg) -> {

/// Returns the status of a withdrawal request request using the RetrieveBtcStatusV2 type.
retrieve_btc_status_v2 : (record { block_index : nat64 }) -> (RetrieveBtcStatusV2) query;

// Returns the withdrawal statues by account.
//
// # Note
Expand Down
Loading

0 comments on commit a440514

Please sign in to comment.