Wrong canister principals are generated by `dfx generate` and other
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 204
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
Wrong canister principals are generated by dfx generate, if canisters were not created/deployed before calling generate. For more details see here.
The bug seems repeatable by DFX 0.19.0.
The bug also appears in my PR https://github.com/dfinity/sdk/pull/3710. After this PR, the bug appears not only in dfx generate, but also in dfx deploy (and probably dfx build). Meanwhile, if I did testing right, in 0.19.0 it appears only for dfx generate.
I tried the following:
- Start DFX
- run
dfx generatein an ICP software folder.
I expected to see this happen: dfx generate to bail out like dfx build does in this situation.
Instead, this happened: Wrong canister principals are put into .dfx/local/lsp/.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing dfx generate in an ICP software folder without creating or deploying canisters, then inspect the generated principals under .dfx/local/lsp/. Compare the behavior with dfx build and verify whether dfx deploy is also affected; done means generation fails instead of writing incorrect principals, without introducing the reported regressions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100