Links from another instance

So I’m able to get an entry that instance A commits and instance B retrieves when running two instances on the same conductor but it doesn’t seem to work for links.
This is my process so far:

  1. Instance A commits an entry and links it to their AGENT_ADDRESS.
  2. Instance A can retrieve this link using their own AGENT_ADDRESS.
  3. Instance B gets back an empty Vec when trying to retrieve the links to Instance A’s AGENT_ADDRESS.

Is this possible or am I trying to do something a bit weird here?

This should be an entirely legitimate use of links. I suspect that something’s off re: propagation of data. Does it work if you wait long enough? If not, I suspect that it’s caused by the way links are validated:

  1. In order to be valid and available, a link metadata must point to a base that exists.
  2. If a link metadata arrives at a validator before the base it’s attached to, the validator keeps it in an intedeterminate state — sort of an “I can’t validate yet; holding this for a while in case the base shows up” state.

This should be fine if B sees A as the authority for their own agent address and asks A for all the links on its own agent address. But if B ends up being an authority, it’ll search its own DHT shard for the links and find none. But still, I’d expect the base to eventually propagate and trigger validation of the link metadata.

@thedavidmeister @wollum I feel like one or both of you were working on out-of-order propagation/validation; do you have any insight into this issue?

only that it sounds right what you’re saying @pauldaoust

we have a shopping list of “nice to haves” around dependant validation logic that also @maackle knows a fair bit about

at the moment the basic case you described should work… if a link comes in that needs a base to validate it should loop until it gets what it needs and try again :slight_smile:

So this still doesn’t work even if I give them over 15 mins to propagate.
I noticed this error in the conductor log:


This is happening for both agents. In the above error that’s Bob’s hdk::AGENT_ADDRESS that is NOT valid!. I’m not sure what this means though. UnexpectedEof seems like it might be having trouble reading in some data?
Maybe this is worth a github issue?

Agents (i.e. AgentIds) are validated like all entries, but there is a special validation callback for that: validate_agent

See examples in the holochain-rust repository:

Can you post your implementation of this callback? My guess would be that the type parameter for the EntryValiationData struct is wrong and that the EOF error comes out of serde.

The signature should look like this:

#[validate_agent]
pub fn validate_agent(validation_data: EntryValidationData<AgentId>) {
   Ok(())
}

If it’s not that, what storage implementation have you configured in the conductor config? Or are you running it with hc run?

Yeh my validate_agent function is identical to that.
My storage is

[instances.storage]
  type = "memory"

Do you think maybe I’m running out of memory?

I tried switching this to:

[instances.storage]
  type = "file"
  path = "storage"

And I’m still getting the same error.