Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

DNA ADDRESS != DNA entry address #2182

Open
Connoropolous opened this issue Apr 22, 2020 · 2 comments
Open

DNA ADDRESS != DNA entry address #2182

Connoropolous opened this issue Apr 22, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Connoropolous
Copy link
Collaborator

Connoropolous commented Apr 22, 2020

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 Connoropolous added the bug Something isn't working label Apr 22, 2020
@Connoropolous Connoropolous changed the title hdk::DNA_ADDRESS is empty (bug) hdk::DNA_ADDRESS is wrong Apr 22, 2020
@Connoropolous Connoropolous changed the title hdk::DNA_ADDRESS is wrong DNA ADDRESS != DNA entry address Apr 22, 2020
@Connoropolous
Copy link
Collaborator Author

Looks like the reason may be that the commit of the DNA commits this:

// Commit DNA to chain
let dna_entry = Entry::Dna(Box::new(dna.clone()));
let dna_commit = commit_entry(dna_entry, None, &context_clone).await;

where dna is wrapped in Entry::Dna

@zippy
Copy link
Member

zippy commented May 11, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants