holochain-rust
holochain-rust copied to clipboard
DNA ADDRESS != DNA entry address
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...
- clone https://github.com/Connoropolous/holochain-dna-bug-reproduce
- in the folder, launch nix-shell,
nix-shell https://holochain.love - 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
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
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.