dfinity / cycles-ledger

The cycles ledger is a global ledger canister that enables principal IDs to hold cycles.
Apache License 2.0
8 stars 3 forks source link

feature request: alternative withdrawal method by making arbitrary canister call #129

Open ninegua opened 4 months ago

ninegua commented 4 months ago

It would be similar to wallet_call that is offered by cycle wallet at the moment.

type WalletResultCall = variant {
  Ok : record { return: blob };
  Err : text;
};

//Call Forwarding
  wallet_call: (record {
    canister: principal;
    method_name: text;
    args: blob;
    cycles: nat64;
  }) -> (WalletResultCall);
  wallet_call128: (record {
    canister: principal;
    method_name: text;
    args: blob;
    cycles: nat;
  }) -> (WalletResultCall);

This would enable users to make calls that require cycles. For example, an ICRC token canister may want its fees paid in cycles.

I know that there is a security concern of outstanding call contexts that could prevent ledger from being upgraded. But I still think this is worth discussing.

sesi200 commented 1 month ago

Once we have best-effort messaging we can requests like this time out after a while. This way the cycles ledger would not risk becoming unupgradeable. Let's discuss this once we have best-effort messages