cycles-management: add pitfall for icp cycles transfer vs icp canister top-up#238
cycles-management: add pitfall for icp cycles transfer vs icp canister top-up#238joozzed wants to merge 1 commit into
Conversation
icp cycles transfer moves cycles between cycles-ledger balances (like a token transfer). Pointing it at a canister's principal credits that principal's ledger balance, not the canister's execution/compute cycle balance -- canister status shows no change and the canister keeps burning toward freezing. icp canister top-up is the correct command. Adds evaluations/cycles-management.json (new) with 2 output evals and trigger evals covering this distinction.
|
Thank you for contributing! Unfortunately this repository does not accept external contributions yet. We are working on enabling this by aligning our internal processes and our CI setup to handle external contributions. However this will take some time to set up so in the meantime we unfortunately have to close this Pull Request. We hope you understand and will come back once we accept external PRs. — The DFINITY Foundation |
|
Hey @joozzed, thanks for the contribution! I will check this on Monday and see if we can open the repo for external contributions. |
|
Thank you for contributing! Unfortunately this repository does not accept external contributions yet. We are working on enabling this by aligning our internal processes and our CI setup to handle external contributions. However this will take some time to set up so in the meantime we unfortunately have to close this Pull Request. We hope you understand and will come back once we accept external PRs. — The DFINITY Foundation |
|
Dear @joozzed, In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA. If you decide to agree with it, please visit this issue and read the instructions there. Once you have signed it, re-trigger the workflow on this PR to see if your code can be merged. — The DFINITY Foundation |
marc0olo
left a comment
There was a problem hiding this comment.
Reviewed and verified all commands against the live icp CLI (v1.0.2). Accurate, and a genuinely useful pitfall — nice catch on a real footgun.
Verified against the CLI:
icp cycles transfer <AMOUNT> <RECEIVER>andicp canister top-up --amount <AMOUNT> <CANISTER>— both confirmed--amountk/m/b/t suffixes — confirmed verbatim in--helptop-up backend ... -e ic(name → needs environment) andcycles transfer ... -n ic(principal → network) are both consistent with the repo's own flag guidance inicp-cli/SKILL.md
The core claim holds: the cycles ledger tracks balances per-principal, so crediting a canister's principal ≠ the canister's execution balance, and icp canister status reflects only the latter. Silent no-op for funding is correct.
One optional nit: icp cycles transfer also supports k/m/b/t suffixes, so the WRONG example could use 600b instead of 600000000000 — then the two lines differ only in the meaningful way (subcommand + flag), which is the point of the side-by-side.
LGTM.
Summary
cycles-management:icp cycles transfercredits the recipient's cycles-ledger balance, not a canister's execution/compute cycle balance — pointing it at a canister principal silently fails to fund the canister, with no error and no visible change inicp canister status.evaluations/cycles-management.json(did not previously exist) with 2 output evals and trigger evals covering this distinction.Found via a real incident: made this exact mistake twice in a row against a live mainnet canister before realizing
icp canister top-upwas the correct command.Test plan
npm run validate— 26 skills validated, all passed, no new warningsEval 1: Top up a mainnet canister
Eval 2: Cycles transfer does not fund a canister
Trigger evals