-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Social Discovery to add found DIs to the Gestalt Graph #316
Comments
From this comment (https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/144#note_501235581) it looks like the |
Once you have figured out what needs to be changed, it's better to break down this issue from a general "review issue" to focused sub issues on things that need to be changed. We can do a meeting to review the details. |
Looks like my hunch about So the process of growing the gestalt graph is as follows:
|
Possibility for the gestalt graph to be edited manually: https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/195#note_600203842 - not sure if this functionality is still intended to exist |
I was actually incorrect in my original understanding of the discoverGestaltBy* functions - I had originally assumed that discovery did NOT set nodes/identities into the gestalt graph and instead only created links between them in the graph, however this is incorrect. Discovery does in fact set discovered nodes and identities into the gestalt graph and so this is a way of growing the gestalt graph. The caveat to this is that the setting of nodes and identities only happens when a link is found, so you cannot set a new node/identity with no links into the gestalt graph through discovery. |
Discovery is meant to be for discovering other gestalts, not your own. In this case, we can assume that the |
Right now, all |
We also need our node to be added to the gestalt graph when bootstrapping, which is easy enough to add to Not only would the node itself need to be updated in the gestalt graph, but all of the other nodes/identities in its gestalt, since they would now be linked to a node with a different ID. https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/195#note_630611063 - this comment, in particular the line "This is by design, node id changes induces a need to recreate claims. Which is why key changes imply a change of identity", makes me wonder if key pair changes should trigger links in the gestalt graph to be removed? This could probably be a separate issue though. |
I believe discovery was meant to be a social discovery (not DHT discovery which is supposed to occur automatically in kademlia/nodegraph). And your own gestalt doesn't need to be discovered simply because it's already linked in your sigchain. However the node graph may need to be populated when you gestalt updates. This is where the gossip protocol is meant to come in #190, but I haven't fully specced out how that's supposed to work. |
So does this mean that your own gestalt doesn't need to be represented in your gestalt graph, only other people's gestalts? Since this information is stored on your sigchain? This would simplify things a lot considering the gestalt graph is currently not updated/modified by any other domains (besides discovery). The gestalt graph also currently doesn't update or communicate with any other domains besides the ACL. The gestalt graph at the moment is completely cut off from nodes/identities/sigchain and there's no direct communication between them. From the original gestalt graph discussion it seems that your own gestalt was expected to be represented in your gestalt graph, but I don't think there's a reason that it needs to be? |
No your own gestalt would still in the gestalt graph. Identity related manipulation should mutate the gestalt graph. |
The gestalt graph would be consulted when identity decisions and trust decisions, it would be shown to the end user. This is hard to visualise until you see the GUI. The CLI is quite barebones on its visualisation. |
So the final checklist of what needs to be done to get the relevant tests working as expected is:
Additionally (as a separate issue most likely), in order to have your own gestalt represented in your gestalt graph we need to:
So there are really two sub issues here:
The first issue is the only one blocking #311, the second issue is more complex and can also likely be done alongside #317 (mostly point 4). |
I think this issue can probably be renamed and cover the |
If you're just making changes to the src, branch from master first. You can always rebase later. |
The overall purpose of the gestalt graph is create and maintain a graph of trust. So you know that you're sharing a vault with a gestalt and not a single node. So all the other pieces come together to enable this. The GG is also eventually consistent and also completely decentralised. Every node in a gestalt should share the gestalt graph DB via the gossip protocol but other nodes may have a completely different gestalt graph simply because their field of view is different. |
I'll circle back to this once nodes and vaults are working and we can review in detail. This is a major part of the decentralised trust arm of PK. |
Btw alot of gestalt graph theory was written into the polykey-design issues in gitlab. And was meant to have fully realised in our gestalts wiki article. You might want to refer back to the polykey-design repo too. |
identitiesInfoGetConnected
RPC Handler
identitiesInfoGetConnected
RPC Handler
I want to point out a few related issues to this:
During our discussion about discovery, and how it should be a background asynchronous spidering process. I was thinking of making use of some async abstractions to implement this:
Unlike the |
Everything from this issue has been resolved in #320, except for adding nodes/identities to the Gestalt Graph during vault sharing (since this has to wait until the vaults work being done in #266 is completed). Now we have the following features in order to implement social discovery:
With the combination of these features, the gestalt graph will be maintained with the current state of all of the gestalts you trust. |
Specification
Currently, most of the Gestalts CLI commands do not work in isolation as they expect nodes and identities to have already been set in the Gestalt Graph. The commands will fail with an
ErrorGestaltsGraphNodeIdMissing
orErrorGestaltsGraphIdentityIdMissing
error, or will return no data.This is because(outdated)identitiesInfoGetConnected
, which is supposed to add found connected identities to the gestalt graph, is currently incomplete and is inaccessible to the CLI.When choosing to trust a node/identity (i.e. to send notifications/vault share), this should add the node/identity to our gestalt graph. This can be done inside the handlers for these commands. Once done, this should trigger discovery on the added node/identity.
We don't want to have to await this discovery, so the
Discovery
domain needs to be converted fromCreateDestroy
toCreateDestroyStartStop
so that it can have underlying state that it can crawl in the background.Additional context
Tasks
identitiesInfoGetConnected
to the CLIThe text was updated successfully, but these errors were encountered: