holochain-rust icon indicating copy to clipboard operation
holochain-rust copied to clipboard

DNA ADDRESS != DNA entry address

Open Connoropolous opened this issue 5 years ago • 2 comments

building off of https://forum.holochain.org/t/dna-address-dna-entry-address/2834

Use case was trying to link off of hdk::DNA_ADDRESS, but that didn't work because it suggests that no entry with that address is found.

Here are steps to reproduce...

  1. clone https://github.com/Connoropolous/holochain-dna-bug-reproduce
  2. in the folder, launch nix-shell, nix-shell https://holochain.love
  3. Run npm run hc:test

Relevant code blocks https://github.com/Connoropolous/holochain-dna-bug-reproduce/blob/190abd383358bf6e436ead76d714cff738caeb38/dna_src/test/notes/index.js#L2-L11 which calls https://github.com/Connoropolous/holochain-dna-bug-reproduce/blob/190abd383358bf6e436ead76d714cff738caeb38/dna_src/zomes/notes/code/src/note/handlers.rs#L26-L33

originally reported by @ddd-mtl

Connoropolous avatar Apr 22 '20 12:04 Connoropolous

Looks like the reason may be that the commit of the DNA commits this: https://github.com/holochain/holochain-rust/blob/420fe08c4dfac8f3281e5139e199d7626a142090/crates/core/src/nucleus/actions/initialize.rs#L87-L89

where dna is wrapped in Entry::Dna

Connoropolous avatar Apr 22 '20 13:04 Connoropolous

Thanks @Connoropolous & @ddd-mtl. Note that in general linking off the DNA address is considered an anti-pattern because it will create a definitive dht hot-spot. Of course for small hAapps it can be useful, and this shouldn't be failing like that.

zippy avatar May 11 '20 19:05 zippy