sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Wrong canister principals are generated by `dfx generate` and other

Open vporton opened this issue 1 year ago • 2 comments

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:

  1. Start DFX
  2. run dfx generate in 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/.

vporton avatar Apr 28 '24 23:04 vporton

This bug happens not only on dfx generate. The following also caused it:

for i in main order personhood payments pst CanDBIndex NacDBIndex CanDBPartition NacDBPartition ic_eth internet_identity; do dfx deploy -vv $i; done in https://github.com/vporton/zondirectory2 repo

vporton avatar Apr 29 '24 16:04 vporton

I determined that this bug happens even without generate in branch build-only-necessary, not the upstream master branch.

The branch build-only-necessary-dev contains the test wrong_ids.bash that seems to reliably reprise this bug.

vporton avatar Apr 29 '24 19:04 vporton